Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#18333 - [fltk] hardcoded ldflags cause linking to fail

Attached to Project: Arch Linux
Opened by Philipp (hollunder) - Monday, 15 February 2010, 01:42 GMT
Last edited by Pierre Schmitz (Pierre) - Saturday, 06 March 2010, 01:40 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Tobias Kieslich (tobias)
Pierre Schmitz (Pierre)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
I know a number of fltk applications that fail to link anything due to the new ldflags.

$ fltk-config --ldflags
-Wl,-rpath,/usr/lib -Wl,--hash-style=gnu -Wl,--as-needed -lfltk -lXft -lpthread -ldl -lm -lXext -lX11

I found no way to temporarily change those ldflags for fltk, and thus no way to work around the breakage in PKGBUILDS.
Information on the topic seems to be sparse, application developers usually don't know what the problem is and don't feel like spending a lot of time on it to accomodate a single distro.


Additional info:
* package version(s)
fltk 1.1.9-3

Steps to reproduce:
Try to build this for example:
http://aur.archlinux.org/packages.php?ID=22764
This task depends upon

Closed by  Pierre Schmitz (Pierre)
Saturday, 06 March 2010, 01:40 GMT
Reason for closing:  Fixed
Comment by Gerardo Exequiel Pozzi (djgera) - Monday, 15 February 2010, 01:50 GMT
Also assigned to the latest packager.
Comment by Pierre Schmitz (Pierre) - Monday, 15 February 2010, 06:58 GMT
You could add these to the PKGBUILD:

export LDFLAGS="${LDFLAGS//-Wl,--as-needed}"
export LDFLAGS="${LDFLAGS//,--as-needed}"
Comment by Allan McRae (Allan) - Monday, 15 February 2010, 08:57 GMT
Not quite... those flags are passed when using pkg-config. So they can not be adjusted in the PKGBUILD.

On the otherhand, many other distros use this LDFLAG and the problems is causes and their solutions are well know so fixes should be easy to find (despite the reporters assertion).
Comment by Philipp (hollunder) - Monday, 15 February 2010, 13:08 GMT
Apparently fltk is not using pkg-config but fltk-config instead, and I haven't found a way to change the flags in fltk-config. The fltk-config script stores them in itself, at /usr/bin/fltk-config and doesn't provide a way to change them.
I have removed the LDFLAGS line in makepkg.conf, the flags in fltk-config remain and remain to get passed on.

One other fltk application I use (yoshimi) compiles fine, it simply doesn't call fltk-config. Is this the solution you suggest Allan?
Comment by Philipp (hollunder) - Saturday, 20 February 2010, 13:56 GMT
export LDFLAGS="${LDFLAGS//-Wl,--as-needed}"
export LDFLAGS="${LDFLAGS//,--as-needed}"

definitely doesn't work.

I found this for example: http://www.gentoo.org/proj/en/qa/asneeded.xml
but I know nothing about linking, so I'll have to try to get every single upstream dev to change this for every single app.
Gentoo doesn't use --as-needed by default according to that page, not sure how true the claim is that many distros use it.
Comment by Philipp (hollunder) - Saturday, 20 February 2010, 22:07 GMT
Apparently 'fltk-config --ldflags' depend on how fltk was compiled.
I built it with the LDFLAGS line in makepkg.conf commented out and it showed:
-Wl,-rpath,/usr/lib -L/usr/lib64 -lfltk -lXft -lpthread -ldl -lm -lXext -lX11

And with this line active, as it probably was when the fltk package in extra was built:
-Wl,-rpath,/usr/lib -L/usr/lib64 -Wl,--hash-style=gnu -Wl,--as-needed -lfltk -lXft -lpthread -ldl -lm -lXext -lX11

So as I see it I could patch ever apps build system to make it work (if I knew how to do it) or suggest to every user to disable the line and rebuild fltk.
I tried to convince the author of non-sequencer, non-daw, non-mixer to fix this but he didn't like the idea.
Another app that fails to build because of this: tapiir
Comment by Pierre Schmitz (Pierre) - Saturday, 06 March 2010, 01:29 GMT
As this package seem to be virtually unmaintained I'll rebuild it without "--as-needed".

Loading...