Get rid of text relocations in -fPIE build
Fedora build system forces a PIE build with -fPIE indirectly via gcc spec /usr/lib/rpm/redhat/redhat-hardened-cc1. This does not work for assembly sources, so a PIC-aware assembly code won't be built as PIC (PIE implies PIC). rdrand_asm.S is PIC-aware in 32bit mode, so force PIC for it, fixing the following build warning: /usr/bin/ld: rdrand_asm.o: warning: relocation in read-only section `.text' /usr/bin/ld: warning: creating DT_TEXTREL in a PIE
This commit is contained in:
parent
6aa90701c6
commit
805e2b6172
@ -63,6 +63,12 @@ TPM, jitter) and supplies entropy from them to a kernel entropy pool.
|
||||
%endif
|
||||
|
||||
./autogen.sh
|
||||
# a dirty hack to force PIC for a PIC-aware assembly code for i686
|
||||
# /usr/lib/rpm/redhat/redhat-hardened-cc1 in Koji/Brew does not
|
||||
# force PIC for assembly sources as of now
|
||||
%ifarch i386 i686
|
||||
sed -i -e '/^#define RDRAND_RETRY_LIMIT\t10/a#define __PIC__ 1' rdrand_asm.S
|
||||
%endif
|
||||
# a dirty hack so libdarn_impl_a_CFLAGS overrides common CFLAGS
|
||||
sed -i -e 's/$(libdarn_impl_a_CFLAGS) $(CFLAGS)/$(CFLAGS) $(libdarn_impl_a_CFLAGS)/' Makefile.in
|
||||
%configure %{?_without_pkcs11} %{?_without_rtlsdr}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user