You are not logged in.

#1 2005-05-19 16:32:24

nightfrost
Member
From: Sweden
Registered: 2005-04-16
Posts: 647

LDFLAGS in /etc/makepkg.conf

Will adding

export LDFLAGS="-Wl,-O1 -Wl,--sort-common -s

to /etc/makepkg.conf, enable compilation with those flags when makepkg is executed?

Offline

#2 2005-05-19 19:32:58

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: LDFLAGS in /etc/makepkg.conf

-s? That might not be wise.

Offline

#3 2005-05-19 19:44:54

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: LDFLAGS in /etc/makepkg.conf

nightfrost wrote:

Will adding

export LDFLAGS="-Wl,-O1 -Wl,--sort-common -s

to /etc/makepkg.conf, enable compilation with those flags when makepkg is executed?

not all the time... it will in most though...
however, some Makefiles don't pickup external CFLAGS/LDFLAGS, so you will see some sed usage to insert the CFLAGS... you'd have to do the same for LDFLAGS there too...

I'd also add the --as-needed flag to those if you're recompiling something like KDE/gnome

Offline

#4 2005-05-19 20:08:55

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: LDFLAGS in /etc/makepkg.conf

The --as-needed flag should be default for all apps, though it has a bigger impact on the bigger bloated apps with buggy buildsystems.

Offline

#5 2005-05-20 11:30:08

nightfrost
Member
From: Sweden
Registered: 2005-04-16
Posts: 647

Re: LDFLAGS in /etc/makepkg.conf

Thanks for the replies. I don't fully understand every LDFLAG-option, but I've heard that prelink (which I used to run) should be avoided and LDFLAGS used instead. These particular flags were posted somewhere and claimed to be conservative and safe. You guys seem to disagree, no? I'm not interested in a flaky system, but I want some LDFLAGS-optimizations that are.. well... safe smile

What's your take on prelink vs. LDFLAGS?

Offline

#6 2005-05-20 14:16:42

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: LDFLAGS in /etc/makepkg.conf

Use something like -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -s and avoid prelink. -s just strips the library, which is done one way or the other anyway. No one is disagreeing, with ld flags instead of prelink here I hope, it's just that not every makefile/buildsystem honours the LDFLAGS environment variable.

Offline

#7 2005-05-20 15:06:20

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: LDFLAGS in /etc/makepkg.conf

i3839 wrote:

Use something like -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -s and avoid prelink. -s just strips the library, which is done one way or the other anyway. No one is disagreeing, with ld flags instead of prelink here I hope, it's just that not every makefile/buildsystem honours the LDFLAGS environment variable.

I have no clue what --sort-common does (but I can speculate)... -O1 is for link optimization, and --as-needed is for ELF header shared library listings/loading...

Offline

#8 2005-05-20 16:32:11

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: LDFLAGS in /etc/makepkg.conf

me neither, but I copied his and added the more important --as-needed. It won't hurt I guess.

Offline

#9 2005-05-20 18:56:36

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: LDFLAGS in /etc/makepkg.conf

it appears the original LDFLAGS are taken from here:
http://forums.gentoo.org/viewtopic.php?t=67777

check there for what they do...

Offline

#10 2005-05-22 16:12:32

nightfrost
Member
From: Sweden
Registered: 2005-04-16
Posts: 647

Re: LDFLAGS in /etc/makepkg.conf

Thanks alot for your replies smile

Phrakture, the thread you linked to looks familiar. That is most probably where I got the LDFLAGS from.

Offline

Board footer

Powered by FluxBB