Makefile: Move `--no-warn-rwx-segments' into xcompile

The parameter is not available for binutils older than 2.39. So move it
to xcompile to provide backwards compatibility for a bit.

Change-Id: I02982769ae2c356f037a747e85d155368bfcb730
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/83693
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
This commit is contained in:
Nico Huber 2024-07-30 12:06:38 +02:00
parent 490e7c3f92
commit 6b8c40a95a
2 changed files with 6 additions and 3 deletions

View File

@ -604,9 +604,6 @@ LDFLAGS_common += -nostdlib
LDFLAGS_common += --nmagic LDFLAGS_common += --nmagic
LDFLAGS_common += -static LDFLAGS_common += -static
LDFLAGS_common += -z noexecstack LDFLAGS_common += -z noexecstack
# Disable warning on segments with RWX.
# All loadable sections are placed in the same segment for simplicity.
LDFLAGS_common += --no-warn-rwx-segments
# Workaround for RISC-V linker bug, merge back into above line when fixed. # Workaround for RISC-V linker bug, merge back into above line when fixed.
# https://sourceware.org/bugzilla/show_bug.cgi?id=27180 # https://sourceware.org/bugzilla/show_bug.cgi?id=27180

View File

@ -241,6 +241,12 @@ detect_special_flags() {
testcc "$GCC" "$CFLAGS_GCC -Wextra" && testcc "$GCC" "$CFLAGS_GCC -Wextra" &&
CFLAGS_GCC="$CFLAGS_GCC -Wextra" CFLAGS_GCC="$CFLAGS_GCC -Wextra"
# Disable warning on segments with RWX.
# All loadable sections are placed in the same segment for simplicity.
testld "$GCC" "$FLAGS_GCC" "${GCCPREFIX}ld${LINKER_SUFFIX}" \
"$LDFLAGS --no-warn-rwx-segments" && \
LDFLAGS="$LDFLAGS --no-warn-rwx-segments"
case "$architecture" in case "$architecture" in
x86) x86)
;; ;;