Bug 215266

Summary: Please use -Wl,--as-needed -Wl,-z,defs linker flags
Product: [Developer tools] buildsystem Reporter: Adrian von Bidder <avbidder+kde>
Component: KDE4 (cmake)Assignee: Alexander Neundorf <neundorf>
Status: REPORTED ---    
Severity: wishlist CC: webkit-devel
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Adrian von Bidder 2009-11-19 12:17:28 UTC
Version:            (using Devel)
Compiler:          GNU tool chain 
OS:                Linux
Installed from:    Compiled sources

Heyho!

As discussed a long time ago:

-Wl,--as-needed -Wl,-z,defs should be used to compile and link (almost) all applications.

This makes the dependency lists of distribution packages much smaller, allowing for easier upgrades of libraries (I know this for a fact for the Debian unstable -> testing cycle, but probably other distributions face similar problems.)

I'm currently using these flags for the Debian package, but I think they could as well be used by default instead of in a Debian specific addition.

(... is there a bugzilla category for the KDE default build system as a whole?  I *think* that the flags might as well be used by default on any ELF based platform where the GNU toolchain is used.)
Comment 1 Urs Wolfer 2009-11-21 15:25:42 UTC
This is something the buildsystem team needs to decide about.
Comment 2 Justin Zobel 2021-03-09 05:27:10 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.