xref: /titanic_52/usr/src/cmd/sgs/Makefile.var (revision fe2f74680a9b0a4c22a80f5da91700cd48e715fe)
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 2007 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# VAR_DTRDIR - directory to find dtrace_data.c in.
143#
144# The dtrace_data.c is under usr/src/common/dtrace in Solaris 11 (and later),
145# but in earlier releases was maintained as separate files under sgs/rtld.
146#
147VAR_DTRDIR=             $(SRCBASE)/common/dtrace
148
149#
150# ld
151#
152VAR_LD_NATIVE_LLDLIBS=
153VAR_LD_LLDFLAGS=	'-R$$ORIGIN/../../../lib'
154VAR_LD_LLDFLAGS64 =	'-R$$ORIGIN/../../../../lib/$(MACH64)'
155
156#
157# on 5.10 we no longer link against libdl - However we still
158# need to link against it when building the SUNWonld package (which
159# may run on 5.9 or 5.8 systems).
160#
161# Below are two macros - they should be toggled one way or the other
162# depending upon whether or not the base build provides '-ldl' or
163# the build of SUNWonld does.
164#
165VAR_PKG_DL_LIB =	-ldl
166VAR_DL_LIB =
167
168#
169# elfdump
170#
171VAR_ELFDUMP_LLDFLAGS=	'-R$$ORIGIN/../../../lib'
172VAR_ELFDUMP_LLDFLAGS64 ='-R$$ORIGIN/../../../../lib/$(MACH64)'
173
174#
175# lddstub
176#
177VAR_LDDSTUB_INTERP=	-I'$$ORIGIN/ld.so.1'
178
179#
180# libconv
181#
182VAR_LIBCONV_CPPFLAGS=
183
184#
185# libdl
186#
187VAR_LIBDL_ROOT4LINK_LIBLINKPATH=	../../lib/
188VAR_LIBDL_ETCDYNLIB=
189
190#
191# libelf
192#
193VAR_LIBELF_LDLIBS=
194VAR_LIBELF_ROOTDEMODIR_DIRMODE=	755
195
196#
197# libld
198#
199VAR_LIBLD_CPPFLAGS=		$(VAR_COM_CPPFLAGS) \
200				$(VAR_AVLINCDIR)
201VAR_LIBLD_64_ROOTFS_LIBDIR=	$(ROOT)/lib/$(MACH64)
202
203#
204# Tools
205#
206VAR_TOOLS_CPPFLAGS=		$(VAR_AVLINCDIR)
207
208#
209# liblddbg
210#
211VAR_LIBLDDBG_V9_ROOTFS_LIBDIR=	$(ROOT)/lib/$(MACH64)
212VAR_LIBLDDBG_CPPFLAGS=-DDEMANGLE
213
214#
215# librtld_db
216#
217VAR_LIBRTLD_DB_RDB_DEMO_LINTFLAGS64=	$(VAR_LINTFLAGS64)
218
219#
220# rtld
221#
222VAR_RTLD_CPICLIB=	-L ../../../../lib/libc/$(MACH)
223VAR_RTLD_CPICLIB64=	-L ../../../../lib/libc/$(MACH64)
224VAR_RTLD_SONAME=	/lib/ld.so.1
225VAR_RTLD_V9_SONAME=	/lib/sparcv9/ld.so.1
226
227VAR_RTLD_ETCDYNLIB=
228VAR_RTLD_CPPFEATUREMACROS= \
229			-DLD_BREADTH_DISABLED \
230			-DEXPAND_RELATIVE \
231			-DISSOLOAD_BASENAME_DISABLED
232VAR_RTLD_CPPFLAGS=	$(VAR_AVLINCDIR)
233VAR_RTLD_EXTRASUBDIRS=	mdbmod
234