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