diff options
author | Gergely Risko <gergely+context@risko.hu> | 2009-09-11 11:49:28 +0300 |
---|---|---|
committer | Gergely Risko <gergely+context@risko.hu> | 2009-09-11 11:49:28 +0300 |
commit | 30cc95d199327da2c539dfc90c337b3c5b9e8f53 (patch) | |
tree | 5e6c405ebb524140d949213147ab17d616c5cb5d | |
parent | 6bdcf91ddc348448d060d4ae680f4175cbca549d (diff) |
Libtool patch for supporting -Wl,--as-needed, which can be used in debian/rules to fixup overlinking.
-rwxr-xr-x | autogen.sh | 7 | ||||
-rwxr-xr-x | debian/rules | 4 | ||||
-rw-r--r-- | ltmain.sh.as-needed.patch | 31 |
3 files changed, 41 insertions, 1 deletions
@@ -6,6 +6,13 @@ autoreconf -i -f -v # Autoreconf overwrites INSTALL, but we have our own version of it. cp INSTALL.real INSTALL +# Libtool 2.2 still reorders LDFLAGS badly, and they won't fix it before libtool 2.3 or 2.4 +# but we can leave without this +if cat ltmain.sh.as-needed.patch | patch -t -p0 --dry-run +then + cat ltmain.sh.as-needed.patch | patch -t -p0 +fi + run_configure=true for arg in $*; do case $arg in diff --git a/debian/rules b/debian/rules index de9043d4..4bfbba6c 100755 --- a/debian/rules +++ b/debian/rules @@ -3,13 +3,15 @@ #export DH_VERBOSE=1 +LDFLAGS+=-Wl,--as-needed + Makefile: ./configure --prefix /usr --sysconfdir=/etc --disable-doc --disable-coverage \ build: build-stamp build-stamp: Makefile dh_testdir - $(MAKE) all + $(MAKE) LDFLAGS='$(LDFLAGS)' all touch build-stamp clean: Makefile diff --git a/ltmain.sh.as-needed.patch b/ltmain.sh.as-needed.patch new file mode 100644 index 00000000..c9c12b4f --- /dev/null +++ b/ltmain.sh.as-needed.patch @@ -0,0 +1,31 @@ +--- ltmain.sh 2009-09-11 11:29:46.000000000 +0300 ++++ ltmain.sh-good 2009-09-11 11:28:46.000000000 +0300 +@@ -4716,6 +4716,11 @@ + arg=$func_stripname_result + ;; + ++ -Wl,--as-needed) ++ deplibs="$deplibs $arg" ++ continue ++ ;; ++ + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result +@@ -5070,6 +5075,16 @@ + lib= + found=no + case $deplib in ++ -Wl,--as-needed) ++ if test "$linkmode,$pass" = "prog,link"; then ++ compile_deplibs="$deplib $compile_deplibs" ++ finalize_deplibs="$deplib $finalize_deplibs" ++ else ++ deplibs="$deplib $deplibs" ++ fi ++ continue ++ ;; ++ + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" |