xref: /titanic_44/usr/src/cmd/sgs/Makefile.var (revision fbcec90110655a00a2d5c9bdfaf87c7b476a4902)
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 ./Makefile.com, but may also be included directly
35# in the case where the utility is relying on the contents of
36# ../../Makefile.com.
37#
38# This file should be the only file which is different among the presently
39# maintained release workspaces and the files that generate the link-editors
40# and related tools.
41
42#
43# CPPFEATUREMACROS provides for selectively turning on/off features within the
44# build of ld.so.1 and liblddbg.so.
45#
46# Current values for ld.so.1 are:
47#
48#	LD_BREADTH_DISABLED
49#		per bug id 4313765, the LD_BREADTH= environment variable is no
50#		longer checked.  However, on older releases we still want to
51#		keep this check valid.
52#
53#	EXPAND_RELATIVE
54#		per bug id 4336980 (and 4336878), relative path expansion is
55#		insured at process startup.  This implementation can come at
56#		some cost unless the corresponding getcwd() implementation from
57#		libc_pic.a is also available.  On older releases defer any
58#		relative pathname expansion until it is required.
59#
60#	ISSOLOAD_BASENAME_DISABLED
61#		The bugfix for bug#4469400 updates the logic by which
62#		shared objects are loaded into memory (and makes it
63#		more precise).  However - this update to logic can
64#		mess up the loading of objects which have a dependency
65#		on both '/usr/lib/lwp/libthread.so.1' and
66#		'/usr/lib/libthread.so.1'.  The error that occurs is that
67#		both libraries are loaded into memory - which doesn't
68#		work out very well.  This fix re-enables the `loose'
69#		logic which was implemented on older releases to avoid
70#		exposing problems with multiple libthreads.  Since Soliars9
71#		again only has one libthread - we can use the more precise
72#		logic.
73#
74#	SIEBEL_DISABLE
75#		Prior to Solaris 10, bug fixes 4651709 and 4651493 were deter-
76#		mined to be inappropriate for patch releases as they broke the
77#		Siebel server.  Siebel agree to fix their code in preparation
78#		for these changes to become default in Solaris 10.  Users who
79#		want these fixes in patch releases can set LD__FIX__1.
80#
81#
82# Current value for liblddbg.so is:
83#
84#	DEMANGLE
85#		enable use of the "demangle" debug token.  Old versions of the
86#		demangle library libdemangle.so.1 used an excessive amount of
87#		stack space that could cause debugging a threaded application
88#		(with say LD_DEBUG=symbols,demangle) to segv because of an
89#		exhausted stack.  See 4376081.  DEMANGLE should not be enabled
90#		for patch builds.
91#
92#		Note that demangling support within liblddbg.so.1 is always
93#		available, as tools such as elfdump(1) and pvs(1) may call this
94#		directly.  These tools aren't threaded, and thus don't expose
95#		the problems raised by enabling ld.so.1's debugging output.
96#
97#
98# Although most files are unified among on10-gate, on81-patch, and on28-patch
99# gates, some files in libld and rtld need to use #ifdef to distinguish between
100# the patch release, and for the packages targeting to the pre-libc/libthread
101# unified environment.  These values are available for CPPFLAGS:
102#
103#	SGS_PRE_UNIFIED_PROCESS
104#
105#		is set if the target release is for pre-libc/libthread unified
106#		environment. This is used for rtld and crle.
107
108#
109# Common Macro definitions
110#
111VAR_CPPFLAGS=
112VAR_XFFLAG=		-xF=%all
113
114VAR_LINTFLAGS64=	-Xarch=$(MACH64:sparcv9=v9)
115VAR_I386_ARCH=		intel
116
117VAR_PLAT_sparc=		sparc
118VAR_PLAT_i386=		intel/ia32
119VAR_PLAT_amd64=		intel/amd64
120
121VAR_POUND_1=
122VAR_POUND_2=		$(POUND_SIGN)
123VAR_POUND_3=		$(POUND_SIGN)
124
125#
126# VAR_AVLDIR - directory to find avl.c in.
127#
128# The avl.c file is under usr/src/common/avl in Solaris 10 (and later),
129# but in earlier releases it is not present (problem to be solved).
130#
131# The avl.h and avl_impl.h files are under usr/src/uts/common/sys in
132# Solaris 10 (and later). They are under usr/src/cmd/sgs/tools/common/sys
133# in Solaris 9 and earlier.
134#
135# For Solaris 9 and earlier releases, we will have our own copy of the
136# files avl.c, avl.h and avl_impl.h until these files are back ported into
137# the system.
138#
139VAR_AVLDIR=		$(SRCBASE)/common/avl
140VAR_AVLINCDIR=
141
142#
143# VAR_DTRDIR - directory to find dtrace_data.c in.
144#
145# In Solaris 10 and earlier releases, dtrace_data.c was maintained as separate
146# files under sgs/rtld.  This file is now under usr/src/common/dtrace.
147#
148VAR_DTRDIR=             $(SRCBASE)/common/dtrace
149
150#
151# VAR_SGSBINPROG
152#
153# For Solaris 10 and earlier releases, the SGS components were installed in
154# /usr/ccs/bin.  These components are now installed in /usr/bin with associated
155# symbolic links for compatibility. For previous behavior, set the VAR_SGSBIN*
156# variables to the appropriate ROOTCCSBIN* rule and set the VAR_SGSCCSLINK*
157# rules to null.
158#
159VAR_SGSBIN=		$(ROOTBIN)
160VAR_SGSBINPROG=		$(ROOTPROG)
161VAR_SGSBIN64=		$(ROOTBIN64)
162VAR_SGSBINPROG64=	$(ROOTPROG64)
163
164VAR_SGSCCSLINK=		$(ROOTCCSBINLINK)
165VAR_SGSCCSLINK64=	$(ROOTCCSBINLINK64)
166
167#
168# ld
169#
170VAR_LD_NATIVE_LLDLIBS=
171VAR_LD_LLDFLAGS=	'-R$$ORIGIN/../../../lib'
172VAR_LD_LLDFLAGS64 =	'-R$$ORIGIN/../../../../lib/$(MACH64)'
173
174#
175# on 5.10 we no longer link against libdl - However we still
176# need to link against it when building the SUNWonld package (which
177# may run on 5.9 or 5.8 systems).
178#
179# Below are two macros - they should be toggled one way or the other
180# depending upon whether or not the base build provides '-ldl' or
181# the build of SUNWonld does.
182#
183VAR_PKG_DL_LIB =	-ldl
184VAR_DL_LIB =
185
186#
187# elfdump
188#
189VAR_ELFDUMP_LLDFLAGS=	'-R$$ORIGIN/../../../lib'
190VAR_ELFDUMP_LLDFLAGS64 ='-R$$ORIGIN/../../../../lib/$(MACH64)'
191
192#
193# lddstub
194#
195VAR_LDDSTUB_INTERP=	-I'$$ORIGIN/ld.so.1'
196
197#
198# libconv
199#
200VAR_LIBCONV_CPPFLAGS=
201
202#
203# libdl
204#
205VAR_LIBDL_ROOT4LINK_LIBLINKPATH=	../../lib/
206VAR_LIBDL_ETCDYNLIB=
207
208#
209# libelf
210#
211VAR_LIBELF_LDLIBS=
212VAR_LIBELF_ROOTDEMODIR_DIRMODE=	755
213
214#
215# libld
216#
217VAR_LIBLD_CPPFLAGS=		$(VAR_COM_CPPFLAGS) \
218				$(VAR_AVLINCDIR)
219VAR_LIBLD_64_ROOTFS_LIBDIR=	$(ROOT)/lib/$(MACH64)
220
221#
222# Tools
223#
224VAR_TOOLS_CPPFLAGS=		$(VAR_AVLINCDIR)
225
226#
227# liblddbg
228#
229VAR_LIBLDDBG_V9_ROOTFS_LIBDIR=	$(ROOT)/lib/$(MACH64)
230VAR_LIBLDDBG_CPPFLAGS=-DDEMANGLE
231
232#
233# librtld_db
234#
235VAR_LIBRTLD_DB_RDB_DEMO_LINTFLAGS64=	$(VAR_LINTFLAGS64)
236
237#
238# rtld
239#
240VAR_RTLD_CPICLIB=	-L ../../../../lib/libc/$(MACH)
241VAR_RTLD_CPICLIB64=	-L ../../../../lib/libc/$(MACH64)
242VAR_RTLD_SONAME=	/lib/ld.so.1
243VAR_RTLD_V9_SONAME=	/lib/sparcv9/ld.so.1
244
245VAR_RTLD_ETCDYNLIB=
246VAR_RTLD_CPPFEATUREMACROS= \
247			-DLD_BREADTH_DISABLED \
248			-DEXPAND_RELATIVE \
249			-DISSOLOAD_BASENAME_DISABLED
250VAR_RTLD_CPPFLAGS=	$(VAR_AVLINCDIR)
251VAR_RTLD_EXTRASUBDIRS=	mdbmod
252