xref: /titanic_53/usr/src/cmd/sgs/libld/Makefile.com (revision 7e16fca05dfbcfd32c2ebc9e4d1abdac1cd8657c)
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#
217c478bd9Sstevel@tonic-gate#
2256deab07SRod Evans# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
257c478bd9Sstevel@tonic-gate
267c478bd9Sstevel@tonic-gateLIBRARY =	libld.a
275aefb655SrieVERS =		.4
287c478bd9Sstevel@tonic-gate
295aefb655SrieCOMOBJS =	debug.o		globals.o	util.o
305aefb655Srie
315aefb655SrieCOMOBJS32 =	args32.o	entry32.o	exit32.o	groups32.o \
32ba2be530Sab196087		ldentry32.o	ldlibs32.o	ldmachdep32.o	ldmain32.o \
33ba2be530Sab196087		libs32.o	files32.o	map32.o		order32.o \
34ba2be530Sab196087		outfile32.o	place32.o	relocate32.o	resolve32.o \
35ba2be530Sab196087		sections32.o	sunwmove32.o	support32.o	syms32.o \
36*7e16fca0SAli Bahrami		update32.o	unwind32.o	version32.o
375aefb655Srie
385aefb655SrieCOMOBJS64 =	args64.o	entry64.o	exit64.o	groups64.o \
39ba2be530Sab196087		ldentry64.o	ldlibs64.o	ldmachdep64.o	ldmain64.o \
40ba2be530Sab196087		libs64.o	files64.o	map64.o		order64.o \
41ba2be530Sab196087		outfile64.o 	place64.o	relocate64.o	resolve64.o \
42ba2be530Sab196087		sections64.o	sunwmove64.o	support64.o	syms64.o \
43*7e16fca0SAli Bahrami		update64.o	unwind64.o	version64.o
447c478bd9Sstevel@tonic-gate
457c478bd9Sstevel@tonic-gateTOOLOBJS =	alist.o		assfail.o	findprime.o	string_table.o \
467c478bd9Sstevel@tonic-gate		strhash.o
477c478bd9Sstevel@tonic-gateAVLOBJ =	avl.o
485aefb655Srie
49ba2be530Sab196087# Relocation engine objects. These are kept separate from the L_XXX_MACHOBJS
50ba2be530Sab196087# lists below in order to facilitate linting them.
51ba2be530Sab196087G_MACHOBJS32 =	doreloc_sparc_32.o doreloc_x86_32.o
52ba2be530Sab196087G_MACHOBJS64 =	doreloc_sparc_64.o doreloc_x86_64.o
53ba2be530Sab196087
54ba2be530Sab196087# Target specific objects (sparc/sparcv9)
55ba2be530Sab196087L_SPARC_MACHOBJS32 =	machrel.sparc32.o	machsym.sparc32.o
56ba2be530Sab196087L_SPARC_MACHOBJS64 =	machrel.sparc64.o	machsym.sparc64.o
57ba2be530Sab196087
58ba2be530Sab196087# Target specific objects (i386/amd64)
59ba2be530Sab196087E_X86_TOOLOBJS =	leb128.o
60ba2be530Sab196087L_X86_MACHOBJS32 =	machrel.intel32.o
61*7e16fca0SAli BahramiL_X86_MACHOBJS64 =	machrel.amd64.o
62ba2be530Sab196087
63ba2be530Sab196087
64ba2be530Sab196087# All target specific objects rolled together
65ba2be530Sab196087E_TOOLOBJS =	$(E_SPARC_TOOLOBJS) \
66ba2be530Sab196087	$(E_X86_TOOLOBJS)
67ba2be530Sab196087L_MACHOBJS32 =	$(L_SPARC_MACHOBJS32) \
68ba2be530Sab196087	$(L_X86_MACHOBJS32)
69ba2be530Sab196087L_MACHOBJS64 =	$(L_SPARC_MACHOBJS64) \
70ba2be530Sab196087	$(L_X86_MACHOBJS64)
71ba2be530Sab196087
72ba2be530Sab196087
735aefb655Srie
747c478bd9Sstevel@tonic-gateBLTOBJ =	msg.o
757c478bd9Sstevel@tonic-gateELFCAPOBJ =	elfcap.o
767c478bd9Sstevel@tonic-gate
775aefb655SrieOBJECTS =	$(BLTOBJ) $(G_MACHOBJS32) $(G_MACHOBJS64) \
785aefb655Srie		$(L_MACHOBJS32) $(L_MACHOBJS64) \
795aefb655Srie		$(COMOBJS) $(COMOBJS32) $(COMOBJS64) \
805aefb655Srie		$(TOOLOBJS) $(E_TOOLOBJS) $(AVLOBJ) $(ELFCAPOBJ)
817c478bd9Sstevel@tonic-gate
827c478bd9Sstevel@tonic-gateinclude 	$(SRC)/lib/Makefile.lib
837c478bd9Sstevel@tonic-gateinclude 	$(SRC)/cmd/sgs/Makefile.com
847c478bd9Sstevel@tonic-gate
85f808c858SrafSRCDIR =	../common
867c478bd9Sstevel@tonic-gateELFCAP=		$(SRC)/common/elfcap
877c478bd9Sstevel@tonic-gate
88ba2be530Sab196087
89ba2be530Sab196087# Location of the shared relocation engines maintained under usr/src/uts.
90ba2be530Sab196087#
91ba2be530Sab196087KRTLD_I386 = $(SRCBASE)/uts/$(VAR_PLAT_i386)/krtld
92ba2be530Sab196087KRTLD_AMD64 = $(SRCBASE)/uts/$(VAR_PLAT_amd64)/krtld
93ba2be530Sab196087KRTLD_SPARC = $(SRCBASE)/uts/$(VAR_PLAT_sparc)/krtld
94ba2be530Sab196087
95ba2be530Sab196087
9610a4fa49SrieCPPFLAGS +=	-DUSE_LIBLD_MALLOC -I$(SRCBASE)/lib/libc/inc \
9710a4fa49Srie		    -I$(SRCBASE)/uts/common/krtld -I$(ELFCAP) \
98986fd29aSsetje		    -I$(SRCBASE)/uts/sparc \
99ba2be530Sab196087		    $(VAR_LIBLD_CPPFLAGS)
1005aefb655SrieLDLIBS +=	$(CONVLIBDIR) $(CONV_LIB) $(LDDBGLIBDIR) $(LDDBG_LIB) \
1015aefb655Srie		    $(ELFLIBDIR) -lelf $(DLLIB) -lc
1025aefb655Srie
1035aefb655SrieLINTFLAGS +=	-u -D_REENTRANT
1045aefb655SrieLINTFLAGS64 +=	-u -D_REENTRANT
1055aefb655Srie
10667e3a03eSrieDYNFLAGS +=	$(VERSREF) $(USE_PROTO) '-R$$ORIGIN'
1077c478bd9Sstevel@tonic-gate
1087c478bd9Sstevel@tonic-gatenative:=	DYNFLAGS	+= $(CONVLIBDIR)
1097c478bd9Sstevel@tonic-gate
1107c478bd9Sstevel@tonic-gateBLTDEFS =	msg.h
1117c478bd9Sstevel@tonic-gateBLTDATA =	msg.c
1127c478bd9Sstevel@tonic-gateBLTMESG =	$(SGSMSGDIR)/libld
1137c478bd9Sstevel@tonic-gate
1147c478bd9Sstevel@tonic-gateBLTFILES =	$(BLTDEFS) $(BLTDATA) $(BLTMESG)
1157c478bd9Sstevel@tonic-gate
116ba2be530Sab196087# Due to cross linking support, every copy of libld contains every message.
117ba2be530Sab196087# However, we keep target specific messages in their own separate files for
118ba2be530Sab196087# organizational reasons.
119ba2be530Sab196087#
1207c478bd9Sstevel@tonic-gateSGSMSGCOM =	../common/libld.msg
1217c478bd9Sstevel@tonic-gateSGSMSGSPARC =	../common/libld.sparc.msg
1227c478bd9Sstevel@tonic-gateSGSMSGINTEL =	../common/libld.intel.msg
123ba2be530Sab196087SGSMSGTARG =	$(SGSMSGCOM) $(SGSMSGSPARC) $(SGSMSGINTEL)
1247c478bd9Sstevel@tonic-gateSGSMSGALL =	$(SGSMSGCOM) $(SGSMSGSPARC) $(SGSMSGINTEL)
1257c478bd9Sstevel@tonic-gate
1267c478bd9Sstevel@tonic-gateSGSMSGFLAGS1 =	$(SGSMSGFLAGS) -m $(BLTMESG)
1277c478bd9Sstevel@tonic-gateSGSMSGFLAGS2 =	$(SGSMSGFLAGS) -h $(BLTDEFS) -d $(BLTDATA) -n libld_msg
1287c478bd9Sstevel@tonic-gate
1295aefb655SrieCHKSRCS =	$(SRCBASE)/uts/common/krtld/reloc.h \
1305aefb655Srie		$(COMOBJS32:%32.o=../common/%.c) \
1315aefb655Srie		$(L_MACHOBJS32:%32.o=../common/%.c) \
132ba2be530Sab196087		$(L_MACHOBJS64:%64.o=../common/%.c) \
133ba2be530Sab196087		$(KRTLD_I386)/doreloc.c \
134ba2be530Sab196087		$(KRTLD_AMD64)/doreloc.c \
135ba2be530Sab196087		$(KRTLD_SPARC)/doreloc.c
1365aefb655Srie
1377c478bd9Sstevel@tonic-gateSRCS =		../common/llib-lld
1387c478bd9Sstevel@tonic-gateLIBSRCS =	$(TOOLOBJS:%.o=$(SGSTOOLS)/common/%.c) \
1395aefb655Srie		$(E_TOOLOBJS:%.o=$(SGSTOOLS)/common/%.c) \
1405aefb655Srie		$(COMOBJS:%.o=../common/%.c) \
1417c478bd9Sstevel@tonic-gate		$(AVLOBJS:%.o=$(VAR_AVLDIR)/%.c) \
1425aefb655Srie		$(BLTDATA)
1437c478bd9Sstevel@tonic-gate
1445aefb655SrieLINTSRCS =	$(LIBSRCS) ../common/lintsup.c
1455aefb655SrieLINTSRCS32 =	$(COMOBJS32:%32.o=../common/%.c) \
1465aefb655Srie		$(L_MACHOBJS32:%32.o=../common/%.c)
1475aefb655SrieLINTSRCS64 =	$(COMOBJS64:%64.o=../common/%.c) \
1485aefb655Srie		$(L_MACHOBJS64:%64.o=../common/%.c)
1497c478bd9Sstevel@tonic-gate
150ba2be530Sab196087# Add the shared relocation engine source files to the lint
151ba2be530Sab196087# sources and add the necessary command line options to lint them
152ba2be530Sab196087# correctly. Make can't derive the files since the source and object
153ba2be530Sab196087# names are not directly related
154ba2be530Sab196087$(LINTOUT32) :=	CPPFLAGS += -DDO_RELOC_LIBLD
155ba2be530Sab196087$(LINTOUT64) :=	CPPFLAGS += -DDO_RELOC_LIBLD -D_ELF64
156ba2be530Sab196087$(LINTLIB32) :=	CPPFLAGS += -DDO_RELOC_LIBLD
157ba2be530Sab196087$(LINTLIB64) :=	CPPFLAGS += -DDO_RELOC_LIBLD -D_ELF64
158ba2be530Sab196087LINTSRCS32 +=	$(KRTLD_I386)/doreloc.c	\
159ba2be530Sab196087		$(KRTLD_SPARC)/doreloc.c
160ba2be530Sab196087LINTSRCS64 +=	$(KRTLD_AMD64)/doreloc.c \
161ba2be530Sab196087		$(KRTLD_SPARC)/doreloc.c
162ba2be530Sab196087
1637c478bd9Sstevel@tonic-gateCLEANFILES +=	$(LINTOUTS) $(BLTFILES)
1647c478bd9Sstevel@tonic-gateCLOBBERFILES +=	$(DYNLIB) $(LINTLIBS) $(LIBLINKS)
1657c478bd9Sstevel@tonic-gate
1667c478bd9Sstevel@tonic-gateROOTFS_DYNLIB =	$(DYNLIB:%=$(ROOTFS_LIBDIR)/%)
167