1 --- configure.in.old 2009-06-24 21:13:57.000000000 +0200
2 +++ configure.in 2009-06-25 15:05:45.000000000 +0200
3 @@ -1622,6 +1622,26 @@ fi
4 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
6 dnl ===================================================================
7 +dnl Check for -Wl,--as-needed linker support
8 +dnl ===================================================================
9 +HAVE_WORKING_LD_AS_NEEDED=
10 +if test \( "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes" \) -a "$GCC" = "yes"; then
11 + AC_MSG_CHECKING([for working -Wl,--as-needed linker support])
12 + _ld_version=`$CC -Wl,--version 2>&1 | head -n 1 | $SED -e "s|(.*)||" -e "s|^[[^0-9]]*||"`
13 + _ld_major=`echo $_ld_version | cut -d"." -f 1`
14 + _ld_minor=`echo $_ld_version | cut -d"." -f 2`
15 + if test "$_ld_major" -gt 2 || \
16 + test "$_ld_major" -eq 2 -a "$_ld_minor" -gt 17 ; then
17 + # there are problems with ld <= 2.17, see also http://www.gentoo.org/proj/en/qa/asneeded.xml
18 + HAVE_WORKING_LD_AS_NEEDED=TRUE
19 + AC_MSG_RESULT([yes])
24 +AC_SUBST(HAVE_WORKING_LD_AS_NEEDED)
26 +dnl ===================================================================
27 dnl Test the IRIX SGI Mips pro compiler
28 dnl ===================================================================
29 if test "$_os" = "IRIX" -o "$_os" = "IRIX64"; then
30 --- set_soenv.in.old 2009-06-24 18:41:31.000000000 +0200
31 +++ set_soenv.in 2009-06-24 21:21:56.000000000 +0200
32 @@ -1894,6 +1894,8 @@ ToFile( "HAVE_LD_HASH_STYLE","@HAVE_LD_H
33 ToFile( "WITH_LINKER_HASH_STYLE","@WITH_LINKER_HASH_STYLE@","e" );
34 ToFile( "HAVE_LD_BSYMBOLIC_FUNCTIONS",
35 "@HAVE_LD_BSYMBOLIC_FUNCTIONS@","e" );
36 +ToFile( "HAVE_WORKING_LD_AS_NEEDED",
37 + "@HAVE_WORKING_LD_AS_NEEDED@","e" );
38 ToFile( "CXX", $CXX, "e" );
39 ToFile( "MINGWCXX", "@MINGWCXX@", "e" );
40 ToFile( "MINGWSTRIP", "@MINGWSTRIP@", "e" );
41 diff -purN solenv.old/inc/unxbsdi2.mk solenv/inc/unxbsdi2.mk
42 --- solenv.old/inc/unxbsdi2.mk 2008-07-11 16:43:37.000000000 +0200
43 +++ solenv/inc/unxbsdi2.mk 2009-06-24 21:38:44.000000000 +0200
44 @@ -128,6 +128,9 @@ LINKFLAGSRUNPATH_BRAND=-Wl,-rpath,\''$$O
46 LINKFLAGSRUNPATH_NONE=
47 LINKFLAGS=-z combreloc $(LINKFLAGSDEFS)
48 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
49 +LINKFLAGS += -Wl,--as-needed
52 # linker flags for linking applications
53 LINKFLAGSAPPGUI= -Wl,-export-dynamic
54 diff -purN solenv.old/inc/unxbsdi.mk solenv/inc/unxbsdi.mk
55 --- solenv.old/inc/unxbsdi.mk 2008-04-10 19:45:44.000000000 +0200
56 +++ solenv/inc/unxbsdi.mk 2009-06-24 21:29:07.000000000 +0200
57 @@ -108,6 +108,9 @@ DYNAMIC = -Wl,-Bdynamic
59 # default linker flags
61 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
62 +LINKFLAGS += -Wl,--as-needed
65 # linker flags for linking applications
66 LINKFLAGSAPPGUI= -Wl,-export-dynamic
67 diff -purN solenv.old/inc/unxfbsd.mk solenv/inc/unxfbsd.mk
68 --- solenv.old/inc/unxfbsd.mk 2008-07-11 16:43:50.000000000 +0200
69 +++ solenv/inc/unxfbsd.mk 2009-06-24 21:26:25.000000000 +0200
70 @@ -150,6 +150,9 @@ LINKFLAGSRUNPATH_BRAND=-Wl,-rpath,\''$$O
72 LINKFLAGSRUNPATH_NONE=
73 LINKFLAGS=-Wl,-z,combreloc $(LINKFLAGSDEFS)
74 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
75 +LINKFLAGS += -Wl,--as-needed
78 # linker flags for linking applications
79 LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec
80 diff -purN solenv.old/inc/unxirgm.mk solenv/inc/unxirgm.mk
81 --- solenv.old/inc/unxirgm.mk 2008-04-10 19:47:57.000000000 +0200
82 +++ solenv/inc/unxirgm.mk 2009-06-24 21:33:53.000000000 +0200
83 @@ -96,6 +96,9 @@ DYNAMIC= -Wl,-Bdynamic
86 LINKFLAGS= -L/usr/lib32 -Wl,-no_unresolved
87 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
88 +LINKFLAGS += -Wl,--as-needed
90 LINKVERSIONMAPFLAG= -Wl,-exports_file
92 LINKFLAGSAPPGUI= $(THREADLIB)
93 diff -purN solenv.old/inc/unxirxm3.mk solenv/inc/unxirxm3.mk
94 --- solenv.old/inc/unxirxm3.mk 2008-04-10 19:48:32.000000000 +0200
95 +++ solenv/inc/unxirxm3.mk 2009-06-24 21:33:59.000000000 +0200
96 @@ -96,6 +96,9 @@ DYNAMIC= -Wl,-Bdynamic
99 LINKFLAGS= -L/usr/lib32 -Wl,-no_unresolved
100 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
101 +LINKFLAGS += -Wl,--as-needed
103 LINKVERSIONMAPFLAG= -Wl,-exports_file
105 LINKFLAGSAPPGUI= $(THREADLIB)
106 diff -purN solenv.old/inc/unxlnga.mk solenv/inc/unxlnga.mk
107 --- solenv.old/inc/unxlnga.mk 2008-07-11 16:44:03.000000000 +0200
108 +++ solenv/inc/unxlnga.mk 2009-06-24 21:39:06.000000000 +0200
109 @@ -164,6 +164,9 @@ LINKFLAGSRUNPATH_BRAND=-Wl,-rpath,\''$$O
110 LINKFLAGSRUNPATH_OXT=
111 LINKFLAGSRUNPATH_NONE=
112 LINKFLAGS=-Wl,-z,combreloc $(LINKFLAGSDEFS)
113 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
114 +LINKFLAGS += -Wl,--as-needed
117 # linker flags for linking applications
118 LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec
119 diff -purN solenv.old/inc/unxlngi4.mk solenv/inc/unxlngi4.mk
120 --- solenv.old/inc/unxlngi4.mk 2008-07-11 16:44:16.000000000 +0200
121 +++ solenv/inc/unxlngi4.mk 2009-06-24 21:25:52.000000000 +0200
122 @@ -141,6 +141,9 @@ LINKFLAGSRUNPATH_BRAND=-Wl,-rpath,\''$$O
123 LINKFLAGSRUNPATH_OXT=
124 LINKFLAGSRUNPATH_NONE=
125 LINKFLAGS=-Wl,-z,combreloc $(LINKFLAGSDEFS)
126 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
127 +LINKFLAGS += -Wl,--as-needed
130 # linker flags for linking applications
131 LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec
132 diff -purN solenv.old/inc/unxlngi6.mk solenv/inc/unxlngi6.mk
133 --- solenv.old/inc/unxlngi6.mk 2009-06-24 18:41:22.000000000 +0200
134 +++ solenv/inc/unxlngi6.mk 2009-06-24 21:25:06.000000000 +0200
135 @@ -161,6 +161,9 @@ LINKFLAGS=-Wl,-z,noexecstack -Wl,-z,comb
136 .IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE"
137 LINKFLAGS += -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo
139 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
140 +LINKFLAGS += -Wl,--as-needed
143 # linker flags for linking applications
144 LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec
145 diff -purN solenv.old/inc/unxlngm68k.mk solenv/inc/unxlngm68k.mk
146 --- solenv.old/inc/unxlngm68k.mk 2008-06-30 17:03:13.000000000 +0200
147 +++ solenv/inc/unxlngm68k.mk 2009-06-24 21:38:53.000000000 +0200
148 @@ -144,6 +144,9 @@ LINKFLAGSRUNPATH_OOO=-Wl,-rpath,\''$$ORI
149 LINKFLAGSRUNPATH_BRAND=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
150 LINKFLAGSRUNPATH_OXT=
151 LINKFLAGS=-Wl,-z,combreloc $(LINKFLAGSDEFS)
152 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
153 +LINKFLAGS += -Wl,--as-needed
156 # linker flags for linking applications
157 LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec
158 diff -purN solenv.old/inc/unxlngmips.mk solenv/inc/unxlngmips.mk
159 --- solenv.old/inc/unxlngmips.mk 2008-06-09 14:38:46.000000000 +0200
160 +++ solenv/inc/unxlngmips.mk 2009-06-24 21:34:56.000000000 +0200
161 @@ -175,6 +175,9 @@ LINKFLAGSRUNPATH_BRAND=-Wl,-rpath,\''$$O
162 LINKFLAGSRUNPATH_OXT=
163 LINKFLAGSRUNPATH_NONE=
164 LINKFLAGS=-Wl,-z,combreloc $(LINKFLAGSDEFS)
165 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
166 +LINKFLAGS += -Wl,--as-needed
169 # linker flags for linking applications
170 LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec
171 diff -purN solenv.old/inc/unxlngp.mk solenv/inc/unxlngp.mk
172 --- solenv.old/inc/unxlngp.mk 2008-04-10 19:50:07.000000000 +0200
173 +++ solenv/inc/unxlngp.mk 2009-06-24 21:36:43.000000000 +0200
174 @@ -97,6 +97,10 @@ LINKFLAGSPROF=
178 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
179 +LINKFLAGS += -Wl,--as-needed
182 .IF "$(NO_BSYMBOLIC)"==""
183 .IF "$(PRJNAME)" != "envtest"
184 LINKFLAGSSHLGUI+=-Bsymbolic
185 diff -purN solenv.old/inc/unxlngppc4.mk solenv/inc/unxlngppc4.mk
186 --- solenv.old/inc/unxlngppc4.mk 2009-06-24 18:41:22.000000000 +0200
187 +++ solenv/inc/unxlngppc4.mk 2009-06-24 21:38:59.000000000 +0200
188 @@ -138,6 +138,9 @@ LINKFLAGSRUNPATH_BRAND=-Wl,-rpath,\''$$O
189 LINKFLAGSRUNPATH_OXT=
190 LINKFLAGSRUNPATH_NONE=
191 LINKFLAGS= $(LINKFLAGSDEFS)
192 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
193 +LINKFLAGS += -Wl,--as-needed
196 # linker flags for linking applications
197 LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec
198 diff -purN solenv.old/inc/unxlngppc.mk solenv/inc/unxlngppc.mk
199 --- solenv.old/inc/unxlngppc.mk 2009-06-24 18:41:22.000000000 +0200
200 +++ solenv/inc/unxlngppc.mk 2009-06-24 21:35:25.000000000 +0200
201 @@ -135,6 +135,9 @@ LINK*=$(CXX)
203 # default linker flags
204 LINKFLAGS=-Wl,-rpath,\''$$ORIGIN'\'
205 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
206 +LINKFLAGS += -Wl,--as-needed
210 # linker flags for linking applications
211 diff -purN solenv.old/inc/unxlngr.mk solenv/inc/unxlngr.mk
212 --- solenv.old/inc/unxlngr.mk 2008-11-10 17:06:12.000000000 +0100
213 +++ solenv/inc/unxlngr.mk 2009-06-24 21:35:02.000000000 +0200
214 @@ -145,6 +145,9 @@ LINKFLAGSRUNPATH_BRAND=-Wl,-rpath,\''$$O
215 LINKFLAGSRUNPATH_OXT=
216 LINKFLAGSRUNPATH_NONE=
217 LINKFLAGS=-Wl,-z,combreloc $(LINKFLAGSDEFS)
218 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
219 +LINKFLAGS += -Wl,--as-needed
222 # linker flags for linking applications
223 LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec
224 diff -purN solenv.old/inc/unxlngs3904.mk solenv/inc/unxlngs3904.mk
225 --- solenv.old/inc/unxlngs3904.mk 2008-06-09 14:39:39.000000000 +0200
226 +++ solenv/inc/unxlngs3904.mk 2009-06-24 21:28:06.000000000 +0200
227 @@ -143,6 +143,9 @@ LINKFLAGSRUNPATH_BRAND=-Wl,-rpath,\''$$O
228 LINKFLAGSRUNPATH_OXT=
229 LINKFLAGSRUNPATH_NONE=
230 LINKFLAGS=-Wl,-z,combreloc $(LINKFLAGSDEFS)
231 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
232 +LINKFLAGS += -Wl,--as-needed
235 # linker flags for linking applications
236 LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec
237 diff -purN solenv.old/inc/unxlngs.mk solenv/inc/unxlngs.mk
238 --- solenv.old/inc/unxlngs.mk 2009-06-24 18:41:22.000000000 +0200
239 +++ solenv/inc/unxlngs.mk 2009-06-24 21:28:45.000000000 +0200
240 @@ -144,6 +144,9 @@ LINKFLAGSRUNPATH_BRAND=-Wl,-rpath,\''$$O
241 LINKFLAGSRUNPATH_OXT=
242 LINKFLAGSRUNPATH_NONE=
243 LINKFLAGS=-z combreloc $(LINKFLAGSDEFS)
244 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
245 +LINKFLAGS += -Wl,--as-needed
248 # linker flags for linking applications
249 LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec
250 diff -purN solenv.old/inc/unxlngx6.mk solenv/inc/unxlngx6.mk
251 --- solenv.old/inc/unxlngx6.mk 2009-06-24 18:41:22.000000000 +0200
252 +++ solenv/inc/unxlngx6.mk 2009-06-24 21:26:08.000000000 +0200
253 @@ -165,6 +165,9 @@ LINKFLAGS=-Wl,-z,combreloc $(LINKFLAGSDE
254 .IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE"
255 LINKFLAGS += -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo
257 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
258 +LINKFLAGS += -Wl,--as-needed
261 # linker flags for linking applications
262 LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec
263 diff -purN solenv.old/inc/unxmacx.mk solenv/inc/unxmacx.mk
264 --- solenv.old/inc/unxmacx.mk 2009-06-24 18:41:22.000000000 +0200
265 +++ solenv/inc/unxmacx.mk 2009-06-24 21:38:13.000000000 +0200
266 @@ -206,6 +206,10 @@ LINKFLAGSRUNPATH_OXT=
267 LINKFLAGSRUNPATH_NONE=
268 LINKFLAGS=$(LINKFLAGSDEFS)
270 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
271 +LINKFLAGS += -Wl,--as-needed
274 # [ed] 5/14/02 If we're building for aqua, add in the objc runtime library into our link line
275 .IF "$(GUIBASE)" == "aqua"
277 diff -purN solenv.old/inc/unxsogi.mk solenv/inc/unxsogi.mk
278 --- solenv.old/inc/unxsogi.mk 2008-04-10 19:53:35.000000000 +0200
279 +++ solenv/inc/unxsogi.mk 2009-06-24 21:34:31.000000000 +0200
280 @@ -82,6 +82,10 @@ LINK*=$(CXX)
284 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
285 +LINKFLAGS += -Wl,--as-needed
288 LINKFLAGSAPPGUI=-Wl,-export-dynamic
289 LINKFLAGSSHLGUI=-shared
290 LINKFLAGSAPPCUI=-Wl,-export-dynamic
291 diff -purN solenv.old/inc/unxsoli4.mk solenv/inc/unxsoli4.mk
292 --- solenv.old/inc/unxsoli4.mk 2008-12-30 15:48:34.000000000 +0100
293 +++ solenv/inc/unxsoli4.mk 2009-06-24 21:27:02.000000000 +0200
294 @@ -144,6 +144,9 @@ LINKFLAGSRUNPATH_BRAND=-R\''$$ORIGIN:$$O
295 LINKFLAGSRUNPATH_OXT=
296 LINKFLAGSRUNPATH_NONE=
297 LINKFLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -library=no%Cstd
298 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
299 +LINKFLAGS += -Wl,--as-needed
301 LINKCFLAGS=-w -mt -z combreloc -norunpath
303 # -z text force fatal error if non PIC code is linked into shared library. Such code
304 diff -purN solenv.old/inc/unxsols4.mk solenv/inc/unxsols4.mk
305 --- solenv.old/inc/unxsols4.mk 2008-12-30 15:48:34.000000000 +0100
306 +++ solenv/inc/unxsols4.mk 2009-06-24 21:34:43.000000000 +0200
307 @@ -150,6 +150,9 @@ LINKFLAGSRUNPATH_BRAND=-R\''$$ORIGIN:$$O
308 LINKFLAGSRUNPATH_OXT=
309 LINKFLAGSRUNPATH_NONE=
310 LINKFLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -library=no%Cstd
311 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
312 +LINKFLAGS += -Wl,--as-needed
314 LINKCFLAGS=-w -mt -z combreloc -norunpath
316 # -z text force fatal error if non PIC code is linked into shared library. Such code
317 diff -purN solenv.old/inc/unxsolu4.mk solenv/inc/unxsolu4.mk
318 --- solenv.old/inc/unxsolu4.mk 2008-08-27 15:38:26.000000000 +0200
319 +++ solenv/inc/unxsolu4.mk 2009-06-24 21:25:30.000000000 +0200
320 @@ -143,6 +143,9 @@ LINKFLAGSRUNPATH_BRAND=-R\''$$ORIGIN:$$O
321 LINKFLAGSRUNPATH_OXT=
322 LINKFLAGS=-m64 -w -mt -z combreloc -PIC -temp=/tmp -norunpath -library=stlport4
323 LINKCFLAGS=-m64 -w -mt -z combreloc -norunpath
324 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
325 +LINKFLAGS += -Wl,--as-needed
328 # -z text force fatal error if non PIC code is linked into shared library. Such code
329 # would be expensive on startup
330 --- unodevtools/source/skeletonmaker/makefile.mk 11 Apr 2008 12:33:12 -0000 1.5
331 +++ unodevtools/source/skeletonmaker/makefile.mk 22 May 2008 15:46:32 -0000
334 APP1DEPN= $(OUT)$/lib$/$(UNODEVTOOLSLIBDEPN) $(SOLARLIBDIR)$/$(CODEMAKERLIBDEPN) \
335 $(SOLARLIBDIR)$/$(COMMONCPPLIBDEPN) $(SOLARLIBDIR)$/$(COMMONJAVALIBDEPN)
336 -APP1STDLIBS = $(REGLIB) $(SALLIB) $(SALHELPERLIB) $(CPPULIB) $(CPPUHELPERLIB) \
337 - $(UNODEVTOOLSLIBST) $(CODEMAKERLIBST) $(COMMONCPPLIBST) $(COMMONJAVALIBST)
339 + $(UNODEVTOOLSLIBST) $(CODEMAKERLIBST) $(COMMONCPPLIBST) $(COMMONJAVALIBST)\
340 + $(REGLIB) $(CPPULIB) $(CPPUHELPERLIB) $(SALHELPERLIB) $(SALLIB)
342 OBJFILES = $(APP1OBJS)
344 diff --git svx/util/makefile.mk svx/util/makefile.mk
345 index 4598098..d5de0b6 100644
346 --- svx/util/makefile.mk
347 +++ svx/util/makefile.mk
348 @@ -172,7 +172,6 @@ SHL2STDLIBS= \