Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include CFLAGS from configure in build of
numademo
Otherwise, building with hardened settings fails with: /usr/bin/ld: numademo-numademo.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIE /usr/bin/ld: numademo-stream_lib.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE /usr/bin/ld: numademo-mt.o: relocation R_X86_64_32 against symbol `mt_buffer' can not be used when making a PIE object; recompile with -fPIE /usr/bin/ld: numademo-clearcache.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIE collect2: error: ld returned 1 exit status make[1]: *** [Makefile:906: numademo] Error 1 The linker still gets LDFLAGS with -specs=/usr/lib/rpm/redhat/redhat-hardened-ld but the CFLAGS with -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 get clobbered by this custom setting. Let's append `$(AM_CFLAGS)` to the beginning of the list, so these are always preserved when passed. Tested with: $ ./configure \ CFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' \ LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'
- Loading branch information