Configure binutils with --enable-default-execstack=no.

The stack has never been executable, however ld thinks that it might be
since object files like crtn.o don't bother with the .note.GNU-stack
section. Instead simply explicitly opt into the future. This setting
should be per-target in the binutils code, but there is no such knob in
the ld emulparams at this time.
This commit is contained in:
Jonas 'Sortie' Termansen 2024-10-01 15:31:53 +02:00
parent f7f3f1205d
commit 88cc5b4cb7
2 changed files with 3 additions and 2 deletions
Makefile
ports/binutils

View file

@ -148,7 +148,8 @@ install-cross-compiler:
--target="$(TARGET)" \
--prefix="$(PREFIX)" \
$(CROSS_COMPILER_WITH_SYSROOT) \
--disable-werror
--disable-werror \
--enable-default-execstack=no
V=1 $(MAKE) -C ports/binutils/binutils.build
V=1 $(MAKE) -C ports/binutils/binutils.build install
rm -rf ports/gcc/gcc.build

View file

@ -12,7 +12,7 @@ BUILD_SYSTEM=configure
CONFIGURE_WITH_SYSROOT=true
CONFIGURE_WITH_SYSROOT_LD_BUG=true
CONFIGURE_WITH_BUILD_SYSROOT=true
CONFIGURE_ARGS=--disable-werror
CONFIGURE_ARGS='--disable-werror --enable-default-execstack=no'
CONFIGURE_USE_BUILD_DIRECTORY=true
MAKE_ARGS='tooldir="$(EXEC_PREFIX)"'
MAKE_VARS='V=1'