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.
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.
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]
23 # Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
30 TOOLOBJS= alist.o strhash.o
38 $(P_ASOBJS) $(P_COMOBJS) $(P_MACHOBJS) $(G_MACHOBJS) \
39 $(S_ASOBJS) $(S_COMOBJS) $(S_MACHOBJS) $(CP_MACHOBJS)
41 COMOBJS= $(P_COMOBJS) $(S_COMOBJS)
42 ASOBJS= $(P_ASOBJS) $(S_ASOBJS)
43 MACHOBJS= $(P_MACHOBJS) $(S_MACHOBJS)
46 include $(SRC)/lib/Makefile.lib
47 include $(SRC)/cmd/sgs/Makefile.com
50 ELFCAP = $(SRC)/common/elfcap
51 PLAT = $(VAR_PLAT_$(BASEPLAT))
53 # DTrace needs an executable data segment.
56 MAPFILES += $(MAPFILE-ORDER)
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.
61 ROOTFS_DYNLIB= $(RTLD:%=$(ROOTFS_LIBDIR)/%)
62 ROOTFS_DYNLIB64= $(RTLD:%=$(ROOTFS_LIBDIR64)/%)
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.
67 ETCLIBDIR= $(ROOT)/etc/lib
68 ETCDYNLIB= $(RTLD:%=$(ETCLIBDIR)/%)
70 ROOTDYNLIB= $(RTLD:%=$(ROOTFS_LIBDIR)/%)
71 ROOTDYNLIB64= $(RTLD:%=$(ROOTFS_LIBDIR64)/%)
76 CPPFLAGS += -I$(SRCBASE)/lib/libc/inc \
77 -I$(SRCBASE)/uts/common/krtld \
78 -I$(SRCBASE)/uts/$(PLAT) \
79 -I$(SRCBASE)/uts/$(PLAT)/krtld \
80 -I$(SRC)/common/sgsrtcid \
84 ASFLAGS= -P -D_ASM $(CPPFLAGS)
85 LDLIB = -L ../../libld/$(MACH)
86 RTLDLIB = -L ../../librtld/$(MACH)
88 CERRWARN += -_gcc=-Wno-uninitialized
89 CERRWARN += -_gcc=-Wno-unused-variable
90 CERRWARN += -_gcc=-Wno-switch
92 # These definitions require that libc be built in the same workspace
93 # as the run-time linker and before the run-time linker is built.
94 # This is required for the system's self-consistency in any case.
95 CPICLIB = $(VAR_RTLD_CPICLIB)
96 CPICLIB64 = $(VAR_RTLD_CPICLIB64)
99 LDLIBS += $(CONVLIBDIR) $(CONV_LIB) \
101 $(LDDBGLIBDIR) $(LDDBG_LIB) \
105 DYNFLAGS += -i -e _rt_boot $(VERSREF) $(ZNODLOPEN) \
106 $(ZINTERPOSE) -zdtrace=dtrace_data '-R$$ORIGIN'
108 BUILD.s= $(AS) $(ASFLAGS) $< -o $@
112 BLTMESG= $(SGSMSGDIR)/rtld
114 BLTFILES= $(BLTDEFS) $(BLTDATA) $(BLTMESG)
116 SGSMSGCOM= ../common/rtld.msg
117 SGSMSG32= ../common/rtld.32.msg
118 SGSMSG64= ../common/rtld.64.msg
119 SGSMSGSPARC= ../common/rtld.sparc.msg
120 SGSMSGSPARC32= ../common/rtld.sparc32.msg
121 SGSMSGSPARC64= ../common/rtld.sparc64.msg
122 SGSMSGINTEL= ../common/rtld.intel.msg
123 SGSMSGINTEL32= ../common/rtld.intel32.msg
124 SGSMSGINTEL64= ../common/rtld.intel64.msg
125 SGSMSGCHK= ../common/rtld.chk.msg
126 SGSMSGTARG= $(SGSMSGCOM)
127 SGSMSGALL= $(SGSMSGCOM) $(SGSMSG32) $(SGSMSG64) \
128 $(SGSMSGSPARC) $(SGSMSGSPARC32) $(SGSMSGSPARC64) \
129 $(SGSMSGINTEL) $(SGSMSGINTEL32) $(SGSMSGINTEL64)
131 SGSMSGFLAGS1= $(SGSMSGFLAGS) -m $(BLTMESG)
132 SGSMSGFLAGS2= $(SGSMSGFLAGS) -h $(BLTDEFS) -d $(BLTDATA) -n rtld_msg
134 SRCS= $(AVLOBJ:%.o=$(VAR_AVLDIR)/%.c) \
135 $(DTROBJ:%.o=$(VAR_DTRDIR)/%.c) \
136 $(TOOLOBJS:%.o=$(SGSTOOLS)/common/%.c) \
137 $(COMOBJS:%.o=../common/%.c) $(MACHOBJS:%.o=%.c) $(BLTDATA) \
138 $(G_MACHOBJS:%.o=$(SRCBASE)/uts/$(PLAT)/krtld/%.c) \
139 $(CP_MACHOBJS:%.o=../$(MACH)/%.c) \
141 LINTSRCS= $(SRCS) ../common/lintsup.c
143 LINTFLAGS += -u -Dsun -D_REENTRANT -erroff=E_EMPTY_TRANSLATION_UNIT \
144 -erroff=E_NAME_DECL_NOT_USED_DEF2
145 LINTFLAGS64 += -u -D_REENTRANT -erroff=E_CAST_INT_TO_SMALL_INT \
146 -erroff=E_NAME_DECL_NOT_USED_DEF2
148 CLEANFILES += $(LINTOUTS) $(CRTS) $(BLTFILES)
149 CLOBBERFILES += $(RTLD)