Draft: Fix binutils breakage

The binutils package in Rawhide has stricter checks about PIE/PIC code and will start reporting errors if it detects mixing and matching no-PIE with PIE binaries (especially around bpf binaries).

Example errors look like:

/usr/bin/ld: /tmp/ccL7dkfR.o: relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE /usr/bin/ld: failed to set dynamic section sizes: bad value collect2: error: ld returned 1 exit status

Fix this by adding more CFLAGS to force PIE/PIC generated binaries to bpf releated selftests, tools and samples.

This patch was provided by Carlos O'Donell and understands how it works. I am just the middle man.

All -fPIE errors are resolved except for one about libbpf.a. The static version of the library doesn't take CFLAGS so it can't be forced to build with PIE/PIC. This error is ignored by the spec file, so it is ignored by this patch too.

Signed-off-by: Don Zickus dzickus@redhat.com

Merge request reports

Loading
Loading