Makefile revision 5dbfd19ad5fcc2b779f40f80fa05c1bd28fd0b4e
3b4098640dd85040270f39b9a5ee5e22de99d3d6Mark Andrews# CDDL HEADER START
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# The contents of this file are subject to the terms of the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Common Development and Distribution License (the "License").
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# You may not use this file except in compliance with the License.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# See the License for the specific language governing permissions
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# and limitations under the License.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# When distributing Covered Code, include this CDDL HEADER in each
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# If applicable, add the following below this CDDL HEADER, with the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# fields enclosed by brackets "[]" replaced with your own identifying
3b4098640dd85040270f39b9a5ee5e22de99d3d6Mark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# CDDL HEADER END
cedb0bd0c1e3c461b7e479a16d3adfd5b150f1f4Mark Andrews# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Copyright 2011 Nexenta Systems, Inc. All rights reserved.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Use is subject to license terms.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# objects are grouped by source directory
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# local objects
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# This macro should ALWAYS be empty; native APIs are already 'large file'.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# This macro should ALWAYS be empty; native APIs are already 'large file'.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# objects from source under $(LIBCDIR)/port
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# This macro should ALWAYS be empty; native APIs are already 'large file'.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# This macro should ALWAYS be empty; native APIs are already 'large file'.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# NOTE: libc.so.1 must be linked with the minimal crti.o and crtn.o
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# modules whose source is provided in the $(SRC)/lib/common directory.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# This must be done because otherwise the Sun C compiler would insert
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# its own versions of these modules and those versions contain code
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# to call out to C++ initialization functions. Such C++ initialization
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# functions can call back into libc before thread initialization is
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# complete and this leads to segmentation violations and other problems.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Since libc contains no C++ code, linking with the minimal crti.o and
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# crtn.o modules is safe and avoids the problems described above.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# include common library definitions
3b4098640dd85040270f39b9a5ee5e22de99d3d6Mark Andrews# This is necessary to avoid problems with calling _ex_unwind().
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# We probably don't want any inlining anyway.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# enables ASSERT() checking in the threads portion of the library.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# This is automatically enabled for DEBUG builds, not for non-debug builds.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Make string literals read-only to save memory
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(EXTPICS)
3eb9ec750c9088869170dda63e8899b2ba462823Mark AndrewsCPPFLAGS= -D_REENTRANT -D$(MACH64) -D__$(MACH64) $(THREAD_DEBUG) \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein -I. -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob AusteinASFLAGS= $(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) \
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# As a favor to the dtrace syscall provider, libc still calls the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# old syscall traps that have been obsoleted by the *at() interfaces.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Delete this to compile libc using only the new *at() system call traps
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# proc64_id.o is built with defines in $(SRC)/uts/intel/sys/x86_archext.h
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinpics/proc64_id.o := CFLAGS64 += -I$(SRC)/uts/intel
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Inform the run-time linker about libc specialized initialization
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Force libc's internal references to be resolved immediately upon loading
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# in order to avoid critical region problems. Since almost all libc symbols
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
CLEANFILES= \
assym.h \
genassym \
$(ALTPICS)
SRCS= \
$(THREADSMACHOBJS:%.o=threads/%.c) \
$(UNWINDMACHOBJS:%.o=unwind/%.c) \
# $(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
TIL= \
aio.o \
alloc.o \
atexit.o \
atfork.o \
cancel.o \
err.o \
errno.o \
lwp.o \
ma.o \
rand.o \
rwlock.o \
scalls.o \
sched.o \
sema.o \
spawn.o \
stack.o \
synch.o \
thr.o \
tls.o \
$(PORTSTDIO_W:%=pics/%) := \
$(PORTPRINT_W:%=pics/%) := \
$(PORTPRINT_C89:%=pics/%) := \
$(PORTSTDIO_C89:%=pics/%) := \
$(PORTI18N_COND:%=pics/%) := \
lint:
$(BUILD.AR)
setjmp.o \
# assym.h build rules
-o $@ $(GENASSYM_C)
./genassym >>$@