Print this page
10593 illumos build should not use kernel modules as link-editor input
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/intel/genunix/Makefile
+++ new/usr/src/uts/intel/genunix/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
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 23 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 24 # Use is subject to license terms.
25 25 #
26 26 # Copyright (c) 2018, Joyent, Inc.
27 27
28 28 #
29 29 # This makefile drives the production of the generic
30 30 # unix kernel module.
31 31 #
32 32 # x86 implementation architecture dependent
33 33 #
34 34
35 35 #
36 36 # Path to the base of the uts directory tree (usually /usr/src/uts).
37 37 #
38 38 UTSBASE = ../..
39 39
40 40 #
41 41 # Define the module and object file sets.
42 42 #
43 43 MODULE = genunix
44 44 GENUNIX = $(OBJS_DIR)/$(MODULE)
45 45
46 46 OBJECTS = $(GENUNIX_OBJS:%=$(OBJS_DIR)/%) \
47 47 $(NOT_YET_KMODS:%=$(OBJS_DIR)/%)
48 48
49 49 LINTS = $(GENUNIX_OBJS:%.o=$(LINTS_DIR)/%.ln) \
50 50 $(NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln)
51 51
52 52 ROOTMODULE = $(ROOT_KERN_DIR)/$(MODULE)
53 53
54 54 LIBGEN = $(OBJS_DIR)/libgenunix.so
55 55 LIBSTUBS = $(GENSTUBS_OBJS:%=$(OBJS_DIR)/%)
56 56
57 57 #
58 58 # Include common rules.
59 59 #
60 60 include $(UTSBASE)/intel/Makefile.intel
61 61
62 62 #
63 63 # Define targets
64 64 #
65 65 ALL_TARGET = $(LIBGEN) $(GENUNIX)
66 66 LINT_TARGET = $(MODULE).lint
67 67 INSTALL_TARGET = $(LIBGEN) $(GENUNIX) $(ROOTMODULE)
68 68
69 69 #
70 70 # Overrides
71 71 #
72 72 CLOBBERFILES += $(GENUNIX)
73 73 CLEANFILES += $(LIBSTUBS) $(LIBGEN)
74 74 BINARY =
75 75
76 76 #
77 77 # Non-patch genunix builds merge a version of the ip module called ipctf. This
78 78 # is to ensure that the common network-related types are included in genunix and
79 79 # can thus be uniquified out of other modules. We don't want to do this for
80 80 # patch builds, since we can't guarantee that ip and genunix will be in the same
81 81 # patch.
82 82 #
83 83 IPCTF_TARGET = $(IPCTF)
84 84 $(PATCH_BUILD)IPCTF_TARGET =
85 85
86 86 CPPFLAGS += -I$(SRC)/common
87 87 CPPFLAGS += -I$(SRC)/uts/common/fs/zfs
88 88
89 89 CPPFLAGS += -I$(UTSBASE)/i86pc
90 90
91 91 #
92 92 # For now, disable these lint checks; maintainers should endeavor
93 93 # to investigate and remove these for maximum lint coverage.
94 94 # Please do not carry these forward to new Makefiles.
95 95 #
96 96 LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON
97 97 LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
98 98 LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
99 99 LINTTAGS += -erroff=E_STATIC_UNUSED
100 100 LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW
101 101 LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV
102 102
103 103 CERRWARN += -_gcc=-Wno-unused-label
104 104 CERRWARN += -_gcc=-Wno-unused-variable
105 105 CERRWARN += -_gcc=-Wno-unused-value
106 106 CERRWARN += -_gcc=-Wno-unused-function
107 107 CERRWARN += -_gcc=-Wno-parentheses
108 108 CERRWARN += -_gcc=-Wno-switch
109 109 CERRWARN += -_gcc=-Wno-type-limits
110 110 CERRWARN += -_gcc=-Wno-uninitialized
111 111 CERRWARN += -_gcc=-Wno-clobbered
112 112 CERRWARN += -_gcc=-Wno-empty-body
113 113
114 114 # false positives
115 115 SMOFF += index_overflow
116 116 $(OBJS_DIR)/seg_vn.o := SMOFF += deref_check
117 117 $(OBJS_DIR)/ddi_intr_irm.o := SMOFF += deref_check
118 118
119 119 # need work still
120 120 SMOFF += signed,indenting,all_func_returns
121 121 $(OBJS_DIR)/clock_highres.o := SMOFF += signed_integer_overflow_check
122 122 $(OBJS_DIR)/evchannels.o := SMOFF += allocating_enough_data
123 123 $(OBJS_DIR)/klpd.o := SMOFF += cast_assign
124 124 $(OBJS_DIR)/lookup.o := SMOFF += strcpy_overflow
125 125 $(OBJS_DIR)/process.o := SMOFF += or_vs_and
126 126 $(OBJS_DIR)/sunpci.o := SMOFF += deref_check
127 127 $(OBJS_DIR)/timers.o := SMOFF += signed_integer_overflow_check
128 128
129 129 # definitely wrong
130 130 $(OBJS_DIR)/acl_common.o := SMOFF += or_vs_and
131 131
132 132 #
133 133 # Ensure that lint sees 'struct cpu' containing a fully declared
134 134 # embedded 'struct machcpu'
135 135 #
136 136 LINTFLAGS += -D_MACHDEP -I../../i86pc
137 137
138 138 #
139 139 # Default build targets.
140 140 #
141 141 .KEEP_STATE:
142 142
143 143 def: $(DEF_DEPS)
144 144
145 145 all: $(ALL_DEPS)
146 146
147 147 clean: $(CLEAN_DEPS)
148 148
↓ open down ↓ |
148 lines elided |
↑ open up ↑ |
149 149 clobber: $(CLOBBER_DEPS)
150 150
151 151 lint: $(LINT_DEPS)
152 152
153 153 modlintlib: $(MODLINTLIB_DEPS)
154 154
155 155 clean.lint: $(CLEAN_LINT_DEPS)
156 156
157 157 install: $(INSTALL_DEPS)
158 158
159 -$(LIBGEN): $(GENUNIX) $(LIBSTUBS)
160 - $(BUILD.SO) $(GENUNIX) $(LIBSTUBS)
159 +# Due to what seems to be an issue in GCC 4 generated DWARF containing
160 +# symbolic relocations against non-allocatable .debug sections, libgenunix.so
161 +# must be built from a stripped object, thus we create an intermediary
162 +# libgenunix.o we can safely strip.
163 +LIBGENUNIX_O = $(OBJS_DIR)/libgenunix.o
164 +CLEANFILES += $(LIBGENUNIX_O)
165 +
166 +$(LIBGENUNIX_O): $(OBJECTS)
167 + $(LD) -r -o $(OBJS_DIR)/libgenunix.o $(OBJECTS)
168 + $(STRIP) -x $(OBJS_DIR)/libgenunix.o
169 +
170 +$(LIBGEN): $(LIBGENUNIX_O) $(LIBSTUBS)
171 + $(BUILD.SO) $(LIBGENUNIX_O) $(LIBSTUBS)
161 172
162 173 $(IPCTF_TARGET) ipctf_target: FRC
163 174 @cd $(IPDRV_DIR); pwd; $(MAKE) ipctf.$(OBJS_DIR)
164 175 @pwd
165 176
166 177 $(GENUNIX): $(IPCTF_TARGET) $(OBJECTS)
167 178 $(LD) -r $(LDFLAGS) -o $@ $(OBJECTS)
168 179 $(CTFMERGE_GENUNIX_MERGE)
169 180 $(POST_PROCESS)
170 181
171 182 #
172 183 # Include common targets.
173 184 #
174 185 include $(UTSBASE)/intel/Makefile.targ
175 186
176 187 #
177 188 # Software workarounds for hardware "features".
178 189 #
179 190 include $(UTSBASE)/i86pc/Makefile.workarounds
180 191
181 192 ALL_DEFS += $(WORKAROUND_DEFS)
182 193
183 194 #
184 195 # Override.
185 196 #
186 197 $(MODULE).lint := GEN_LINT_LIB =
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX