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.
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.
Filed upstream feature request as https://sourceware.org/PR27837
Filed as a PR on Github, if that works for you.
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(+)
Looks great! I added a few bug links into comment itself and copied fix to -9999.
Cheers! I hope it actually works ;)