Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 788901 - sys-libs/glibc: Should filter -Wl,--relax from LDFLAGS
Summary: sys-libs/glibc: Should filter -Wl,--relax from LDFLAGS
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Gentoo Toolchain Maintainers
URL: https://github.com/gentoo/gentoo/pull...
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-05-08 13:21 UTC by Petr Šabata
Modified: 2021-05-10 12:28 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Šabata 2021-05-08 13:21:46 UTC
The build aborts pretty early if -Wl,--relax is present in LDFLAGS as ld complains about combining --relax with -r.

It appears that filtering --relax from LDFLAGS would be a sane thing to do, e.g. with:

filter-ldflags '-Wl,--relax'

Confirmed with =sys-libs/glibc-2.33 at least.

Reproducible: Always

Steps to Reproduce:
1. Add -Wl,--relax to your LDFLAGS.
2. Attempt to build sys-libs/glibc.
Actual Results:  
Build fails early with ld complaining about the -r & --relax combination.

Expected Results:  
Build passes.

The --relax filter flag appears to be otherwise safe to use system-wide, at least on amd64.  Hence I would suggest handling this in the glibc ebuild; it filters several other flags already.
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2021-05-09 21:56:31 UTC
That sounds reasonable. I wonder if it would be reasonable for binutils to ignore --relax for -r mode. That comes up time to time in other settings as well.

Do you want to write a patch in `git format-patch` format? I'd apply it with `git am` as is.
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2021-05-09 22:13:29 UTC
Filed upstream feature request as https://sourceware.org/PR27837
Comment 3 Petr Šabata 2021-05-10 06:46:35 UTC
Filed as a PR on Github, if that works for you.
Comment 4 Larry the Git Cow gentoo-dev 2021-05-10 07:22:51 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=605800519081b08274479cd00dd16a7622e710e5

commit 605800519081b08274479cd00dd16a7622e710e5
Author:     Petr Šabata <contyk@redhat.com>
AuthorDate: 2021-05-10 06:44:17 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2021-05-10 07:22:48 +0000

    sys-libs/glibc: Filter "-Wl,--relax" from LDFLAGS
    
    The build fails due to the -r & --relax combination passed to the
    linker, so let's filter this out.
    
    Closes: https://bugs.gentoo.org/788901
    Signed-off-by: Petr Šabata <contyk@redhat.com>
    Closes: https://github.com/gentoo/gentoo/pull/20748
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 sys-libs/glibc/glibc-2.33.ebuild | 4 ++++
 sys-libs/glibc/glibc-9999.ebuild | 4 ++++
 2 files changed, 8 insertions(+)
Comment 5 Sergei Trofimovich (RETIRED) gentoo-dev 2021-05-10 07:23:52 UTC
Looks great! I added a few bug links into comment itself and copied fix to -9999.
Comment 6 Petr Šabata 2021-05-10 12:28:57 UTC
Cheers!  I hope it actually works ;)