xref: /titanic_51/usr/src/cmd/sgs/rtld/Makefile.com (revision 7014882c6a3672fd0e5d60200af8643ae53c5928)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
55aefb655Srie# Common Development and Distribution License (the "License").
65aefb655Srie# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
2108278a5eSRod Evans
227c478bd9Sstevel@tonic-gate#
23cd3e9333SAli Bahrami# Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
247c478bd9Sstevel@tonic-gate#
257c478bd9Sstevel@tonic-gate
267c478bd9Sstevel@tonic-gateRTLD=		ld.so.1
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gateAVLOBJ=		avl.o
29e127a3e7SrafDTROBJ=		dtrace_data.o
307c478bd9Sstevel@tonic-gateTOOLOBJS=	alist.o strhash.o
317c478bd9Sstevel@tonic-gateBLTOBJ=		msg.o
3208278a5eSRod EvansELFCAPOBJ=	elfcap.o
337c478bd9Sstevel@tonic-gateOBJECTS=	$(BLTOBJ) \
347c478bd9Sstevel@tonic-gate		$(AVLOBJ) \
35e127a3e7Sraf		$(DTROBJ) \
367c478bd9Sstevel@tonic-gate		$(TOOLOBJS) \
3708278a5eSRod Evans		$(ELFCAPOBJ) \
387c478bd9Sstevel@tonic-gate		$(P_ASOBJS)   $(P_COMOBJS)   $(P_MACHOBJS)   $(G_MACHOBJS)  \
397c478bd9Sstevel@tonic-gate		$(S_ASOBJS)   $(S_COMOBJS)   $(S_MACHOBJS)   $(CP_MACHOBJS)
407c478bd9Sstevel@tonic-gate
417c478bd9Sstevel@tonic-gateCOMOBJS=	$(P_COMOBJS)  $(S_COMOBJS)
427c478bd9Sstevel@tonic-gateASOBJS=		$(P_ASOBJS)   $(S_ASOBJS)
437c478bd9Sstevel@tonic-gateMACHOBJS=	$(P_MACHOBJS) $(S_MACHOBJS)
447c478bd9Sstevel@tonic-gateNOCTFOBJS=	$(ASOBJS)
457c478bd9Sstevel@tonic-gate
467c478bd9Sstevel@tonic-gateinclude		$(SRC)/lib/Makefile.lib
477c478bd9Sstevel@tonic-gateinclude		$(SRC)/cmd/sgs/Makefile.com
485aefb655Srie
49f808c858SrafSRCDIR =	../common
5008278a5eSRod EvansELFCAP =	$(SRC)/common/elfcap
517c478bd9Sstevel@tonic-gatePLAT =		$(VAR_PLAT_$(BASEPLAT))
527c478bd9Sstevel@tonic-gate
53e127a3e7Sraf# DTrace needs an executable data segment.
5424da5b34SrieMAPFILE.NED=
557c478bd9Sstevel@tonic-gate
56cd3e9333SAli BahramiMAPFILES +=	$(MAPFILE-ORDER)
577c478bd9Sstevel@tonic-gate
587c478bd9Sstevel@tonic-gate# For the libc/libthread unified world:
597c478bd9Sstevel@tonic-gate# This library needs to be placed in /lib to allow
607c478bd9Sstevel@tonic-gate# dlopen() functionality while in single-user mode.
617c478bd9Sstevel@tonic-gateROOTFS_DYNLIB=	$(RTLD:%=$(ROOTFS_LIBDIR)/%)
627c478bd9Sstevel@tonic-gateROOTFS_DYNLIB64=	$(RTLD:%=$(ROOTFS_LIBDIR64)/%)
637c478bd9Sstevel@tonic-gate
647c478bd9Sstevel@tonic-gate# For the libc/libthread separated world:
657c478bd9Sstevel@tonic-gate# A version of this library needs to be placed in /etc/lib to allow
667c478bd9Sstevel@tonic-gate# dlopen() functionality while in single-user mode.
677c478bd9Sstevel@tonic-gateETCLIBDIR=	$(ROOT)/etc/lib
687c478bd9Sstevel@tonic-gateETCDYNLIB=	$(RTLD:%=$(ETCLIBDIR)/%)
697c478bd9Sstevel@tonic-gate
707c478bd9Sstevel@tonic-gateROOTDYNLIB=	$(RTLD:%=$(ROOTFS_LIBDIR)/%)
717c478bd9Sstevel@tonic-gateROOTDYNLIB64=	$(RTLD:%=$(ROOTFS_LIBDIR64)/%)
727c478bd9Sstevel@tonic-gate
737c478bd9Sstevel@tonic-gate
747c478bd9Sstevel@tonic-gateFILEMODE =	755
757c478bd9Sstevel@tonic-gate
76c13de8f6Sab196087CPPFLAGS +=	-I$(SRCBASE)/lib/libc/inc \
77c13de8f6Sab196087		-I$(SRCBASE)/uts/common/krtld \
78986fd29aSsetje		-I$(SRCBASE)/uts/$(PLAT) \
79c13de8f6Sab196087		-I$(SRCBASE)/uts/$(PLAT)/krtld \
80c13de8f6Sab196087		-I$(SRC)/common/sgsrtcid \
8108278a5eSRod Evans		-I$(ELFCAP) \
82c13de8f6Sab196087		 $(CPPFEATUREMACROS)
83c13de8f6Sab196087
847c478bd9Sstevel@tonic-gateASFLAGS=	-P -D_ASM $(CPPFLAGS)
857c478bd9Sstevel@tonic-gateLDLIB =		-L ../../libld/$(MACH)
867c478bd9Sstevel@tonic-gateRTLDLIB =	-L ../../librtld/$(MACH)
877c478bd9Sstevel@tonic-gate
88*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-uninitialized
89*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-unused-variable
90*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-switch
91*7014882cSRichard Lowe
927c478bd9Sstevel@tonic-gate# These definitions require that libc be built in the same workspace
937c478bd9Sstevel@tonic-gate# as the run-time linker and before the run-time linker is built.
947c478bd9Sstevel@tonic-gate# This is required for the system's self-consistency in any case.
957c478bd9Sstevel@tonic-gateCPICLIB =	$(VAR_RTLD_CPICLIB)
967c478bd9Sstevel@tonic-gateCPICLIB64 =	$(VAR_RTLD_CPICLIB64)
977c478bd9Sstevel@tonic-gateCLIB =		-lc_pic
987c478bd9Sstevel@tonic-gate
995aefb655SrieLDLIBS +=	$(CONVLIBDIR) $(CONV_LIB) \
1007c478bd9Sstevel@tonic-gate		$(CPICLIB) $(CLIB) \
1017c478bd9Sstevel@tonic-gate		$(LDDBGLIBDIR) $(LDDBG_LIB) \
1025aefb655Srie		$(RTLDLIB) -lrtld \
1035aefb655Srie		$(LDLIB) $(LD_LIB)
1047c478bd9Sstevel@tonic-gate
10567e3a03eSrieDYNFLAGS +=	-i -e _rt_boot $(VERSREF) $(ZNODLOPEN) \
1069a411307Srie		$(ZINTERPOSE) -zdtrace=dtrace_data '-R$$ORIGIN'
1077c478bd9Sstevel@tonic-gate
1087c478bd9Sstevel@tonic-gateBUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1097c478bd9Sstevel@tonic-gate
1107c478bd9Sstevel@tonic-gateBLTDEFS=	msg.h
1117c478bd9Sstevel@tonic-gateBLTDATA=	msg.c
1127c478bd9Sstevel@tonic-gateBLTMESG=	$(SGSMSGDIR)/rtld
1137c478bd9Sstevel@tonic-gate
1147c478bd9Sstevel@tonic-gateBLTFILES=	$(BLTDEFS) $(BLTDATA) $(BLTMESG)
1157c478bd9Sstevel@tonic-gate
1167c478bd9Sstevel@tonic-gateSGSMSGCOM=	../common/rtld.msg
1177c478bd9Sstevel@tonic-gateSGSMSG32=	../common/rtld.32.msg
1187c478bd9Sstevel@tonic-gateSGSMSG64=	../common/rtld.64.msg
1197c478bd9Sstevel@tonic-gateSGSMSGSPARC=	../common/rtld.sparc.msg
1207c478bd9Sstevel@tonic-gateSGSMSGSPARC32=	../common/rtld.sparc32.msg
1217c478bd9Sstevel@tonic-gateSGSMSGSPARC64=	../common/rtld.sparc64.msg
1227c478bd9Sstevel@tonic-gateSGSMSGINTEL=	../common/rtld.intel.msg
1237c478bd9Sstevel@tonic-gateSGSMSGINTEL32=	../common/rtld.intel32.msg
1247c478bd9Sstevel@tonic-gateSGSMSGINTEL64=	../common/rtld.intel64.msg
1257c478bd9Sstevel@tonic-gateSGSMSGCHK=	../common/rtld.chk.msg
1267c478bd9Sstevel@tonic-gateSGSMSGTARG=	$(SGSMSGCOM)
1277c478bd9Sstevel@tonic-gateSGSMSGALL=	$(SGSMSGCOM) $(SGSMSG32) $(SGSMSG64) \
1287c478bd9Sstevel@tonic-gate		$(SGSMSGSPARC) $(SGSMSGSPARC32) $(SGSMSGSPARC64) \
1297c478bd9Sstevel@tonic-gate		$(SGSMSGINTEL) $(SGSMSGINTEL32) $(SGSMSGINTEL64)
1307c478bd9Sstevel@tonic-gate
1317c478bd9Sstevel@tonic-gateSGSMSGFLAGS1=	$(SGSMSGFLAGS) -m $(BLTMESG)
1327c478bd9Sstevel@tonic-gateSGSMSGFLAGS2=	$(SGSMSGFLAGS) -h $(BLTDEFS) -d $(BLTDATA) -n rtld_msg
1337c478bd9Sstevel@tonic-gate
1347c478bd9Sstevel@tonic-gateSRCS=		$(AVLOBJ:%.o=$(VAR_AVLDIR)/%.c) \
135e127a3e7Sraf		$(DTROBJ:%.o=$(VAR_DTRDIR)/%.c) \
1367c478bd9Sstevel@tonic-gate		$(TOOLOBJS:%.o=$(SGSTOOLS)/common/%.c) \
1377c478bd9Sstevel@tonic-gate		$(COMOBJS:%.o=../common/%.c)  $(MACHOBJS:%.o=%.c) $(BLTDATA) \
1387c478bd9Sstevel@tonic-gate		$(G_MACHOBJS:%.o=$(SRCBASE)/uts/$(PLAT)/krtld/%.c) \
1397c478bd9Sstevel@tonic-gate		$(CP_MACHOBJS:%.o=../$(MACH)/%.c) \
1407c478bd9Sstevel@tonic-gate		$(ASOBJS:%.o=%.s)
1417c478bd9Sstevel@tonic-gateLINTSRCS=	$(SRCS) ../common/lintsup.c
1427c478bd9Sstevel@tonic-gate
1437c478bd9Sstevel@tonic-gateLINTFLAGS +=	-u -Dsun -D_REENTRANT -erroff=E_EMPTY_TRANSLATION_UNIT \
1447c478bd9Sstevel@tonic-gate		-erroff=E_NAME_DECL_NOT_USED_DEF2
1457c478bd9Sstevel@tonic-gateLINTFLAGS64 +=	-u -D_REENTRANT -erroff=E_CAST_INT_TO_SMALL_INT \
1467c478bd9Sstevel@tonic-gate		-erroff=E_NAME_DECL_NOT_USED_DEF2
1477c478bd9Sstevel@tonic-gate
1487c478bd9Sstevel@tonic-gateCLEANFILES +=	$(LINTOUTS)  $(CRTS)  $(BLTFILES)
1497c478bd9Sstevel@tonic-gateCLOBBERFILES +=	$(RTLD)
150