Makefile.var revision 5088:26c540f30cd3
1275970Scy#
2275970Scy# CDDL HEADER START
3275970Scy#
4275970Scy# The contents of this file are subject to the terms of the
5275970Scy# Common Development and Distribution License (the "License").
6275970Scy# You may not use this file except in compliance with the License.
7275970Scy#
8275970Scy# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9275970Scy# or http://www.opensolaris.org/os/licensing.
10275970Scy# See the License for the specific language governing permissions
11275970Scy# and limitations under the License.
12275970Scy#
13275970Scy# When distributing Covered Code, include this CDDL HEADER in each
14275970Scy# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15275970Scy# If applicable, add the following below this CDDL HEADER, with the
16275970Scy# fields enclosed by brackets "[]" replaced with your own identifying
17275970Scy# information: Portions Copyright [yyyy] [name of copyright owner]
18275970Scy#
19275970Scy# CDDL HEADER END
20275970Scy#
21275970Scy
22275970Scy#
23275970Scy# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24275970Scy# Use is subject to license terms.
25275970Scy#
26275970Scy# ident	"%Z%%M%	%I%	%E% SMI"
27275970Scy#
28275970Scy
29275970Scy# The link-editor related source files and Makefile files are normally unified
30275970Scy# across all presently maintained release gates.  However, some of the compiler
31275970Scy# pre-processor flags, linker flags are different among the releases.  This
32275970Scy# file is used to specify such flags. 
33275970Scy# 
34275970Scy# This file is included by ./Makefile.com, but may also be included directly
35275970Scy# in the case where the utility is relying on the contents of 
36275970Scy# ../../Makefile.com.
37275970Scy# 
38275970Scy# This file should be the only file which is different among the presently
39275970Scy# maintained release workspaces and the files that generate the link-editors
40275970Scy# and related tools.
41275970Scy
42275970Scy#
43275970Scy# CPPFEATUREMACROS provides for selectively turning on/off features within the
44275970Scy# build of ld.so.1 and liblddbg.so.
45275970Scy#
46275970Scy# Current values for ld.so.1 are:
47275970Scy#
48275970Scy#	LD_BREADTH_DISABLED
49275970Scy#		per bug id 4313765, the LD_BREADTH= environment variable is no
50275970Scy#		longer checked.  However, on older releases we still want to
51275970Scy#		keep this check valid.
52275970Scy#
53275970Scy#	EXPAND_RELATIVE
54275970Scy#		per bug id 4336980 (and 4336878), relative path expansion is
55275970Scy#		insured at process startup.  This implementation can come at
56275970Scy#		some cost unless the corresponding getcwd() implementation from
57275970Scy#		libc_pic.a is also available.  On older releases defer any
58275970Scy#		relative pathname expansion until it is required.
59275970Scy#
60275970Scy#	ISSOLOAD_BASENAME_DISABLED
61275970Scy#		The bugfix for bug#4469400 updates the logic by which
62275970Scy#		shared objects are loaded into memory (and makes it
63275970Scy#		more precise).  However - this update to logic can
64275970Scy#		mess up the loading of objects which have a dependency
65275970Scy#		on both '/usr/lib/lwp/libthread.so.1' and
66275970Scy#		'/usr/lib/libthread.so.1'.  The error that occurs is that
67275970Scy#		both libraries are loaded into memory - which doesn't
68275970Scy#		work out very well.  This fix re-enables the `loose'
69275970Scy#		logic which was implemented on older releases to avoid
70275970Scy#		exposing problems with multiple libthreads.  Since Soliars9
71275970Scy#		again only has one libthread - we can use the more precise
72275970Scy#		logic.
73275970Scy#
74275970Scy#	SIEBEL_DISABLE
75275970Scy#		Prior to Solaris 10, bug fixes 4651709 and 4651493 were deter-
76275970Scy#		mined to be inappropriate for patch releases as they broke the
77275970Scy#		Siebel server.  Siebel agree to fix their code in preparation
78275970Scy#		for these changes to become default in Solaris 10.  Users who
79275970Scy#		want these fixes in patch releases can set LD__FIX__1.
80275970Scy#
81275970Scy#
82275970Scy# Current value for liblddbg.so is:
83275970Scy#
84275970Scy#	DEMANGLE
85275970Scy#		enable use of the "demangle" debug token.  Old versions of the
86275970Scy#		demangle library libdemangle.so.1 used an excessive amount of
87275970Scy#		stack space that could cause debugging a threaded application
88275970Scy#		(with say LD_DEBUG=symbols,demangle) to segv because of an
89275970Scy#		exhausted stack.  See 4376081.  DEMANGLE should not be enabled
90275970Scy#		for patch builds.
91275970Scy#
92275970Scy#		Note that demangling support within liblddbg.so.1 is always
93275970Scy#		available, as tools such as elfdump(1) and pvs(1) may call this
94275970Scy#		directly.  These tools aren't threaded, and thus don't expose
95275970Scy#		the problems raised by enabling ld.so.1's debugging output.
96275970Scy#
97275970Scy#
98275970Scy# Although most files are unified among on10-gate, on81-patch, and on28-patch
99275970Scy# gates, some files in libld and rtld need to use #ifdef to distinguish between
100275970Scy# the patch release, and for the packages targeting to the pre-libc/libthread
101275970Scy# unified environment.  These values are available for CPPFLAGS:
102275970Scy#	
103275970Scy#	SGS_PRE_UNIFIED_PROCESS
104275970Scy#
105275970Scy#		is set if the target release is for pre-libc/libthread unified
106275970Scy#		environment. This is used for rtld and crle.
107275970Scy
108275970Scy#
109275970Scy# Common Macro definitions
110275970Scy#
111275970ScyVAR_CPPFLAGS=
112275970ScyVAR_XFFLAG=		-xF=%all
113275970Scy
114275970ScyVAR_LINTFLAGS64=	-Xarch=$(MACH64:sparcv9=v9)
115275970ScyVAR_I386_ARCH=		intel
116275970Scy
117275970ScyVAR_PLAT_sparc=		sparc
118275970ScyVAR_PLAT_i386=		intel/ia32
119275970ScyVAR_PLAT_amd64=		intel/amd64
120275970Scy
121275970ScyVAR_POUND_1=
122275970ScyVAR_POUND_2=		$(POUND_SIGN)
123275970ScyVAR_POUND_3=		$(POUND_SIGN)
124275970Scy
125275970Scy#
126275970Scy# VAR_AVLDIR - directory to find avl.c in.
127275970Scy#
128275970Scy# The avl.c file is under usr/src/common/avl in Solaris 10 (and later),
129275970Scy# but in earlier releases it is not present (problem to be solved).
130275970Scy#
131275970Scy# The avl.h and avl_impl.h files are under usr/src/uts/common/sys in
132275970Scy# Solaris 10 (and later). They are under usr/src/cmd/sgs/tools/common/sys
133275970Scy# in Solaris 9 and earlier.
134275970Scy#
135275970Scy# For Solaris 9 and earlier releases, we will have our own copy of the
136275970Scy# files avl.c, avl.h and avl_impl.h until these files are back ported into
137275970Scy# the system.
138275970Scy#
139275970ScyVAR_AVLDIR=		$(SRCBASE)/common/avl
140275970ScyVAR_AVLINCDIR=
141275970Scy
142275970Scy#
143275970Scy# VAR_DTRDIR - directory to find dtrace_data.c in.
144275970Scy#
145275970Scy# In Solaris 10 and earlier releases, dtrace_data.c was maintained as separate
146275970Scy# files under sgs/rtld.  This file is now under usr/src/common/dtrace.
147275970Scy#
148275970ScyVAR_DTRDIR=             $(SRCBASE)/common/dtrace
149275970Scy
150275970Scy#
151275970Scy# VAR_SGSBINPROG
152275970Scy#
153275970Scy# For Solaris 10 and earlier releases, the SGS components were installed in
154275970Scy# /usr/ccs/bin.  These components are now installed in /usr/bin with associated
155275970Scy# symbolic links for compatibility. For previous behavior, set the VAR_SGSBIN*
156275970Scy# variables to the appropriate ROOTCCSBIN* rule and set the VAR_SGSCCSLINK*
157275970Scy# rules to null.
158275970Scy#
159275970ScyVAR_SGSBIN=		$(ROOTBIN)
160275970ScyVAR_SGSBINPROG=		$(ROOTPROG)
161275970ScyVAR_SGSBIN64=		$(ROOTBIN64)
162275970ScyVAR_SGSBINPROG64=	$(ROOTPROG64)
163275970Scy
164275970ScyVAR_SGSCCSLINK=		$(ROOTCCSBINLINK)
165275970ScyVAR_SGSCCSLINK64=	$(ROOTCCSBINLINK64)
166275970Scy
167275970Scy#
168275970Scy# ld
169275970Scy#
170275970ScyVAR_LD_NATIVE_LLDLIBS=
171275970ScyVAR_LD_LLDFLAGS=	'-R$$ORIGIN/../../lib'
172275970ScyVAR_LD_LLDFLAGS64 =	'-R$$ORIGIN/../../../lib/$(MACH64)'
173275970Scy
174275970Scy#
175275970Scy# on 5.10 we no longer link against libdl - However we still
176275970Scy# need to link against it when building the SUNWonld package (which
177275970Scy# may run on 5.9 or 5.8 systems).  
178275970Scy#
179275970Scy# Below are two macros - they should be toggled one way or the other
180275970Scy# depending upon whether or not the base build provides '-ldl' or
181275970Scy# the build of SUNWonld does.
182275970Scy#
183275970ScyVAR_PKG_DL_LIB =	-ldl
184275970ScyVAR_DL_LIB =
185275970Scy
186275970Scy#
187275970Scy# elfdump
188275970Scy#
189275970ScyVAR_ELFDUMP_LLDFLAGS=	'-R$$ORIGIN/../../lib'
190275970ScyVAR_ELFDUMP_LLDFLAGS64 ='-R$$ORIGIN/../../../lib/$(MACH64)'
191275970Scy
192275970Scy#
193275970Scy# elfedit
194275970Scy#
195275970ScyVAR_ELFEDIT_LLDFLAGS=	'-R$$ORIGIN/../../lib'
196275970ScyVAR_ELFEDIT_LLDFLAGS64 ='-R$$ORIGIN/../../../lib/$(MACH64)'
197275970Scy
198275970Scy#
199275970Scy# lddstub
200275970Scy#
201275970ScyVAR_LDDSTUB_INTERP=	-I'$$ORIGIN/ld.so.1'
202275970Scy
203275970Scy#
204275970Scy# libconv
205275970Scy#
206275970ScyVAR_LIBCONV_CPPFLAGS=
207275970Scy
208275970Scy#
209275970Scy# libdl
210275970Scy#
211275970ScyVAR_LIBDL_ROOT4LINK_LIBLINKPATH=	../../lib/
212275970ScyVAR_LIBDL_ETCDYNLIB=
213275970Scy
214275970Scy#
215275970Scy# libelf
216275970Scy#
217275970ScyVAR_LIBELF_LDLIBS=
218275970ScyVAR_LIBELF_ROOTDEMODIR_DIRMODE=	755
219275970Scy
220275970Scy#
221275970Scy# libld
222275970Scy#
223275970ScyVAR_LIBLD_CPPFLAGS=		$(VAR_COM_CPPFLAGS) \
224275970Scy				$(VAR_AVLINCDIR)
225275970ScyVAR_LIBLD_64_ROOTFS_LIBDIR=	$(ROOT)/lib/$(MACH64)
226275970Scy
227275970Scy#
228275970Scy# Tools
229275970Scy#
230275970ScyVAR_TOOLS_CPPFLAGS=		$(VAR_AVLINCDIR)
231275970Scy
232275970Scy#
233275970Scy# liblddbg
234275970Scy#
235275970ScyVAR_LIBLDDBG_V9_ROOTFS_LIBDIR=	$(ROOT)/lib/$(MACH64)
236275970ScyVAR_LIBLDDBG_CPPFLAGS=-DDEMANGLE
237275970Scy
238275970Scy#
239275970Scy# librtld_db
240275970Scy#
241275970ScyVAR_LIBRTLD_DB_RDB_DEMO_LINTFLAGS64=	$(VAR_LINTFLAGS64)
242275970Scy
243275970Scy#
244275970Scy# rtld
245275970Scy#
246275970ScyVAR_RTLD_CPICLIB=	-L ../../../../lib/libc/$(MACH)
247275970ScyVAR_RTLD_CPICLIB64=	-L ../../../../lib/libc/$(MACH64)
248275970ScyVAR_RTLD_SONAME=	/lib/ld.so.1
249275970ScyVAR_RTLD_V9_SONAME=	/lib/sparcv9/ld.so.1
250275970Scy
251275970ScyVAR_RTLD_ETCDYNLIB=
252275970ScyVAR_RTLD_CPPFEATUREMACROS= \
253275970Scy			-DLD_BREADTH_DISABLED \
254275970Scy			-DEXPAND_RELATIVE \
255275970Scy			-DISSOLOAD_BASENAME_DISABLED
256275970ScyVAR_RTLD_CPPFLAGS=	$(VAR_AVLINCDIR)
257275970ScyVAR_RTLD_EXTRASUBDIRS=	mdbmod
258275970Scy