xref: /titanic_50/usr/src/cmd/sgs/Makefile.var (revision 8e7248e505faa19396d4e853604e3fa7cd2cb3b5)
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 2008 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26
27# The link-editor related source files and Makefile files are normally unified
28# across all presently maintained release gates.  However, some of the compiler
29# pre-processor flags, linker flags are different among the releases.  This
30# file is used to specify such flags.
31#
32# This file is included by ./Makefile.com, but may also be included directly
33# in the case where the utility is relying on the contents of
34# ../../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=
110
111VAR_LINTFLAGS64=	-m64
112VAR_I386_ARCH=		intel
113
114VAR_PLAT_sparc=		sparc
115VAR_PLAT_i386=		intel/ia32
116VAR_PLAT_amd64=		intel/amd64
117
118VAR_POUND_1=
119VAR_POUND_2=		$(POUND_SIGN)
120VAR_POUND_3=		$(POUND_SIGN)
121
122#
123# VAR_AVLDIR - directory to find avl.c in.
124#
125# The avl.c file is under usr/src/common/avl in Solaris 10 (and later),
126# but in earlier releases it is not present (problem to be solved).
127#
128# The avl.h and avl_impl.h files are under usr/src/uts/common/sys in
129# Solaris 10 (and later). They are under usr/src/cmd/sgs/tools/common/sys
130# in Solaris 9 and earlier.
131#
132# For Solaris 9 and earlier releases, we will have our own copy of the
133# files avl.c, avl.h and avl_impl.h until these files are back ported into
134# the system.
135#
136VAR_AVLDIR=		$(SRCBASE)/common/avl
137VAR_AVLINCDIR=
138
139#
140# VAR_DTRDIR - directory to find dtrace_data.c in.
141#
142# In Solaris 10 and earlier releases, dtrace_data.c was maintained as separate
143# files under sgs/rtld.  This file is now under usr/src/common/dtrace.
144#
145VAR_DTRDIR=             $(SRCBASE)/common/dtrace
146
147#
148# VAR_SGSBINPROG
149#
150# For Solaris 10 and earlier releases, the SGS components were installed in
151# /usr/ccs/bin.  These components are now installed in /usr/bin with associated
152# symbolic links for compatibility. For previous behavior, set the VAR_SGSBIN*
153# variables to the appropriate ROOTCCSBIN* rule and set the VAR_SGSCCSLINK*
154# rules to null.
155#
156VAR_SGSBIN=		$(ROOTBIN)
157VAR_SGSBINPROG=		$(ROOTPROG)
158VAR_SGSBIN64=		$(ROOTBIN64)
159VAR_SGSBINPROG64=	$(ROOTPROG64)
160
161VAR_SGSCCSLINK=		$(ROOTCCSBINLINK)
162VAR_SGSCCSLINK64=	$(ROOTCCSBINLINK64)
163
164#
165# ld
166#
167VAR_LD_NATIVE_LLDLIBS=
168VAR_LD_LLDFLAGS=	'-R$$ORIGIN/../../lib'
169VAR_LD_LLDFLAGS64 =	'-R$$ORIGIN/../../../lib/$(MACH64)'
170
171#
172# on 5.10 we no longer link against libdl - However we still
173# need to link against it when building the SUNWonld package (which
174# may run on 5.9 or 5.8 systems).
175#
176# Below are two macros - they should be toggled one way or the other
177# depending upon whether or not the base build provides '-ldl' or
178# the build of SUNWonld does.
179#
180VAR_PKG_DL_LIB =	-ldl
181VAR_DL_LIB =
182
183#
184# elfdump
185#
186VAR_ELFDUMP_LLDFLAGS=	'-R$$ORIGIN/../../lib'
187VAR_ELFDUMP_LLDFLAGS64 ='-R$$ORIGIN/../../../lib/$(MACH64)'
188
189#
190# elfedit
191#
192VAR_ELFEDIT_LLDFLAGS=	'-R$$ORIGIN/../../lib'
193VAR_ELFEDIT_LLDFLAGS64 ='-R$$ORIGIN/../../../lib/$(MACH64)'
194
195#
196# lddstub
197#
198VAR_LDDSTUB_INTERP=	-I'$$ORIGIN/ld.so.1'
199
200#
201# libconv
202#
203VAR_LIBCONV_CPPFLAGS=
204
205#
206# libdl
207#
208VAR_LIBDL_ROOT4LINK_LIBLINKPATH=	../../lib/
209VAR_LIBDL_ETCDYNLIB=
210
211#
212# libelf
213#
214VAR_LIBELF_LDLIBS=
215VAR_LIBELF_ROOTDEMODIR_DIRMODE=	755
216
217#
218# libld
219#
220VAR_LIBLD_CPPFLAGS=		$(VAR_COM_CPPFLAGS) \
221				$(VAR_AVLINCDIR)
222VAR_LIBLD_64_ROOTFS_LIBDIR=	$(ROOT)/lib/$(MACH64)
223
224#
225# Tools
226#
227VAR_TOOLS_CPPFLAGS=		$(VAR_AVLINCDIR)
228
229#
230# liblddbg
231#
232VAR_LIBLDDBG_V9_ROOTFS_LIBDIR=	$(ROOT)/lib/$(MACH64)
233VAR_LIBLDDBG_CPPFLAGS=-DDEMANGLE
234
235#
236# librtld_db
237#
238VAR_LIBRTLD_DB_RDB_DEMO_LINTFLAGS64=	$(VAR_LINTFLAGS64)
239
240#
241# rtld
242#
243VAR_RTLD_CPICLIB=	-L ../../../../lib/libc/$(MACH)
244VAR_RTLD_CPICLIB64=	-L ../../../../lib/libc/$(MACH64)
245VAR_RTLD_SONAME=	/lib/ld.so.1
246VAR_RTLD_V9_SONAME=	/lib/sparcv9/ld.so.1
247
248VAR_RTLD_ETCDYNLIB=
249VAR_RTLD_CPPFEATUREMACROS= \
250			-DLD_BREADTH_DISABLED \
251			-DEXPAND_RELATIVE \
252			-DISSOLOAD_BASENAME_DISABLED
253VAR_RTLD_CPPFLAGS=	$(VAR_AVLINCDIR)
254VAR_RTLD_EXTRASUBDIRS=	mdbmod
255