Update ooo320-m1
[ooovba.git] / applied_patches / 0262-link-as-needed.diff
blob626dbb3c033c137e1136df9dc034c260c8e8db9c
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])
20 + else
21 + AC_MSG_RESULT([no])
22 + fi
23 +fi
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
45 LINKFLAGSRUNPATH_OXT=
46 LINKFLAGSRUNPATH_NONE=
47 LINKFLAGS=-z combreloc $(LINKFLAGSDEFS)
48 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
49 +LINKFLAGS += -Wl,--as-needed
50 +.ENDIF
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
58 LINK*=gcc
59 # default linker flags
60 LINKFLAGS=
61 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
62 +LINKFLAGS += -Wl,--as-needed
63 +.ENDIF
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
71 LINKFLAGSRUNPATH_OXT=
72 LINKFLAGSRUNPATH_NONE=
73 LINKFLAGS=-Wl,-z,combreloc $(LINKFLAGSDEFS)
74 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
75 +LINKFLAGS += -Wl,--as-needed
76 +.ENDIF
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
85 LINK= g++
86 LINKFLAGS= -L/usr/lib32 -Wl,-no_unresolved
87 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
88 +LINKFLAGS += -Wl,--as-needed
89 +.ENDIF
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
98 LINK= CC
99 LINKFLAGS= -L/usr/lib32 -Wl,-no_unresolved
100 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
101 +LINKFLAGS += -Wl,--as-needed
102 +.ENDIF
103 LINKVERSIONMAPFLAG= -Wl,-exports_file
105 LINKFLAGSAPPGUI= $(THREADLIB)
106 Index: unxlng.mk
107 ===================================================================
108 --- solenv/inc/unxlng.mk (Revision 276754)
109 +++ solenv/inc/unxlng.mk (Arbeitskopie)
110 @@ -161,6 +161,9 @@
111 .IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE"
112 LINKFLAGS += -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo
113 .ENDIF
114 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
115 +LINKFLAGS += -Wl,--as-needed
116 +.ENDIF
118 # linker flags for linking applications
119 LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \
120 diff -purN solenv.old/inc/unxmacx.mk solenv/inc/unxmacx.mk
121 --- solenv.old/inc/unxmacx.mk 2009-06-24 18:41:22.000000000 +0200
122 +++ solenv/inc/unxmacx.mk 2009-06-24 21:38:13.000000000 +0200
123 @@ -206,6 +206,10 @@ LINKFLAGSRUNPATH_OXT=
124 LINKFLAGSRUNPATH_NONE=
125 LINKFLAGS=$(LINKFLAGSDEFS)
127 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
128 +LINKFLAGS += -Wl,--as-needed
129 +.ENDIF
131 # [ed] 5/14/02 If we're building for aqua, add in the objc runtime library into our link line
132 .IF "$(GUIBASE)" == "aqua"
133 LINKFLAGS+=-lobjc
134 diff -purN solenv.old/inc/unxsogi.mk solenv/inc/unxsogi.mk
135 --- solenv.old/inc/unxsogi.mk 2008-04-10 19:53:35.000000000 +0200
136 +++ solenv/inc/unxsogi.mk 2009-06-24 21:34:31.000000000 +0200
137 @@ -82,6 +82,10 @@ LINK*=$(CXX)
138 LINKC*=$(CC)
140 LINKFLAGS=
141 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
142 +LINKFLAGS += -Wl,--as-needed
143 +.ENDIF
145 LINKFLAGSAPPGUI=-Wl,-export-dynamic
146 LINKFLAGSSHLGUI=-shared
147 LINKFLAGSAPPCUI=-Wl,-export-dynamic
148 diff -purN solenv.old/inc/unxsoli4.mk solenv/inc/unxsoli4.mk
149 --- solenv.old/inc/unxsoli4.mk 2008-12-30 15:48:34.000000000 +0100
150 +++ solenv/inc/unxsoli4.mk 2009-06-24 21:27:02.000000000 +0200
151 @@ -144,6 +144,9 @@ LINKFLAGSRUNPATH_BRAND=-R\''$$ORIGIN:$$O
152 LINKFLAGSRUNPATH_OXT=
153 LINKFLAGSRUNPATH_NONE=
154 LINKFLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -library=no%Cstd
155 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
156 +LINKFLAGS += -Wl,--as-needed
157 +.ENDIF
158 LINKCFLAGS=-w -mt -z combreloc -norunpath
160 # -z text force fatal error if non PIC code is linked into shared library. Such code
161 diff -purN solenv.old/inc/unxsols4.mk solenv/inc/unxsols4.mk
162 --- solenv.old/inc/unxsols4.mk 2008-12-30 15:48:34.000000000 +0100
163 +++ solenv/inc/unxsols4.mk 2009-06-24 21:34:43.000000000 +0200
164 @@ -150,6 +150,9 @@ LINKFLAGSRUNPATH_BRAND=-R\''$$ORIGIN:$$O
165 LINKFLAGSRUNPATH_OXT=
166 LINKFLAGSRUNPATH_NONE=
167 LINKFLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -library=no%Cstd
168 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
169 +LINKFLAGS += -Wl,--as-needed
170 +.ENDIF
171 LINKCFLAGS=-w -mt -z combreloc -norunpath
173 # -z text force fatal error if non PIC code is linked into shared library. Such code
174 diff -purN solenv.old/inc/unxsolu4.mk solenv/inc/unxsolu4.mk
175 --- solenv.old/inc/unxsolu4.mk 2008-08-27 15:38:26.000000000 +0200
176 +++ solenv/inc/unxsolu4.mk 2009-06-24 21:25:30.000000000 +0200
177 @@ -143,6 +143,9 @@ LINKFLAGSRUNPATH_BRAND=-R\''$$ORIGIN:$$O
178 LINKFLAGSRUNPATH_OXT=
179 LINKFLAGS=-m64 -w -mt -z combreloc -PIC -temp=/tmp -norunpath -library=stlport4
180 LINKCFLAGS=-m64 -w -mt -z combreloc -norunpath
181 +.IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
182 +LINKFLAGS += -Wl,--as-needed
183 +.ENDIF
185 # -z text force fatal error if non PIC code is linked into shared library. Such code
186 # would be expensive on startup
187 --- unodevtools/source/skeletonmaker/makefile.mk 11 Apr 2008 12:33:12 -0000 1.5
188 +++ unodevtools/source/skeletonmaker/makefile.mk 22 May 2008 15:46:32 -0000
189 @@ -51,8 +51,9 @@
191 APP1DEPN= $(OUT)$/lib$/$(UNODEVTOOLSLIBDEPN) $(SOLARLIBDIR)$/$(CODEMAKERLIBDEPN) \
192 $(SOLARLIBDIR)$/$(COMMONCPPLIBDEPN) $(SOLARLIBDIR)$/$(COMMONJAVALIBDEPN)
193 -APP1STDLIBS = $(REGLIB) $(SALLIB) $(SALHELPERLIB) $(CPPULIB) $(CPPUHELPERLIB) \
194 - $(UNODEVTOOLSLIBST) $(CODEMAKERLIBST) $(COMMONCPPLIBST) $(COMMONJAVALIBST)
195 +APP1STDLIBS =\
196 + $(UNODEVTOOLSLIBST) $(CODEMAKERLIBST) $(COMMONCPPLIBST) $(COMMONJAVALIBST)\
197 + $(REGLIB) $(CPPULIB) $(CPPUHELPERLIB) $(SALHELPERLIB) $(SALLIB)
199 OBJFILES = $(APP1OBJS)
201 diff --git svx/util/makefile.mk svx/util/makefile.mk
202 index 4598098..d5de0b6 100644
203 --- svx/util/makefile.mk
204 +++ svx/util/makefile.mk
205 @@ -172,7 +172,6 @@ SHL2STDLIBS= \
206 $(I18NISOLANGLIB) \
207 $(COMPHELPERLIB) \
208 $(UCBHELPERLIB) \
209 - $(CPPUHELPERLIB) \
210 $(CPPULIB) \
211 $(VOSLIB) \
212 $(SALLIB) \
213 @@ -181,6 +181,7 @@
214 .IF "$(GUI)"=="WNT"
215 SHL2STDLIBS+= \
216 $(SHLWAPILIB) \
217 + $(CPPUHELPERLIB) \
218 $(ADVAPI32LIB)
219 .ENDIF # WNT