Checking if a package respects LDFLAGS

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Checking if a package respects LDFLAGS

Keri Harris-2
Hi,

Is there a recommended method for testing if a package respects LDFLAGS?

Arch testers are encouraged to add -Wl,--hash-style=gnu to LDFLAGS
[1],[2] and portage uses scanelf to check for .hash sections. However it
appears that ld defaults to using a .gnu.hash section:

$ touch test.c
$ gcc -o libtest.so -shared test.c
$ scanelf -qyRF '#k%p' -k .hash libtest.so
$ scanelf -qyRF '#k%p' -k .gnu.hash libtest.so
libtest.so

Maybe I'm missing something obvious.


Thanks

Keri

[1] https://wiki.gentoo.org/wiki/Project:AMD64_Arch_Testers
[2] https://wiki.gentoo.org/wiki/Project:X86/Arch_Testers_FAQ

Reply | Threaded
Open this post in threaded view
|

Re: Checking if a package respects LDFLAGS

Andreas K. Huettel
Am Samstag, 30. September 2017, 19:03:59 CEST schrieb Keri Harris:
> Hi,
>
> Is there a recommended method for testing if a package respects LDFLAGS?
>
> Arch testers are encouraged to add -Wl,--hash-style=gnu to LDFLAGS
> [1],[2] and portage uses scanelf to check for .hash sections. However it
> appears that ld defaults to using a .gnu.hash section:

That test used to work, but it's broken now. We need a new one.

--
Andreas K. Hüttel
[hidden email]
Gentoo Linux developer (council, perl, libreoffice)

Reply | Threaded
Open this post in threaded view
|

Re: Checking if a package respects LDFLAGS

Robin H. Johnson-2
On Sat, Sep 30, 2017 at 08:05:50PM +0200, Andreas K. Huettel wrote:
> Am Samstag, 30. September 2017, 19:03:59 CEST schrieb Keri Harris:
> > Hi,
> >
> > Is there a recommended method for testing if a package respects LDFLAGS?
> >
> > Arch testers are encouraged to add -Wl,--hash-style=gnu to LDFLAGS
> > [1],[2] and portage uses scanelf to check for .hash sections. However it
> > appears that ld defaults to using a .gnu.hash section:
> That test used to work, but it's broken now. We need a new one.
How about something similar to Fedora's binary annotations work, or
injecting a .note.gentoo section into binaries (containing literal
C/CXX/LDFLAGS would be useful).

--
Robin Hugh Johnson
Gentoo Linux: Dev, Infra Lead, Foundation Asst. Treasurer
E-Mail   : [hidden email]
GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136

Reply | Threaded
Open this post in threaded view
|

Re: Checking if a package respects LDFLAGS

Michał Górny-5
W dniu sob, 30.09.2017 o godzinie 21∶49 +0000, użytkownik Robin H.
Johnson napisał:

> On Sat, Sep 30, 2017 at 08:05:50PM +0200, Andreas K. Huettel wrote:
> > Am Samstag, 30. September 2017, 19:03:59 CEST schrieb Keri Harris:
> > > Hi,
> > >
> > > Is there a recommended method for testing if a package respects LDFLAGS?
> > >
> > > Arch testers are encouraged to add -Wl,--hash-style=gnu to LDFLAGS
> > > [1],[2] and portage uses scanelf to check for .hash sections. However it
> > > appears that ld defaults to using a .gnu.hash section:
> >
> > That test used to work, but it's broken now. We need a new one.
>
> How about something similar to Fedora's binary annotations work, or
> injecting a .note.gentoo section into binaries (containing literal
> C/CXX/LDFLAGS would be useful).
>

Portage team is always happy to accept any patch for this.

--
Best regards,
Michał Górny


Reply | Threaded
Open this post in threaded view
|

Re: Checking if a package respects LDFLAGS

Sergei Trofimovich-6
On Sun, 01 Oct 2017 09:02:19 +0200
Michał Górny <[hidden email]> wrote:

> W dniu sob, 30.09.2017 o godzinie 21∶49 +0000, użytkownik Robin H.
> Johnson napisał:
> > On Sat, Sep 30, 2017 at 08:05:50PM +0200, Andreas K. Huettel wrote:  
> > > Am Samstag, 30. September 2017, 19:03:59 CEST schrieb Keri Harris:  
> > > > Hi,
> > > >
> > > > Is there a recommended method for testing if a package respects LDFLAGS?
> > > >
> > > > Arch testers are encouraged to add -Wl,--hash-style=gnu to LDFLAGS
> > > > [1],[2] and portage uses scanelf to check for .hash sections. However it
> > > > appears that ld defaults to using a .gnu.hash section:  
> > >
> > > That test used to work, but it's broken now. We need a new one.  
> >
> > How about something similar to Fedora's binary annotations work, or
> > injecting a .note.gentoo section into binaries (containing literal
> > C/CXX/LDFLAGS would be useful).
> >  
>
> Portage team is always happy to accept any patch for this.
Tracking bug: https://bugs.gentoo.org/455232

--

  Sergei

attachment0 (201 bytes) Download Attachment