xref: /titanic_41/usr/src/cmd/sgs/Makefile.var (revision 724365f7556fc4201fdb11766ebc6bd918523130)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21
22#
23# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29# The link-editor related source files and Makefile files are normally unified
30# across all presently maintained release gates.  However, some of the compiler
31# pre-processor flags, linker flags are different among the releases.  This
32# file is used to specify such flags.
33#
34# This file is included by the ./Makefile.com.
35#
36# This file should be the only file which is different among the presently
37# maintained release workspaces and the files that generate the link-editors
38# and related tools.
39
40#
41# CPPFEATUREMACROS provides for selectively turning on/off features within the
42# build of ld.so.1 and liblddbg.so.
43#
44# Current values for ld.so.1 are:
45#
46#	LD_BREADTH_DISABLED
47#		per bug id 4313765, the LD_BREADTH= environment variable is no
48#		longer checked.  However, on older releases we still want to
49#		keep this check valid.
50#
51#	EXPAND_RELATIVE
52#		per bug id 4336980 (and 4336878), relative path expansion is
53#		insured at process startup.  This implementation can come at
54#		some cost unless the corresponding getcwd() implementation from
55#		libc_pic.a is also available.  On older releases defer any
56#		relative pathname expansion until it is required.
57#
58#	ISSOLOAD_BASENAME_DISABLED
59#		The bugfix for bug#4469400 updates the logic by which
60#		shared objects are loaded into memory (and makes it
61#		more precise).  However - this update to logic can
62#		mess up the loading of objects which have a dependency
63#		on both '/usr/lib/lwp/libthread.so.1' and
64#		'/usr/lib/libthread.so.1'.  The error that occurs is that
65#		both libraries are loaded into memory - which doesn't
66#		work out very well.  This fix re-enables the `loose'
67#		logic which was implemented on older releases to avoid
68#		exposing problems with multiple libthreads.  Since Soliars9
69#		again only has one libthread - we can use the more precise
70#		logic.
71#
72#	SIEBEL_DISABLE
73#		Prior to Solaris 10, bug fixes 4651709 and 4651493 were deter-
74#		mined to be inappropriate for patch releases as they broke the
75#		Siebel server.  Siebel agree to fix their code in preparation
76#		for these changes to become default in Solaris 10.  Users who
77#		want these fixes in patch releases can set LD__FIX__1.
78#
79#
80# Current value for liblddbg.so is:
81#
82#	DEMANGLE
83#		enable use of the "demangle" debug token.  Old versions of the
84#		demangle library libdemangle.so.1 used an excessive amount of
85#		stack space that could cause debugging a threaded application
86#		(with say LD_DEBUG=symbols,demangle) to segv because of an
87#		exhausted stack.  See 4376081.  DEMANGLE should not be enabled
88#		for patch builds.
89#
90#		Note that demangling support within liblddbg.so.1 is always
91#		available, as tools such as elfdump(1) and pvs(1) may call this
92#		directly.  These tools aren't threaded, and thus don't expose
93#		the problems raised by enabling ld.so.1's debugging output.
94#
95#
96# Although most files are unified among on10-gate, on81-patch, and on28-patch
97# gates, some files in libld and rtld need to use #ifdef to distinguish between
98# the patch release, and for the packages targeting to the pre-libc/libthread
99# unified environment.  These values are available for CPPFLAGS:
100#
101#	SGS_PRE_UNIFIED_PROCESS
102#
103#		is set if the target release is for pre-libc/libthread unified
104#		environment. This is used for rtld and crle.
105
106#
107# Common Macro definitions
108#
109VAR_CPPFLAGS=
110VAR_XFFLAG=		-xF=%all
111
112VAR_LINTFLAGS64=	-Xarch=$(MACH64:sparcv9=v9)
113VAR_I386_ARCH=		intel
114
115VAR_PLAT_sparc=		sparc
116VAR_PLAT_i386=		intel/ia32
117VAR_PLAT_amd64=		intel/amd64
118
119VAR_POUND_1=
120VAR_POUND_2=		$(POUND_SIGN)
121VAR_POUND_3=		$(POUND_SIGN)
122
123#
124# VAR_AVLDIR - directory to find avl.c in.
125#
126# The avl.c is under usr/src/common/avl in Solaris10 (and later), but
127# in earlier releases it is not present (problem to be solved).
128#
129#
130# The avl.h and avl_impl.h are under usr/src/uts/common/sys in Solaris10
131# (and later).  They are under usr/src/cmd/sgs/tools/common/sys in
132# Solaris 9 and earlier.
133#
134# For Solaris 9 and earlier releases, we will have our own copy of the
135# files avl.c, avl.h and avl_impl.h until these files are back ported into
136# the system.
137#
138VAR_AVLDIR=		$(SRCBASE)/common/avl
139VAR_AVLINCDIR=
140
141#
142# ld
143#
144VAR_LD_NATIVE_LLDLIBS=
145VAR_LD_LLDFLAGS=	'-R$$ORIGIN/../../../lib'
146VAR_LD_LLDFLAGS64 =	'-R$$ORIGIN/../../../../lib/$(MACH64)'
147
148#
149# on 5.10 we no longer link against libdl - However we still
150# need to link against it when building the SUNWonld package (which
151# may run on 5.9 or 5.8 systems).
152#
153# Below are two macros - they should be toggled one way or the other
154# depending upon whether or not the base build provides '-ldl' or
155# the build of SUNWonld does.
156#
157VAR_PKG_DL_LIB =	-ldl
158VAR_DL_LIB =
159
160#
161# elfdump
162#
163VAR_ELFDUMP_LLDFLAGS=	'-R$$ORIGIN/../../../lib'
164VAR_ELFDUMP_LLDFLAGS64 ='-R$$ORIGIN/../../../../lib/$(MACH64)'
165
166#
167# lddstub
168#
169VAR_LDDSTUB_INTERP=	-I'$$ORIGIN/ld.so.1'
170
171#
172# libconv
173#
174VAR_LIBCONV_CPPFLAGS=
175
176#
177# libdl
178#
179VAR_LIBDL_ROOT4LINK_LIBLINKPATH=	../../lib/
180VAR_LIBDL_ETCDYNLIB=
181
182#
183# libelf
184#
185VAR_LIBELF_LDLIBS=
186VAR_LIBELF_ROOTDEMODIR_DIRMODE=	755
187
188#
189# libld
190#
191VAR_LIBLD_CPPFLAGS=		$(VAR_COM_CPPFLAGS) \
192				$(VAR_AVLINCDIR)
193VAR_LIBLD_64_ROOTFS_LIBDIR=	$(ROOT)/lib/$(MACH64)
194
195#
196# Tools
197#
198VAR_TOOLS_CPPFLAGS=		$(VAR_AVLINCDIR)
199
200#
201# liblddbg
202#
203VAR_LIBLDDBG_V9_ROOTFS_LIBDIR=	$(ROOT)/lib/$(MACH64)
204VAR_LIBLDDBG_CPPFLAGS=-DDEMANGLE
205
206#
207# librtld_db
208#
209VAR_LIBRTLD_DB_RDB_DEMO_LINTFLAGS64=	$(VAR_LINTFLAGS64)
210
211#
212# mapfiles
213#
214VAR_MAPFILES_FILES=	$(ROOTDIR)/map.default $(ROOTDIR)/map.pagealign
215
216#
217# rtld
218#
219VAR_RTLD_CPICLIB=	-L ../../../../lib/libc/$(MACH)
220VAR_RTLD_CPICLIB64=	-L ../../../../lib/libc/$(MACH64)
221VAR_RTLD_SONAME=	/lib/ld.so.1
222VAR_RTLD_V9_SONAME=	/lib/sparcv9/ld.so.1
223
224VAR_RTLD_ETCDYNLIB=
225VAR_RTLD_CPPFEATUREMACROS= \
226			-DLD_BREADTH_DISABLED \
227			-DEXPAND_RELATIVE \
228			-DISSOLOAD_BASENAME_DISABLED
229VAR_RTLD_CPPFLAGS=	$(VAR_AVLINCDIR)
230VAR_RTLD_EXTRASUBDIRS=	mdbmod
231