qemu/tests/tcg/arm/Makefile.softmmu-target
Richard Henderson 6c180490b0 tests/tcg: Use --noexecstack with assembler files
Add the --noexecstack assembler command-line option to avoid:

  /usr/bin/ld: warning: boot.o: missing .note.GNU-stack section implies executable stack
  /usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker

which is enabled by default with current debian cross toolchains.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20240724010733.22129-2-richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240729144414.830369-4-alex.bennee@linaro.org>
2024-07-30 11:44:11 +01:00

81 lines
2.5 KiB
Makefile

# -*- Mode: makefile -*-
#
# ARM SoftMMU tests - included from tests/tcg/Makefile
#
ARM_SRC=$(SRC_PATH)/tests/tcg/arm/system
# Set search path for all sources
VPATH += $(ARM_SRC)
# Specific Test Rules
test-armv6m-undef: test-armv6m-undef.S
$(CC) -mcpu=cortex-m0 -mfloat-abi=soft \
-Wl,--build-id=none -x assembler-with-cpp \
$< -o $@ -nostdlib -static \
-T $(ARM_SRC)/$@.ld
run-test-armv6m-undef: QEMU_OPTS=-semihosting-config enable=on,target=native,chardev=output -M microbit -kernel
ARM_TESTS+=test-armv6m-undef
# These objects provide the basic boot code and helper functions for all tests
CRT_OBJS=boot.o
ARM_TEST_SRCS=$(wildcard $(ARM_SRC)/*.c)
ARM_TESTS+=$(patsubst $(ARM_SRC)/%.c, %, $(ARM_TEST_SRCS))
CRT_PATH=$(ARM_SRC)
LINK_SCRIPT=$(ARM_SRC)/kernel.ld
LDFLAGS=-Wl,-T$(LINK_SCRIPT)
CFLAGS+=-nostdlib -ggdb -O0 $(MINILIB_INC)
LDFLAGS+=-static -nostdlib $(CRT_OBJS) $(MINILIB_OBJS) -lgcc
# building head blobs
.PRECIOUS: $(CRT_OBJS)
%.o: $(ARM_SRC)/%.S
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -x assembler-with-cpp -Wa,--noexecstack -c $< -o $@
# Build and link the tests
%: %.c $(LINK_SCRIPT) $(CRT_OBJS) $(MINILIB_OBJS)
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
memory: CFLAGS+=-DCHECK_UNALIGNED=0
# Running
QEMU_BASE_MACHINE=-M virt -cpu max -display none
QEMU_OPTS+=$(QEMU_BASE_MACHINE) -semihosting-config enable=on,target=native,chardev=output -kernel
# console test is manual only
QEMU_SEMIHOST=-serial none -chardev stdio,mux=on,id=stdio0 -semihosting-config enable=on,chardev=stdio0 -mon chardev=stdio0,mode=readline
run-semiconsole: QEMU_OPTS=$(QEMU_BASE_MACHINE) $(QEMU_SEMIHOST) -kernel
run-semiconsole: semiconsole
$(call skip-test, $<, "MANUAL ONLY")
$(if $(V),@printf " %-7s %s %s\n" "TO RUN" $(notdir $(QEMU)) "$(QEMU_OPTS) $<")
run-plugin-semiconsole-with-%: semiconsole
$(call skip-test, $<, "MANUAL ONLY")
# Simple Record/Replay Test
.PHONY: memory-record
run-memory-record: memory-record memory
$(call run-test, $<, \
$(QEMU) -monitor none -display none \
-chardev file$(COMMA)path=$<.out$(COMMA)id=output \
-icount shift=5$(COMMA)rr=record$(COMMA)rrfile=record.bin \
$(QEMU_OPTS) memory)
.PHONY: memory-replay
run-memory-replay: memory-replay run-memory-record
$(call run-test, $<, \
$(QEMU) -monitor none -display none \
-chardev file$(COMMA)path=$<.out$(COMMA)id=output \
-icount shift=5$(COMMA)rr=replay$(COMMA)rrfile=record.bin \
$(QEMU_OPTS) memory)
EXTRA_RUNS+=run-memory-replay
TESTS += $(ARM_TESTS) $(MULTIARCH_TESTS)
EXTRA_RUNS+=$(MULTIARCH_RUNS)