xref: /titanic_41/usr/src/cmd/sgs/rtld/Makefile.com (revision d89fccd8788afe1e920f842edd883fe192a1b8fe)
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 -I$(SRCBASE)/uts/common/krtld \
77		    -I$(SRCBASE)/uts/$(PLAT)/krtld $(CPPFEATUREMACROS)
78ASFLAGS=	-P -D_ASM $(CPPFLAGS)
79LDLIB =		-L ../../libld/$(MACH)
80RTLDLIB =	-L ../../librtld/$(MACH)
81
82# These definitions require that libc be built in the same workspace
83# as the run-time linker and before the run-time linker is built.
84# This is required for the system's self-consistency in any case.
85CPICLIB =	$(VAR_RTLD_CPICLIB)
86CPICLIB64 =	$(VAR_RTLD_CPICLIB64)
87CLIB =		-lc_pic
88
89LDLIBS +=	$(CONVLIBDIR) $(CONV_LIB) \
90		$(CPICLIB) $(CLIB) \
91		$(LDDBGLIBDIR) $(LDDBG_LIB) \
92		$(RTLDLIB) -lrtld \
93		$(LDLIB) $(LD_LIB)
94
95DYNFLAGS +=	-i -e _rt_boot $(VERSREF) -Bsymbolic -zlazyload -znodlopen \
96		-zdtrace=dtrace_data $(MAPOPTS) '-R$$ORIGIN'
97
98BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
99
100BLTDEFS=	msg.h
101BLTDATA=	msg.c
102BLTMESG=	$(SGSMSGDIR)/rtld
103
104BLTFILES=	$(BLTDEFS) $(BLTDATA) $(BLTMESG)
105
106SGSMSGCOM=	../common/rtld.msg
107SGSMSG32=	../common/rtld.32.msg
108SGSMSG64=	../common/rtld.64.msg
109SGSMSGSPARC=	../common/rtld.sparc.msg
110SGSMSGSPARC32=	../common/rtld.sparc32.msg
111SGSMSGSPARC64=	../common/rtld.sparc64.msg
112SGSMSGINTEL=	../common/rtld.intel.msg
113SGSMSGINTEL32=	../common/rtld.intel32.msg
114SGSMSGINTEL64=	../common/rtld.intel64.msg
115SGSMSGCHK=	../common/rtld.chk.msg
116SGSMSGTARG=	$(SGSMSGCOM)
117SGSMSGALL=	$(SGSMSGCOM) $(SGSMSG32) $(SGSMSG64) \
118		$(SGSMSGSPARC) $(SGSMSGSPARC32) $(SGSMSGSPARC64) \
119		$(SGSMSGINTEL) $(SGSMSGINTEL32) $(SGSMSGINTEL64)
120
121SGSMSGFLAGS1=	$(SGSMSGFLAGS) -m $(BLTMESG)
122SGSMSGFLAGS2=	$(SGSMSGFLAGS) -h $(BLTDEFS) -d $(BLTDATA) -n rtld_msg
123
124SRCS=		$(AVLOBJ:%.o=$(VAR_AVLDIR)/%.c) \
125		$(TOOLOBJS:%.o=$(SGSTOOLS)/common/%.c) \
126		$(COMOBJS:%.o=../common/%.c)  $(MACHOBJS:%.o=%.c) $(BLTDATA) \
127		$(G_MACHOBJS:%.o=$(SRCBASE)/uts/$(PLAT)/krtld/%.c) \
128		$(CP_MACHOBJS:%.o=../$(MACH)/%.c) \
129		$(ASOBJS:%.o=%.s)
130LINTSRCS=	$(SRCS) ../common/lintsup.c
131
132LINTFLAGS +=	-u -Dsun -D_REENTRANT -erroff=E_EMPTY_TRANSLATION_UNIT \
133		-erroff=E_NAME_DECL_NOT_USED_DEF2
134LINTFLAGS64 +=	-u -D_REENTRANT -erroff=E_CAST_INT_TO_SMALL_INT \
135		-erroff=E_NAME_DECL_NOT_USED_DEF2
136
137CLEANFILES +=	$(LINTOUTS)  $(CRTS)  $(BLTFILES)
138CLOBBERFILES +=	$(RTLD)
139