https://sourceware.org/bugzilla/show_bug.cgi?id=27837
Bug ID: 27837 Summary: Consider allowing mix of -r / --relax by ignoring --relax. Product: binutils Version: 2.36.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: slyfox at inbox dot ru Target Milestone: --- This is a forward of https://bugs.gentoo.org/788901 bug by Petr Ĺ abata. Petr uses LDFLAGS+=-Wl,--relax system-wide. glibc (and ghc) occasionally use `ld -r` for partial linking (and apply $LDFLAGS for it). binutils does not allow such a mix: $ touch a.c $ LANG=C h gcc -Wl,--relax -r a.c -o a /usr/lib/gcc/x86_64-pc-linux-gnu/12.0.0/../../../../x86_64-pc-linux-gnu/bin/ld: --relax and -r may not be used together collect2: error: ld returned 1 exit status Our options are to: 1. Filter out -Wl,--relax flag downstream and don't pass it to glibc 2. Tweak glibc to pass -Wl,--no-relax in `ld -r` contexts I wonder if binutils could ignore -Wl,--relax altogether for partial linking. Thank you! -- You are receiving this mail because: You are on the CC list for the bug.