xref: /titanic_50/usr/src/cmd/sgs/rtld/Makefile.com (revision c1c6f601cc48d067049ea58a07349897a8e225f2)
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 2006 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29RTLD=		ld.so.1
30
31AVLOBJ=		avl.o
32TOOLOBJS=	alist.o strhash.o
33BLTOBJ=		msg.o
34OBJECTS=	$(BLTOBJ) \
35		$(AVLOBJ) \
36		$(TOOLOBJS) \
37		$(P_ASOBJS)   $(P_COMOBJS)   $(P_MACHOBJS)   $(G_MACHOBJS)  \
38		$(S_ASOBJS)   $(S_COMOBJS)   $(S_MACHOBJS)   $(CP_MACHOBJS)
39
40COMOBJS=	$(P_COMOBJS)  $(S_COMOBJS)
41ASOBJS=		$(P_ASOBJS)   $(S_ASOBJS)
42MACHOBJS=	$(P_MACHOBJS) $(S_MACHOBJS)
43NOCTFOBJS=	$(ASOBJS)
44
45include		$(SRC)/lib/Makefile.lib
46include		$(SRC)/cmd/sgs/Makefile.com
47
48PLAT =		$(VAR_PLAT_$(BASEPLAT))
49
50# Dtrace needs an executable data segment.
51NX_MAP=
52
53MAPFILES =	../common/mapfile-vers $(MAPFILE-ORDER) $(MAPFILE-PLAT)
54MAPOPTS =	$(MAPFILES:%=-M%)
55
56# For the libc/libthread unified world:
57# This library needs to be placed in /lib to allow
58# dlopen() functionality while in single-user mode.
59ROOTFS_DYNLIB=	$(RTLD:%=$(ROOTFS_LIBDIR)/%)
60ROOTFS_DYNLIB64=	$(RTLD:%=$(ROOTFS_LIBDIR64)/%)
61
62# For the libc/libthread separated world:
63# A version of this library needs to be placed in /etc/lib to allow
64# dlopen() functionality while in single-user mode.
65ETCLIBDIR=	$(ROOT)/etc/lib
66ETCDYNLIB=	$(RTLD:%=$(ETCLIBDIR)/%)
67
68ROOTDYNLIB=	$(RTLD:%=$(ROOTFS_LIBDIR)/%)
69ROOTDYNLIB64=	$(RTLD:%=$(ROOTFS_LIBDIR64)/%)
70
71
72FILEMODE =	755
73
74CPPFEATUREMACROS= $(VAR_RTLD_CPPFEATUREMACROS)
75
76CPPFLAGS +=	-I$(SRCBASE)/lib/libc/inc \
77		-I$(SRCBASE)/uts/common/krtld \
78		-I$(SRCBASE)/uts/$(PLAT)/krtld \
79		-I$(SRC)/common/sgsrtcid \
80		 $(CPPFEATUREMACROS)
81
82ASFLAGS=	-P -D_ASM $(CPPFLAGS)
83LDLIB =		-L ../../libld/$(MACH)
84RTLDLIB =	-L ../../librtld/$(MACH)
85
86# These definitions require that libc be built in the same workspace
87# as the run-time linker and before the run-time linker is built.
88# This is required for the system's self-consistency in any case.
89CPICLIB =	$(VAR_RTLD_CPICLIB)
90CPICLIB64 =	$(VAR_RTLD_CPICLIB64)
91CLIB =		-lc_pic
92
93LDLIBS +=	$(CONVLIBDIR) $(CONV_LIB) \
94		$(CPICLIB) $(CLIB) \
95		$(LDDBGLIBDIR) $(LDDBG_LIB) \
96		$(RTLDLIB) -lrtld \
97		$(LDLIB) $(LD_LIB)
98
99DYNFLAGS +=	-i -e _rt_boot $(VERSREF) -Bsymbolic -zlazyload -znodlopen \
100		-z interpose -zdtrace=dtrace_data $(MAPOPTS) '-R$$ORIGIN'
101
102BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
103
104BLTDEFS=	msg.h
105BLTDATA=	msg.c
106BLTMESG=	$(SGSMSGDIR)/rtld
107
108BLTFILES=	$(BLTDEFS) $(BLTDATA) $(BLTMESG)
109
110SGSMSGCOM=	../common/rtld.msg
111SGSMSG32=	../common/rtld.32.msg
112SGSMSG64=	../common/rtld.64.msg
113SGSMSGSPARC=	../common/rtld.sparc.msg
114SGSMSGSPARC32=	../common/rtld.sparc32.msg
115SGSMSGSPARC64=	../common/rtld.sparc64.msg
116SGSMSGINTEL=	../common/rtld.intel.msg
117SGSMSGINTEL32=	../common/rtld.intel32.msg
118SGSMSGINTEL64=	../common/rtld.intel64.msg
119SGSMSGCHK=	../common/rtld.chk.msg
120SGSMSGTARG=	$(SGSMSGCOM)
121SGSMSGALL=	$(SGSMSGCOM) $(SGSMSG32) $(SGSMSG64) \
122		$(SGSMSGSPARC) $(SGSMSGSPARC32) $(SGSMSGSPARC64) \
123		$(SGSMSGINTEL) $(SGSMSGINTEL32) $(SGSMSGINTEL64)
124
125SGSMSGFLAGS1=	$(SGSMSGFLAGS) -m $(BLTMESG)
126SGSMSGFLAGS2=	$(SGSMSGFLAGS) -h $(BLTDEFS) -d $(BLTDATA) -n rtld_msg
127
128SRCS=		$(AVLOBJ:%.o=$(VAR_AVLDIR)/%.c) \
129		$(TOOLOBJS:%.o=$(SGSTOOLS)/common/%.c) \
130		$(COMOBJS:%.o=../common/%.c)  $(MACHOBJS:%.o=%.c) $(BLTDATA) \
131		$(G_MACHOBJS:%.o=$(SRCBASE)/uts/$(PLAT)/krtld/%.c) \
132		$(CP_MACHOBJS:%.o=../$(MACH)/%.c) \
133		$(ASOBJS:%.o=%.s)
134LINTSRCS=	$(SRCS) ../common/lintsup.c
135
136LINTFLAGS +=	-u -Dsun -D_REENTRANT -erroff=E_EMPTY_TRANSLATION_UNIT \
137		-erroff=E_NAME_DECL_NOT_USED_DEF2
138LINTFLAGS64 +=	-u -D_REENTRANT -erroff=E_CAST_INT_TO_SMALL_INT \
139		-erroff=E_NAME_DECL_NOT_USED_DEF2
140
141CLEANFILES +=	$(LINTOUTS)  $(CRTS)  $(BLTFILES)
142CLOBBERFILES +=	$(RTLD)
143