Ticket #23 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

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

Reported by: ryszardzonk Owned by: 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 4 years ago.
epdfview-0.1.4_as-needed.patch

Change History

Changed 4 years ago by ryszardzonk

epdfview-0.1.4_as-needed.patch

Changed 4 years ago 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!

Add/Change #23 (unable to compile epdfview with ldflag "-Wl, --as-needed")

Author



Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.