mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
common.mak: use a minimal assembly snippet to check for linker flags
Use a minimal assembly snippet to check for linker flags. This has the advantage that it will work even if only the cross-toolchain is installed, but not, for example, stdlib. Using the C snippet, the check runs in a similar error like this: /usr/bin/s390x-linux-gnu-ld: cannot find crt1.o: No such file or directory /usr/bin/s390x-linux-gnu-ld: cannot find crti.o: No such file or directory /usr/bin/s390x-linux-gnu-ld: cannot find -lc: No such file or directory /usr/bin/s390x-linux-gnu-ld: cannot find crtn.o: No such file or directory Reviewed-by: Steffen Eiden <seiden@linux.ibm.com> Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
committed by
Steffen Eiden
parent
552772d2a9
commit
5dcac6d2e3
@@ -211,8 +211,8 @@ fi
|
||||
# Returns the linker option if available and nothing otherwise
|
||||
#
|
||||
define test_linker_flag
|
||||
$(shell printf "int main(void) {return 0;}\n" | \
|
||||
( $(CC) "-Wl,$1" -o /dev/null -x c - ) >/dev/null 2>&1 && printf -- '-Wl,%s' "$1")
|
||||
$(shell printf ".globl _start\n_start:\nnop\n" | \
|
||||
( $(CC) "-Wl,$1" -o /dev/null -nostdlib -x assembler -) >/dev/null 2>&1 && printf -- '-Wl,%s' "$1")
|
||||
endef
|
||||
|
||||
NO_WARN_RWX_SEGMENTS_LDFLAGS := $(call test_linker_flag,"--no-warn-rwx-segments")
|
||||
|
||||
Reference in New Issue
Block a user