You are not logged in.

#1 2010-11-04 15:48:00

imrehg
Member
From: London, UK
Registered: 2008-04-10
Posts: 108
Website

makepkg adds --as-needed in linking step and that breaks my package?

Hi,
I maintain a PKGBUILD that produced some strange behaviour. If I manually do the steps as written in the PKGBUILD, everything works fine. On the other hand, when I run it with makepkg, the linking step fails, complaining about a lot of "undefined reference"...

I tried to narrow it down, and found that Arch adds the "-Wl,--hash-style=gnu -Wl,--as-needed" flag in the linking step, and the second part is what caused the problem. If I re-run the linking step manually, but removing the "-Wl,--as-needed", it all works. If I instead in the PKGBUILD do a

make LDFLAGS=""

then everything goes dandy too...

Out of curiosity, why would this happen? How can --as--needed break things?

Offline

#2 2010-11-04 16:01:45

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: makepkg adds --as-needed in linking step and that breaks my package?

is happening because is a bug in their building,especially at the end where the linking is done.
usually when we have a package that fails we report it upstream and until is fixed we add in PKGBUILD:

export LDFLAGS="${LDFLAGS//-Wl,--as-needed}"

Give what you have. To someone, it may be better than you dare to think.

Offline

#3 2010-11-04 16:06:27

imrehg
Member
From: London, UK
Registered: 2008-04-10
Posts: 108
Website

Re: makepkg adds --as-needed in linking step and that breaks my package?

Thanks!
What kind of bug is expected in this situation? I've found that e.g. Gentoo has a big bunch of collected bug reports, but can't see a patter yet.

There were a few little oddities about the building anyway, I think I'll just just report upstream and see what happens...

Offline

Board footer

Powered by FluxBB