Looks like ld build fails when source tree is configured with --enable-warn-execstack make[4]: Entering directory '/home/tkloczko/rpmbuild/BUILD/binutils-2.41/ld' /usr/bin/gcc -DHAVE_CONFIG_H -I. -I. -I. -I../bfd -I./../bfd -I./../include -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -DLOCALEDIR="\"/usr/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -DELF_LIST_OPTIONS=true -DELF_SHLIB_LIST_OPTIONS=true -DELF_PLT_UNWIND_LIST_OPTIONS=true -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -c -o eelf_x86_64.o eelf_x86_64.c eelf_x86_64.c: In function ‘gldelf_x86_64_before_parse’: eelf_x86_64.c:91:31: error: ‘DEFAULT_LD_ERROR_EXECSTACK’ undeclared (first use in this function); did you mean ‘DEFAULT_LD_WARN_EXECSTACK’? 91 | link_info.error_execstack = DEFAULT_LD_ERROR_EXECSTACK; | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | DEFAULT_LD_WARN_EXECSTACK eelf_x86_64.c:91:31: note: each undeclared identifier is reported only once for each function it appears in eelf_x86_64.c:92:46: error: ‘DEFAULT_LD_ERROR_RWX_SEGMENTS’ undeclared (first use in this function); did you mean ‘DEFAULT_LD_WARN_RWX_SEGMENTS’? 92 | link_info.warn_is_error_for_rwx_segments = DEFAULT_LD_ERROR_RWX_SEGMENTS; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | DEFAULT_LD_WARN_RWX_SEGMENTS make[4]: *** [Makefile:1599: eelf_x86_64.o] Error 1
Looks like DEFAULT_LD_ERROR_EXECSTACK is defined only when --disable-error-rwx-segments is used. [tkloczko@pers-jacek ld]$ grep -r DEFAULT_LD_ERROR_EXECSTACK emultempl/elf.em: link_info.error_execstack = DEFAULT_LD_ERROR_EXECSTACK; config.in:#undef DEFAULT_LD_ERROR_EXECSTACK configure.ac:AC_DEFINE_UNQUOTED(DEFAULT_LD_ERROR_EXECSTACK, config.h:/* #undef DEFAULT_LD_ERROR_EXECSTACK */ eelf_iamcu.c: link_info.error_execstack = DEFAULT_LD_ERROR_EXECSTACK; eelf_i386.c: link_info.error_execstack = DEFAULT_LD_ERROR_EXECSTACK; eelf32_x86_64.c: link_info.error_execstack = DEFAULT_LD_ERROR_EXECSTACK; eelf_x86_64.c: link_info.error_execstack = DEFAULT_LD_ERROR_EXECSTACK;
Correction when --enaable-warn-execstack
Hi Kloczek, Sorry - I am unable to reproduce this problem. Can you show the entire configure command line that you used ? Cheers Nick