Print this page
5465 CFLAGS missing from BUILD.SO in lib/Makefile.lib
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/Makefile.lib
+++ new/usr/src/lib/Makefile.lib
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 +# Copyright 2015 Gary Mills
21 22 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
22 23 #
23 24 #
24 25 # Definitions common to libraries.
25 26 #
26 27 # include global definitions; SRC should be defined in the shell.
27 28 # SRC is needed until RFE 1026993 is implemented.
28 29
29 30 include $(SRC)/Makefile.master
30 31
31 32 LORDER= lorder
32 33 TSORT= tsort
33 34 AWK= awk
34 35
35 36 #
36 37 # By default, we define the source directory for libraries to be
37 38 # one level up from the ISA-specific directory, where the code is
38 39 # actually built. Many libraries define a 'common' directory to
39 40 # contain the source. These libraries must redefine SRCDIR as:
40 41 # SRCDIR = ../common
41 42 # Other variations are possible (../port, ../src, etc).
42 43 #
43 44 SRCDIR = ..
44 45
45 46 #
46 47 # We define MAPFILES here for the benefit of most libraries, those that
47 48 # follow the convention of having source files and other common files
48 49 # in the $(SRCDIR) directory. Libraries that do not follow this
49 50 # convention must define MAPFILES, or MAPFILEDIR for themselves.
50 51 # Libraries that do follow this convention but that need supplemental
51 52 # ISA-specific mapfiles can augment MAPFILES like this:
52 53 # MAPFILES += mapfile-vers
53 54 #
54 55 MAPFILEDIR = $(SRCDIR)
55 56 MAPFILES = $(MAPFILEDIR)/mapfile-vers
56 57
57 58 #
58 59 # If HDRDIR is left unset, then it's possible for the $(ROOTHDRDIR)/%
59 60 # install rule in lib/Makefile.targ to generate false matches if there
60 61 # are any common directory names between / and /usr/include (`xfn' is
61 62 # one common example). To prevent this, we set HDRDIR to a directory
62 63 # name that will almost surely not exist on the build machine.
63 64 #
64 65 HDRDIR= /__nonexistent_directory__
65 66
66 67 #
67 68 # We don't build archive (*.a) libraries by default anymore.
68 69 # If a component of the build needs to build an archive library
69 70 # for its own internal purposes, it can define LIBS for itself
70 71 # after including Makefile.lib, like this:
71 72 # LIBS = $(LIBRARY)
72 73 # or:
73 74 # LIBS = $(LIBRARYCCC)
74 75 # Archive libraries must not be installed in the proto area.
75 76 #
76 77 LIBS=
77 78 MACHLIBS= $(LIBS:%=$(MACH)/%)
78 79 MACHLIBS64= $(LIBS:%=$(MACH64)/%)
79 80 DYNLIB= $(LIBRARY:.a=.so$(VERS))
80 81 DYNLIBPSR= $(LIBRARY:.a=_psr.so$(VERS))
81 82 DYNLIBCCC= $(LIBRARYCCC:.a=.so$(VERS))
82 83 LIBLINKS= $(LIBRARY:.a=.so)
83 84 LIBLINKSCCC= $(LIBRARYCCC:.a=.so)
84 85 LIBNAME= $(LIBRARY:lib%.a=%)
85 86 LIBLINKPATH=
86 87 LIBNULL= null.a
87 88 ROOTHDRDIR= $(ROOT)/usr/include
88 89 ROOTLIBDIR= $(ROOT)/usr/lib
89 90 ROOTLIBDIR64= $(ROOT)/usr/lib/$(MACH64)
90 91 ROOTFS_LIBDIR= $(ROOT)/lib
91 92 ROOTFS_LIBDIR64= $(ROOT)/lib/$(MACH64)
92 93 ROOTLINTDIR= $(ROOTLIBDIR)
93 94 ROOTFS_LINTDIR= $(ROOTFS_LIBDIR)
94 95 ROOTFS_LINTDIR64= $(ROOTFS_LIBDIR64)
95 96 ROOTHDRS= $(HDRS:%=$(ROOTHDRDIR)/%)
96 97 HDRSRCS= $(HDRS:%=$(HDRDIR)/%)
97 98 CHECKHDRS= $(HDRSRCS:%.h=%.check)
98 99 ROOTLIBS= $(LIBS:%=$(ROOTLIBDIR)/%)
99 100 ROOTLIBS64= $(LIBS:%=$(ROOTLIBDIR64)/%)
100 101 ROOTFS_LIBS= $(DYNLIB:%=$(ROOTFS_LIBDIR)/%)
101 102 ROOTFS_LIBS64= $(DYNLIB:%=$(ROOTFS_LIBDIR64)/%)
102 103 ROOTLINKS= $(ROOTLIBDIR)/$(LIBLINKS)
103 104 ROOTLINKS64= $(ROOTLIBDIR64)/$(LIBLINKS)
104 105 ROOTFS_LINKS= $(ROOTFS_LIBDIR)/$(LIBLINKS)
105 106 ROOTFS_LINKS64= $(ROOTFS_LIBDIR64)/$(LIBLINKS)
106 107 ROOTLINKSCCC= $(ROOTLIBDIR)/$(LIBLINKSCCC)
107 108 ROOTLINKSCCC64= $(ROOTLIBDIR64)/$(LIBLINKSCCC)
108 109 ROOTFS_LINKSCCC= $(ROOTFS_LIBDIR)/$(LIBLINKSCCC)
109 110 ROOTFS_LINKSCCC64= $(ROOTFS_LIBDIR64)/$(LIBLINKSCCC)
110 111 ROOTLINT= $(LINTSRC:%=$(ROOTLINTDIR)/%)
111 112 ROOTFS_LINT= $(LINTSRC:%=$(ROOTFS_LINTDIR)/%)
112 113 ROOTFS_LINT64= $(LINTSRC:%=$(ROOTFS_LINTDIR64)/%)
113 114 ROOTMAN3= $(ROOT)/usr/share/man/man3
114 115 ROOTMAN3FILES= $(MAN3FILES:%=$(ROOTMAN3)/%)
115 116 $(ROOTMAN3FILES) := FILEMODE= 444
116 117
117 118 # Demo rules
118 119 DEMOFILES=
119 120 DEMOFILESRCDIR= common
120 121 ROOTDEMODIRBASE= __nonexistent_directory__
121 122 ROOTDEMODIRS=
122 123 ROOTDEMOFILES= $(DEMOFILES:%=$(ROOTDEMODIRBASE)/%)
123 124 $(ROOTDEMODIRS) := DIRMODE = 755
124 125
125 126 LINTLIB= llib-l$(LIBNAME).ln
126 127 LINTFLAGS= -uaxm
127 128 LINTFLAGS64= -uaxm -m64
128 129 LINTSRC= $(LINTLIB:%.ln=%)
129 130 LINTOUT= lint.out
130 131 ARFLAGS= r
131 132 SONAME= $(DYNLIB)
132 133 # For most libraries, we should be able to resolve all symbols at link time,
133 134 # either within the library or as dependencies, all text should be pure, and
134 135 # combining relocations into one relocation table reduces startup costs.
135 136 # All options are tunable to allow overload/omission from lower makefiles.
136 137
137 138
138 139 HSONAME= -h$(SONAME)
139 140 DYNFLAGS= $(HSONAME) $(ZTEXT) $(ZDEFS) $(BDIRECT) \
140 141 $(MAPFILES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%)
141 142
142 143 LDLIBS= $(LDLIBS.lib)
143 144
144 145 OBJS= $(OBJECTS:%=objs/%)
145 146 PICS= $(OBJECTS:%=pics/%)
146 147
147 148 # Declare that all library .o's can all be made in parallel.
↓ open down ↓ |
117 lines elided |
↑ open up ↑ |
148 149 # The DUMMY target is for those instances where OBJS and PICS
149 150 # are empty (to avoid an unconditional .PARALLEL declaration).
150 151 .PARALLEL: $(OBJS) $(PICS) DUMMY
151 152
152 153 # default value for "portable" source
153 154 SRCS= $(OBJECTS:%.o=$(SRCDIR)/%.c)
154 155
155 156 # default build of an archive and a shared object,
156 157 # overridden locally when extra processing is needed
157 158 BUILD.AR= $(AR) $(ARFLAGS) $@ $(AROBJS)
158 -BUILD.SO= $(CC) -o $@ $(GSHARED) $(DYNFLAGS) $(PICS) $(EXTPICS) $(LDLIBS)
159 -BUILDCCC.SO= $(CCC) -o $@ $(GSHARED) $(DYNFLAGS) $(PICS) $(EXTPICS) $(LDLIBS)
159 +BUILD.SO= $(CC) $(CFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
160 + $(PICS) $(EXTPICS) $(LDLIBS)
161 +BUILDCCC.SO= $(CCC) $(CCFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
162 + $(PICS) $(EXTPICS) $(LDLIBS)
160 163
161 164 # default dynamic library symlink
162 165 INS.liblink= -$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKS)$(VERS) $@
163 166 INS.liblinkccc= -$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKSCCC)$(VERS) $@
164 167
165 168 # default 64-bit dynamic library symlink
166 169 INS.liblink64= -$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKS)$(VERS) $@
167 170 INS.liblinkccc64= -$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKSCCC)$(VERS) $@
168 171
169 172 #
170 173 # If appropriate, augment POST_PROCESS_O and POST_PROCESS_SO to do CTF
171 174 # processing. We'd like to just conditionally append to POST_PROCESS_O and
172 175 # POST_PROCESS_SO, but ParallelMake has a bug which causes the same value to
173 176 # sometimes get appended more than once, which will cause ctfconvert to fail.
174 177 # So, instead we introduce CTFCONVERT_POST and CTFMERGE_POST, which are always
175 178 # appended to POST_PROCESS_O and POST_PROCESS_SO but are no-ops unless CTF
176 179 # processing should be done.
177 180 #
178 181 CTFCONVERT_POST = :
179 182 CTFMERGE_POST = :
180 183 POST_PROCESS_O += ; $(CTFCONVERT_POST)
181 184 POST_PROCESS_SO += ; $(CTFMERGE_POST)
182 185
183 186 CTFMERGE_LIB = $(CTFMERGE) $(CTFMRGFLAGS) -t -f -L VERSION -o $@ $(PICS)
184 187
185 188 # conditional assignments
186 189
187 190 $(OBJS) := sparc_CFLAGS += -xregs=no%appl
188 191
189 192 $(PICS) := sparc_CFLAGS += -xregs=no%appl $(sparc_C_PICFLAGS)
190 193 $(PICS) := sparcv9_CFLAGS += -xregs=no%appl $(sparcv9_C_PICFLAGS)
191 194 $(PICS) := i386_CFLAGS += $(i386_C_PICFLAGS)
192 195 $(PICS) := amd64_CFLAGS += $(amd64_C_PICFLAGS)
193 196 $(PICS) := CCFLAGS += $(CC_PICFLAGS)
194 197 $(PICS) := CPPFLAGS += -DPIC -D_REENTRANT
195 198 $(PICS) := sparcv9_CCFLAGS += -xregs=no%appl $(sparcv9_CC_PICFLAGS)
196 199 $(PICS) := amd64_CCFLAGS += $(amd64_CC_PICFLAGS)
197 200 $(PICS) := CFLAGS += $(CTF_FLAGS)
198 201 $(PICS) := CFLAGS64 += $(CTF_FLAGS)
199 202 $(PICS) := CTFCONVERT_POST = $(CTFCONVERT_O)
200 203 $(DYNLIB) := CTFMERGE_POST = $(CTFMERGE_LIB)
201 204
202 205 $(LINTLIB):= LOG = -DLOGGING
203 206 $(LIBRARY):= AROBJS = $(OBJS)
204 207 $(LIBRARY):= DIR = objs
205 208 $(DYNLIB):= DIR = pics
206 209 $(DYNLIBCCC):= DIR = pics
207 210
208 211 SONAMECCC= $(DYNLIBCCC)
209 212 HSONAMECCC= -h $(SONAMECCC)
210 213 #
211 214 # Keep in sync with the standard DYNFLAGS
212 215 #
213 216 $(DYNLIBCCC):= DYNFLAGS = $(HSONAMECCC) $(ZTEXT) $(ZDEFS) \
214 217 $(MAPFILES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%) \
215 218 $(BDIRECT) $(NORUNPATH)
216 219
217 220
218 221 # build rule for "portable" source
219 222 objs/%.o pics/%.o: %.c
220 223 $(COMPILE.c) -o $@ $<
221 224 $(POST_PROCESS_O)
222 225
223 226 objs/%.o pics/%.o: %.cc
224 227 $(COMPILE.cc) -o $@ $<
225 228 $(POST_PROCESS_O)
226 229
227 230 .PRECIOUS: $(LIBS)
228 231
229 232 # Define the majority text domain in this directory.
230 233 TEXT_DOMAIN= SUNW_OST_OSLIB
231 234
232 235 $(ROOTMAN3)/%: %.sunman
233 236 $(INS.rename)
234 237
235 238 #
236 239 # For library source code, we expect that some symbols may not be used or
237 240 # may *appear* to be able to rescoped to static; shut lint up. Never add
238 241 # a flag here unless you're *sure* that all libraries need to be linted
239 242 # with it.
240 243 #
241 244 LINTCHECKFLAGS = -m -erroff=E_NAME_DEF_NOT_USED2
242 245 LINTCHECKFLAGS += -erroff=E_NAME_DECL_NOT_USED_DEF2
243 246
244 247 #
245 248 # Target Architecture
246 249 #
247 250 TARGETMACH= $(MACH)
248 251
249 252 #
250 253 # Allow people to define their own clobber rules. Normal makefiles
251 254 # shouldn't override this - they should override $(CLOBBERFILES) instead.
252 255 #
253 256 CLOBBERTARGFILES= $(LIBS) $(DYNLIB) $(CLOBBERFILES)
↓ open down ↓ |
84 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX