Print this page
9852 enable ld(1) guidance and deflib assertions for the illumos build
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/rcm_daemon/Makefile.com
+++ new/usr/src/cmd/rcm_daemon/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.
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 (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 # Copyright 2016 Nexenta Systems, Inc.
25 25 #
26 26
27 27 include ../../Makefile.cmd
28 28
29 29 COMMON = ../common
30 30
31 31 RCM_SRC = \
32 32 $(COMMON)/rcm_event.c \
33 33 $(COMMON)/rcm_main.c \
34 34 $(COMMON)/rcm_impl.c \
35 35 $(COMMON)/rcm_subr.c \
36 36 $(COMMON)/rcm_lock.c \
37 37 $(COMMON)/rcm_script.c
38 38
39 39 RCM_OBJ = \
40 40 rcm_event.o \
41 41 rcm_main.o \
42 42 rcm_impl.o \
43 43 rcm_subr.o \
44 44 rcm_lock.o \
45 45 rcm_script.o
46 46
47 47 COMMON_MOD_SRC = \
48 48 $(COMMON)/filesys_rcm.c \
49 49 $(COMMON)/dump_rcm.c \
50 50 $(COMMON)/swap_rcm.c \
51 51 $(COMMON)/network_rcm.c \
52 52 $(COMMON)/vlan_rcm.c \
53 53 $(COMMON)/vnic_rcm.c \
54 54 $(COMMON)/ibpart_rcm.c \
55 55 $(COMMON)/aggr_rcm.c \
56 56 $(COMMON)/ip_rcm.c \
57 57 $(COMMON)/cluster_rcm.c \
58 58 $(COMMON)/pool_rcm.c \
59 59 $(COMMON)/mpxio_rcm.c \
60 60 $(COMMON)/ip_anon_rcm.c \
61 61 $(COMMON)/bridge_rcm.c
62 62
63 63 sparc_MOD_SRC = $(COMMON)/ttymux_rcm.c
64 64
65 65 COMMON_PERL_SCRIPT_SRC =
66 66
67 67 sparc_PERL_SCRIPT_SRC = SUNW,vdevices.pl
68 68
69 69 COMMON_SHELL_SCRIPT_SRC = SUNW,ibsdpu.sh \
70 70 SUNW,rdsv3u.sh
71 71
72 72 COMMON_MOD_OBJ = \
73 73 filesys_rcm.o \
74 74 dump_rcm.o \
75 75 swap_rcm.o \
76 76 network_rcm.o \
77 77 vlan_rcm.o \
78 78 vnic_rcm.o \
79 79 ibpart_rcm.o \
80 80 aggr_rcm.o \
81 81 ip_rcm.o \
82 82 cluster_rcm.o \
83 83 pool_rcm.o \
84 84 mpxio_rcm.o \
85 85 ip_anon_rcm.o \
86 86 bridge_rcm.o
87 87
88 88 sparc_MOD_OBJ = ttymux_rcm.o
89 89
90 90 RCM_DAEMON = rcm_daemon
91 91
92 92 COMMON_RCM_MODS = \
93 93 SUNW_filesys_rcm.so \
94 94 SUNW_dump_rcm.so \
95 95 SUNW_swap_rcm.so \
96 96 SUNW_network_rcm.so \
97 97 SUNW_vlan_rcm.so \
98 98 SUNW_vnic_rcm.so \
99 99 SUNW_ibpart_rcm.so \
100 100 SUNW_aggr_rcm.so \
101 101 SUNW_ip_rcm.so \
102 102 SUNW_cluster_rcm.so \
103 103 SUNW_pool_rcm.so \
104 104 SUNW_mpxio_rcm.so \
105 105 SUNW_ip_anon_rcm.so \
106 106 SUNW_bridge_rcm.so
107 107
108 108 sparc_RCM_MODS = SUNW_ttymux_rcm.so
109 109
110 110 RCM_DIR = rcm
111 111 MOD_DIR = modules
112 112 SCRIPT_DIR = scripts
113 113
114 114 CLOBBERFILES += $(COMMON_RCM_MODS) $($(MACH)_RCM_MODS) $(RCM_DAEMON)
115 115
116 116 LINT_MODULES = $(COMMON_MOD_SRC:.c=.ln) $($(MACH)_MOD_SRC:.c=.ln)
117 117
118 118 CPPFLAGS += -I..
119 119 CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
120 120 CFLAGS += $(CCVERBOSE) $(C_PICFLAGS)
121 121
↓ open down ↓ |
121 lines elided |
↑ open up ↑ |
122 122 CERRWARN += -_gcc=-Wno-parentheses
123 123 CERRWARN += -_gcc=-Wno-unused-label
124 124 CERRWARN += -_gcc=-Wno-uninitialized
125 125 CERRWARN += -_gcc=-Wno-unused-function
126 126
127 127 MAPFILES = ../common/mapfile-intf $(MAPFILE.NGB)
128 128 rcm_daemon := LDFLAGS += $(MAPFILES:%=-M%)
129 129
130 130 LINTFLAGS += -u -erroff=E_FUNC_ARG_UNUSED
131 131
132 -LDLIBS_MODULES =
133 -SUNW_pool_rcm.so := LDLIBS_MODULES += -L$(ROOT)/usr/lib -lpool
134 -SUNW_network_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
135 -SUNW_vlan_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
136 -SUNW_vnic_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
137 -SUNW_ibpart_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
138 -SUNW_aggr_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
139 -SUNW_ip_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -linetutil -ldladm -lipmp -lipadm
140 -SUNW_ip_anon_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -linetutil
141 -SUNW_bridge_rcm.so := LDLIBS_MODULES += -L$(ROOT)/lib -ldladm
132 +#
133 +# All of the module plugins leverage the LDLIBS_MODULES, but not LDLIBS. As such
134 +# we define a base set for all modules that we know they need due to -zguidance
135 +# and only append extra libraries that individual modules need.
136 +#
137 +LDLIBS_MODULES = -L$(ROOT)/lib -L$(ROOT)/usr/lib -lc -lrcm
138 +SUNW_pool_rcm.so := LDLIBS_MODULES += -lpool -lnvpair
139 +SUNW_svm_rcm.so := LDLIBS_MODULES += -lmeta
140 +SUNW_network_rcm.so := LDLIBS_MODULES += -ldladm -lnvpair -ldevinfo
141 +SUNW_vlan_rcm.so := LDLIBS_MODULES += -ldladm -lnvpair
142 +SUNW_vnic_rcm.so := LDLIBS_MODULES += -ldladm -lnvpair
143 +SUNW_ibpart_rcm.so := LDLIBS_MODULES += -ldladm -lnvpair
144 +SUNW_aggr_rcm.so := LDLIBS_MODULES += -ldladm -lnvpair
145 +SUNW_ip_rcm.so := LDLIBS_MODULES += -linetutil -ldladm -lipmp -lipadm -lnvpair \
146 + -lgen -lsocket
147 +SUNW_ip_anon_rcm.so := LDLIBS_MODULES += -linetutil -lnsl
148 +SUNW_bridge_rcm.so := LDLIBS_MODULES += -ldladm -lnvpair
149 +SUNW_mpxio_rcm.so := LDLIBS_MODULES += -ldevinfo
142 150
143 -LDLIBS += -lgen -lelf -lrcm -lnvpair -ldevinfo -lnsl -lsocket
151 +LDLIBS += -lrcm -lnvpair
144 152
145 153 SRCS = $(RCM_SRC) $(COMMON_MOD_SRC)
146 154
147 155 POFILES = $(SRCS:.c=.po)
148 156 POFILE = prcm_daemon.po
149 157
150 158 PERL_SCRIPTS = $(COMMON_PERL_SRC) $($(MACH)_PERL_SCRIPT_SRC)
151 159 SHELL_SCRIPTS = $(COMMON_SHELL_SCRIPT_SRC)
152 160 RCM_SCRIPTS = $(PERL_SCRIPTS) $(SHELL_SCRIPTS)
153 161
154 162 # install specifics
155 163
156 164 ROOTLIB_RCM = $(ROOTLIB)/$(RCM_DIR)
157 165 ROOTLIB_RCM_MOD = $(ROOTLIB_RCM)/$(MOD_DIR)
158 166 ROOTLIB_RCM_DAEMON = $(RCM_DAEMON:%=$(ROOTLIB_RCM)/%)
159 167 ROOTLIB_RCM_MODULES = $(COMMON_RCM_MODS:%=$(ROOTLIB_RCM_MOD)/%) \
160 168 $($(MACH)_RCM_MODS:%=$(ROOTLIB_RCM_MOD)/%)
161 169 ROOTLIB_RCM_SCRIPT = $(ROOTLIB_RCM)/$(SCRIPT_DIR)
162 170 ROOTLIB_RCM_SCRIPTS = $(RCM_SCRIPTS:%=$(ROOTLIB_RCM_SCRIPT)/%)
163 171 ROOTETC_RCM = $(ROOTETC)/$(RCM_DIR)
164 172 ROOTETC_RCM_SCRIPT = $(ROOTETC_RCM)/$(SCRIPT_DIR)
165 173
166 174 all := TARGET= all
167 175 install := TARGET= install
168 176 clean := TARGET= clean
169 177 clobber := TARGET= clobber
170 178 lint := TARGET= lint
171 179
172 180 $(ROOTLIB_RCM_SCRIPTS) := FILEMODE = 555
173 181
174 182 .KEEP_STATE:
175 183
176 184 all: $(RCM_DAEMON) $(COMMON_RCM_MODS) $($(MACH)_RCM_MODS)
177 185
178 186 install: all \
179 187 $(ROOTLIB_RCM) \
180 188 $(ROOTLIB_RCM_DAEMON) \
181 189 $(ROOTLIB_RCM_MOD) \
182 190 $(ROOTLIB_RCM_MODULES) \
183 191 $(ROOTLIB_RCM_SCRIPT) \
184 192 $(ROOTETC_RCM) \
185 193 $(ROOTETC_RCM_SCRIPT) \
186 194 $(ROOTLIB_RCM_SCRIPTS)
187 195
188 196 clean:
189 197 $(RM) $(RCM_OBJ) $(COMMON_MOD_OBJ) $($(MACH)_MOD_OBJ) $(POFILES)
190 198
191 199 lint: $(RCM_DAEMON).ln $(LINT_MODULES)
192 200
193 201 $(RCM_DAEMON).ln: FRC
194 202 $(LINT.c) $(RCM_SRC) $(LDLIBS)
195 203
196 204 %.ln: FRC
197 205 $(LINT.c) $(RCM_SRC) $(@:.ln=.c) $(LDLIBS)
198 206
199 207 FRC:
200 208
201 209 include ../../Makefile.targ
202 210
203 211 $(POFILE): $(POFILES)
204 212 $(RM) $@; cat $(POFILES) > $@
205 213
206 214 $(RCM_DAEMON): $(RCM_OBJ) $(MAPFILES)
207 215 $(LINK.c) -o $@ $< $(RCM_OBJ) $(LDLIBS)
208 216 $(POST_PROCESS)
209 217
210 218 SUNW_%.so: %.o
211 219 $(LINK.c) -o $@ $(GSHARED) -h $@ $< $(LDLIBS_MODULES)
212 220
213 221 %.o: $(COMMON)/%.c
214 222 $(COMPILE.c) -o $@ $<
215 223
216 224 $(ROOTLIB_RCM):
217 225 $(INS.dir)
218 226
219 227 $(ROOTLIB_RCM)/%: %
220 228 $(INS.file)
221 229
222 230 $(ROOTLIB_RCM_MOD):
223 231 $(INS.dir)
224 232
225 233 $(ROOTLIB_RCM_MOD)/%: %
226 234 $(INS.file)
227 235
228 236 $(ROOTLIB_RCM_SCRIPT):
229 237 $(INS.dir)
230 238
231 239 $(ROOTETC_RCM):
232 240 $(INS.dir)
233 241
234 242 $(ROOTETC_RCM_SCRIPT):
235 243 $(INS.dir)
236 244
237 245 $(ROOTLIB_RCM_SCRIPT)/%: $(COMMON)/%
238 246 $(INS.file)
↓ open down ↓ |
85 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX