Print this page
1235 Use symbol capabilities to eliminate libc_hwcap*
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libc/Makefile
+++ new/usr/src/lib/libc/Makefile
1 1 #
2 2 # CDDL HEADER START
3 3 #
4 4 # The contents of this file are subject to the terms of the
5 5 # Common Development and Distribution License (the "License").
6 6 # You may not use this file except in compliance with the License.
7 7 #
8 8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 # or http://www.opensolaris.org/os/licensing.
10 10 # See the License for the specific language governing permissions
↓ open down ↓ |
10 lines elided |
↑ open up ↑ |
11 11 # and limitations under the License.
12 12 #
13 13 # When distributing Covered Code, include this CDDL HEADER in each
14 14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 # If applicable, add the following below this CDDL HEADER, with the
16 16 # fields enclosed by brackets "[]" replaced with your own identifying
17 17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 18 #
19 19 # CDDL HEADER END
20 20 #
21 +
21 22 #
22 23 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
24 +# Copyright 2017 Nexenta Systems, Inc.
23 25 #
24 -# Copyright 2010 Nexenta Systems, Inc. All rights reserved.
25 -# Use is subject to license terms.
26 -#
27 26
28 27 LIBBASENAME= libc
29 28 LIBRARY= $(LIBBASENAME:%=%.a)
30 29 VERS= .1
31 30
32 31 # Note that we build libc_pic.a for the benefit of building
33 32 # ld.so.1, but we do not install it. Only ld.so.1 needs it
34 33 # and it must be built in the same workspace as libc.
35 34 LIB_PIC= libc_pic.a
36 35
37 36 ROOTLIB= $(ROOT)/usr/lib
38 37 ROOTFS_LIB= $(ROOT)/lib
39 38 ROOTLIB64= $(ROOTLIB)/$(MACH64)
40 39 ROOTFS_LIB64= $(ROOTFS_LIB)/$(MACH64)
41 40
42 -ROOTVARIANTDIR= $(ROOTLIB)/libc
43 -ROOTVARIANTDIR64= $(ROOTLIB64)/libc
44 -
45 41 ROOTFS_LINTDIR= $(ROOTFS_LIB)
46 42 ROOTFS_LINTDIR64= $(ROOTFS_LIB64)
47 43 ROOTFS_LINTLIB= $(ROOTFS_LINTDIR)/$(LINTLIB)
48 44 ROOTFS_LINTLIB64= $(ROOTFS_LINTDIR64)/$(LINTLIB)
49 45
50 46 # include common library definitions
51 47 include ../Makefile.lib
52 48
53 -#
54 -# on some architectures, we build multiple libc variants
55 -#
56 -VAR1 = hwcap1
57 -VAR2 = hwcap2
58 -VAR3 = hwcap3
59 -
60 -VARBLD_1= $(MACH:sparc=sparc)
61 -VARBLD= $(VARBLD_1:i386=)
62 -
63 -VARBLD64_1= $(MACH:sparc=sparcv9)
64 -VARBLD64= $(VARBLD64_1:i386=)
65 -
66 -VAR1_DYNLIB = $(LIBRARY:%.a=%_$(VAR1).so$(VERS))
67 -VAR1_BLDDIR = $(MACH)_$(VAR1)/$(VARBLD)
68 -VAR2_DYNLIB = $(LIBRARY:%.a=%_$(VAR2).so$(VERS))
69 -VAR2_BLDDIR = $(MACH)_$(VAR2)/$(VARBLD)
70 -VAR3_DYNLIB = $(LIBRARY:%.a=%_$(VAR3).so$(VERS))
71 -VAR3_BLDDIR = $(MACH)_$(VAR3)/$(VARBLD)
72 -
73 -VAR1_DYNLIB64 = $(LIBRARY:%.a=%_$(VAR1).so$(VERS))
74 -VAR1_BLDDIR64 = $(MACH)_$(VAR1)/$(VARBLD64)
75 -
76 -i386_VARIANTS= $(VAR1) $(VAR2) $(VAR3)
77 -sparc_VARIANTS=
78 -sparcv9_VARIANTS=
79 -
80 -i386_COMP=
49 +i386_COMP= capabilities
81 50 sparc_COMP= capabilities
82 51
83 52 MACH_COMP= $($(MACH)_COMP)
84 53
85 54 i386_ETC= $(MACH)/etc
86 55 sparc_ETC=
87 56
88 -VARIANTS= $($(MACH)_VARIANTS)
89 -VARIANT_SUBDIRS = $(VARIANTS:%=$(MACH)_%/$(VARBLD))
57 +SUBDIRS= $(MACH_CAP) $(MACH) $(MACH_ETC) $(BUILD64) $(MACH64)
90 58
91 -VARIANTS64= $($(MACH64)_VARIANTS)
92 -VARIANT_SUBDIRS64 = $(VARIANTS64:%=$(MACH)_%/$(VARBLD64))
93 -
94 -SUBDIRS= $(MACH_CAP) $(MACH) $(MACH_ETC) $(VARIANT_SUBDIRS)
95 -$(BUILD64)SUBDIRS += $(MACH64) $(VARIANT_SUBDIRS64)
96 -
97 59 LIBS = $(DYNLIB) $(LINTLIB)
98 60
99 61 ROOTLIBS64= $(ROOTLIBDIR64)/$(DYNLIB) $(ROOTLIBDIR64)/$(LINTLIB)
100 62 MACHLIBS64= $(MACH64)/$(DYNLIB) $(MACH64)/$(LINTLIB)
101 -VARIANTLIBS= $(VARIANTS:%=$(MACH)_%/$(VARBLD)/$(LIBBASENAME)_%.so.1)
102 -VARIANTLIBS64= $(VARIANTS64:%=$(MACH)_%/$(VARBLD64)/$(LIBBASENAME)_%.so.1)
103 -ROOTVARIANTLIBS= $(VARIANTS:%=$(ROOTVARIANTDIR)/$(LIBBASENAME)_%.so.1)
104 -ROOTVARIANTLIBS64= $(VARIANTS64:%=$(ROOTVARIANTDIR64)/$(LIBBASENAME)_%.so.1)
105 63
106 64 # definitions for install_h target
107 -BASEHDRS= getxby_door.h
65 +BASEHDRS= getxby_door.h
108 66 CHECKHDRS= $(BASEHDRS:%.h=port/gen/%.check)
109 67 HDRS= $(BASEHDRS)
110 68
111 69 CLOBBERFILES += THIRDPARTYLICENSE extract-copyright
112 70
113 71 # install rules for install_h target
114 72 $(ROOTHDRDIR)/%: port/gen/%
115 73 $(INS.file)
116 74
117 75 $(ROOTLIBDIR)/$(DYNLIB) := FILEMODE = 755
118 76 $(ROOTLIBDIR64)/$(DYNLIB) := FILEMODE = 755
119 -$(ROOTFS_LIBDIR)/$(DYNLIB) := FILEMODE = 755
120 -$(ROOTFS_LIBDIR64)/$(DYNLIB) := FILEMODE = 755
77 +$(ROOTFS_LIBDIR)/$(DYNLIB) := FILEMODE = 755
78 +$(ROOTFS_LIBDIR64)/$(DYNLIB) := FILEMODE = 755
121 79
122 -$(ROOTVARIANTDIR) := FILEMODE= 755
123 -$(ROOTVARIANTDIR)/$(VAR1_DYNLIB) := FILEMODE= 755
124 -$(ROOTVARIANTDIR)/$(VAR2_DYNLIB) := FILEMODE= 755
125 -$(ROOTVARIANTDIR)/$(VAR3_DYNLIB) := FILEMODE= 755
126 -
127 -$(ROOTVARIANTDIR64) := FILEMODE= 755
128 -$(ROOTVARIANTDIR64)/$(VAR1_DYNLIB64) := FILEMODE= 755
129 -
130 80 .KEEP_STATE:
131 81
132 82 all: all_h lib32 $(BUILD64) .WAIT lib64 .WAIT etc THIRDPARTYLICENSE
133 83
134 84 THIRDPARTYLICENSE: extract-copyright
135 85 $(RM) $@
136 86 ./extract-copyright . > $@
137 87
138 88 etc: $($(MACH)_ETC)
139 89
140 -lib32: $(MACH_COMP) $(MACHLIBS) $(MACH)/$(LIB_PIC) $(VARIANTLIBS)
90 +lib32: $(MACH_COMP) $(MACHLIBS) $(MACH)/$(LIB_PIC)
141 91 @if $(ELFDUMP) -r $(MACH)/$(DYNLIB) | $(GREP) -w environ ; then \
142 92 $(ECHO) "Error: Invalid reference to environ" ; \
143 93 $(ECHO) "Error: See comments in port/gen/env_data.c" ; \
144 94 exit 1; \
145 95 fi
146 96
147 -lib64: $(MACH_COMP) $(MACHLIBS64) $(MACH64)/$(LIB_PIC) $(VARIANTLIBS64)
97 +lib64: $(MACH_COMP) $(MACHLIBS64) $(MACH64)/$(LIB_PIC)
148 98 @if $(ELFDUMP) -r $(MACH64)/$(DYNLIB) | $(GREP) -w environ ; then \
149 99 $(ECHO) "Error: Invalid reference to environ" ; \
150 100 $(ECHO) "Error: See comments in port/gen/env_data.c" ; \
151 101 exit 1; \
152 102 fi
153 103
154 104 $(MACH)/assym.h $(MACH64)/assym.h:
155 105 @cd $(@D); $(MAKE) assym.h
156 106
157 -$(VARIANTLIBS): FRC
158 - @cd $(@D); pwd; VERSION='$(VERSION)' $(MAKE) $(@F)
159 -
160 -$(VARIANTLIBS64): FRC
161 - @cd $(@D); pwd; VERSION='$(VERSION)' $(MAKE) $(@F)
162 -
163 107 $($(MACH)_ETC): FRC
164 108 @cd $(@); pwd; $(MAKE) $(TARGET)
165 109
166 110 $($(MACH)_COMP): FRC
167 111 @cd $(@); pwd; $(MAKE) $(TARGET)
168 112
169 113 install: all \
170 114 etc \
171 115 inslib32 \
172 116 $(BUILD64) inslib64
173 117
174 -inslib32: $(ROOTFS_LIBS) $(ROOTFS_LINKS) $(ROOTFS_LINT) \
175 - $(ROOTFS_LINTLIB) \
176 - $(ROOTVARIANTLIBS)
118 +inslib32: $(ROOTFS_LIBS) $(ROOTFS_LINKS) $(ROOTFS_LINT) $(ROOTFS_LINTLIB)
177 119
178 -inslib64: $(ROOTFS_LIBS64) $(ROOTFS_LINKS64) \
179 - $(ROOTFS_LINTLIB64) \
180 - $(ROOTVARIANTLIBS64)
120 +inslib64: $(ROOTFS_LIBS64) $(ROOTFS_LINKS64) $(ROOTFS_LINTLIB64)
181 121
182 122 install_h: all_h $(ROOTHDRS)
183 123
184 124 all_h: $(MACH)/assym.h $(MACH64)/assym.h
185 125
186 126 check: $(CHECKHDRS)
187 127
188 128 $(ROOTFS_LIB)/%: $(MACH)/%
189 129 $(INS.file)
190 130 $(ROOTFS_LIBDIR)/$(LIBLINKS): $(ROOTFS_LIBDIR)/$(LIBLINKS)$(VERS)
191 131 $(INS.liblink)
192 132 $(ROOTFS_LIB64)/%: $(MACH64)/%
193 133 $(INS.file)
194 134 $(ROOTFS_LIBDIR64)/$(LIBLINKS): $(ROOTFS_LIBDIR64)/$(LIBLINKS)$(VERS)
195 135 $(INS.liblink)
196 136
197 -$(ROOTVARIANTDIR): $(ROOTLIB)
198 - $(INS.dir)
199 -$(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR1_BLDDIR)/%
200 - $(INS.file)
201 -$(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR2_BLDDIR)/%
202 - $(INS.file)
203 -$(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR3_BLDDIR)/%
204 - $(INS.file)
205 -
206 -$(ROOTVARIANTDIR64): $(ROOTLIB64)
207 - $(INS.dir)
208 -$(ROOTVARIANTDIR64)/%: $(ROOTVARIANTDIR64) $(VAR1_BLDDIR64)/%
209 - $(INS.file)
210 -
211 137 # install rule for lint library target
212 138 $(ROOTFS_LINTDIR)/%: port/%
213 139 $(INS.file)
214 140 $(ROOTFS_LINTDIR64)/%: port/%
215 141 $(INS.file)
216 142 $(ROOTFS_LINTDIR)/%: $(MACH)/%
217 143 $(INS.file)
218 144 $(ROOTFS_LINTDIR64)/%: $(MACH64)/%
219 145 $(INS.file)
220 146
221 147 $(LINTLIB):
222 148 @cd $(MACH); pwd; VERSION='$(VERSION)' $(MAKE) $@
223 149 $(LINTLIB64):
224 150 @cd $(MACH64); pwd; VERSION='$(VERSION)' $(MAKE) $@
225 151
226 152 $(MACH)/$(LIB_PIC): FRC
227 153 @cd $(MACH); pwd; VERSION='$(VERSION)' $(MAKE) $(LIB_PIC)
228 154 $(MACH64)/$(LIB_PIC): FRC
229 155 @cd $(MACH64); pwd; VERSION='$(VERSION)' $(MAKE) $(LIB_PIC)
230 156
231 157 all := TARGET= all
232 158 install := TARGET= install
233 159 clean := TARGET= clean
234 160 clobber := TARGET= clobber
235 161 lint := TARGET= lint
236 162
237 163 .PARALLEL: $(SUBDIRS)
238 164
239 165 $(SUBDIRS): FRC
240 166 @cd $@; pwd; VERSION='$(VERSION)' $(MAKE) $(TARGET)
241 167
242 168 clean: $(SUBDIRS)
243 169 clobber: $(SUBDIRS) etc clobber_local
244 170 clobber_local:
245 171 $(RM) $(CLOBBERFILES)
246 172
247 173 lint: $(SUBDIRS)
248 174
249 175 _msg: $(MSGDOMAIN) catalog
250 176
251 177 catalog:
252 178 sh ./makelibccatalog.sh $(MSGDOMAIN)
253 179
254 180 $(MSGDOMAIN):
255 181 $(INS.dir)
256 182
257 183 cscope.out tags: FRC
258 184 $(XREF) -x $@
259 185
260 186 FRC:
261 187 # include MACH-specific library targets
262 188 include ../Makefile.mach
↓ open down ↓ |
42 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX