Ticket #23 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

unable to compile epdfview with ldflag "-Wl, --as-needed"

Reported by: ryszardzonk Assigned to: jordi
Priority: minor Version: SVN
Keywords: compile/linking error Cc:

Description

ldflag "-Wl, --as-needed" is a fairly new binutils flag that alows for programs to be directly linked only agaist lilbraries that program directly depends on. Better explanation of the flag available here http://www.gentoo.org/proj/en/qa/asneeded.xml

Epdfview needs to be patched for that flag to function properly. My personal fix:

diff -Naur 1/Makefile.in 2/Makefile.in --- Makefile.in 2006-05-12 16:13:17.000000000 +0200 +++ Makefile.in 2006-05-13 10:38:31.000000000 +0200 @@ -143,7 +143,7 @@

INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@

-LDFLAGS = @LDFLAGS@ +LDFLAGS = @GLIB_LIBS@ @GTK2_LIBS@ @POPPLER_LIBS@ @LDFLAGS@

LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@

diff -Naur 1/src/Makefile.in 2/src/Makefile.in --- src/Makefile.in 2006-05-12 16:13:15.000000000 +0200 +++ src/Makefile.in 2006-05-13 10:39:58.000000000 +0200 @@ -166,7 +166,7 @@

INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@

-LDFLAGS = @LDFLAGS@ +LDFLAGS = @GLIB_LIBS@ @GTK2_LIBS@ @POPPLER_LIBS@ @LDFLAGS@

LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@

Attachments

epdfview-0.1.4_as-needed.patch (0.9 kB) - added by ryszardzonk on 05/13/06 08:09:23.
epdfview-0.1.4_as-needed.patch

Change History

05/13/06 08:09:23 changed by ryszardzonk

  • attachment epdfview-0.1.4_as-needed.patch added.

epdfview-0.1.4_as-needed.patch

05/13/06 09:36:32 changed by jordi

  • status changed from new to closed.
  • resolution set to fixed.

Thank you for the patch, but unfortunately I can't apply it because I'm not storing the Makefile.in files in SVN, they are created from Makefile.am.

Thank to the link you've provided, though, I could see what the problem was: I was using automake's LDFLAGS variable to tell which libraries to link to. This is incorrect and messed up the linking order. I'm using LDADD instead and that fixed the problem.

Thank you!