Print this page
10079 smatch Makefile changes for usr/src/lib
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libumem/Makefile.com
+++ new/usr/src/lib/libumem/Makefile.com
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
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.
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
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 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 23 # Use is subject to license terms.
24 24 #
25 -# Copyright (c) 2012, Joyent, Inc. All rights reserved.
25 +# Copyright (c) 2018, Joyent, Inc.
26 26 #
27 27
28 28 #
29 29 # The build process for libumem is sightly different from that used by other
30 30 # libraries, because libumem must be built in two flavors - as a standalone
31 31 # for use by kmdb and as a normal library. We use $(CURTYPE) to indicate the
32 32 # current flavor being built.
33 33 #
34 34
35 35 LIBRARY = libumem.a
36 36 STANDLIBRARY = libstandumem.so
37 37 VERS = .1
38 38
39 39 # By default, we build the shared library. Construction of the standalone
40 40 # is specifically requested by architecture-specific Makefiles.
41 41 TYPES = library
42 42 CURTYPE = library
43 43
44 44 # This would be much prettier if a) Makefile.lib didn't reqire both $(SRCS) and
45 45 # $(OBJECTS) to be set or b) make gave us a nice way to do basename in pattern
46 46 # replacement definitions.
47 47
48 48 # Files specific to the library version of libumem
49 49 OBJECTS_library = \
50 50 init_lib.o \
51 51 umem_agent_support.o \
52 52 umem_fail.o \
53 53 umem_fork.o \
54 54 umem_update_thread.o \
55 55 vmem_mmap.o \
56 56 vmem_sbrk.o
57 57
58 58 SRCS_library = $(OBJECTS_library:%.o=../common/%.c)
59 59
60 60 # Files specific to the standalone version of libumem
61 61 OBJECTS_standalone = \
62 62 init_stand.o \
63 63 stub_stand.o \
64 64 vmem_stand.o
65 65
66 66 SRCS_standalone = $(OBJECTS_standalone:%.o=../common/%.c)
67 67
68 68 # Architecture-dependent files common to both versions of libumem
69 69 OBJECTS_common_isadep = \
70 70 asm_subr.o \
71 71 umem_genasm.o
72 72
73 73 SRCS_common_isadep = \
74 74 $(ISASRCDIR)/asm_subr.s \
75 75 $(ISASRCDIR)/umem_genasm.c
76 76
77 77 # Architecture-independent files common to both versions of libumem
78 78 OBJECTS_common_common = \
79 79 envvar.o \
80 80 getpcstack.o \
81 81 malloc.o \
82 82 misc.o \
83 83 vmem_base.o \
84 84 umem.o \
85 85 vmem.o
86 86
87 87 SRCS_common_common = $(OBJECTS_common_common:%.o=../common/%.c)
88 88
89 89 OBJECTS = \
90 90 $(OBJECTS_$(CURTYPE)) \
91 91 $(OBJECTS_common_isadep) \
92 92 $(OBJECTS_common_common)
93 93
94 94 include ../../Makefile.lib
95 95 include ../../Makefile.rootfs
96 96
97 97 SRCS = \
98 98 $(SRCS_$(CURTYPE)) \
99 99 $(SRCS_common_isadep) \
100 100 $(SRCS_common_common)
101 101
102 102 SRCDIR = ../common
103 103
104 104 #
105 105 # Used to verify that the standalone doesn't have any unexpected external
106 106 # dependencies.
107 107 #
108 108 LINKTEST_OBJ = objs/linktest_stand.o
109 109
110 110 CLOBBERFILES_standalone = $(LINKTEST_OBJ)
111 111 CLOBBERFILES += $(CLOBBERFILES_$(CURTYPE))
112 112
113 113 LIBS_standalone = $(STANDLIBRARY)
114 114 LIBS_library = $(DYNLIB) $(LINTLIB)
115 115 LIBS = $(LIBS_$(CURTYPE))
116 116
117 117 MAPFILE_SUPPLEMENTAL_standalone = ../common/stand_mapfile
118 118 MAPFILE_SUPPLEMENTAL = $(MAPFILE_SUPPLEMENTAL_$(CURTYPE))
119 119
120 120 LDLIBS += -lc
121 121
122 122 LDFLAGS_standalone = $(ZNOVERSION) $(BREDUCE) -M../common/mapfile-vers \
↓ open down ↓ |
87 lines elided |
↑ open up ↑ |
123 123 -M$(MAPFILE_SUPPLEMENTAL) -dy -r
124 124 LDFLAGS = $(LDFLAGS_$(CURTYPE))
125 125
126 126 ASFLAGS_standalone = -DUMEM_STANDALONE
127 127 ASFLAGS_library =
128 128 ASFLAGS += -P $(ASFLAGS_$(CURTYPE)) -D_ASM
129 129
130 130 CERRWARN += -_gcc=-Wno-switch
131 131 CERRWARN += -_gcc=-Wno-uninitialized
132 132
133 +SMOFF += deref_check
134 +
133 135 $(LINTLIB) := SRCS = ../common/$(LINTSRC)
134 136
135 137 # We want the thread-specific errno in the library, but we don't want it in
136 138 # the standalone. $(DTS_ERRNO) is designed to add -D_TS_ERRNO to $(CPPFLAGS),
137 139 # in order to enable this feature. Conveniently, -D_REENTRANT does the same
138 140 # thing. As such, we null out $(DTS_ERRNO) to ensure that the standalone
139 141 # doesn't get it.
140 142 DTS_ERRNO=
141 143
142 144 # We need to rename some standard functions so we can easily implement them
143 145 # in consumers.
144 146 STAND_RENAMED_FUNCS= \
145 147 atomic_add_64 \
146 148 atomic_add_32_nv \
147 149 atomic_swap_64 \
148 150 snprintf \
149 151 vsnprintf
150 152
151 153 CPPFLAGS_standalone = -DUMEM_STANDALONE $(STAND_RENAMED_FUNCS:%=-D%=umem_%)
152 154 CPPFLAGS_library = -D_REENTRANT
153 155 CPPFLAGS += -I../common -I../../common/inc $(CPPFLAGS_$(CURTYPE))
154 156
155 157 CFLAGS_standalone = $(STAND_FLAGS_32)
156 158 CFLAGS_common =
157 159 CFLAGS += $(CFLAGS_$(CURTYPE)) $(CFLAGS_common)
158 160
159 161 CFLAGS64_standalone = $(STAND_FLAGS_64)
160 162 CFLAGS64 += $(CCVERBOSE) $(CFLAGS64_$(CURTYPE)) $(CFLAGS64_common)
161 163
162 164 INSTALL_DEPS_library = $(ROOTLINKS) $(ROOTLINT) $(ROOTLIBS)
163 165
164 166 #
165 167 # turn off ptr-cast warnings, since we do them all the time
166 168 #
167 169 LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN
168 170 LINTFLAGS64 += -erroff=E_BAD_PTR_CAST_ALIGN
169 171
170 172 DYNFLAGS += $(ZINTERPOSE)
171 173
172 174 .KEEP_STATE:
↓ open down ↓ |
30 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX