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