Skip to content

Commit

Permalink
Properly invalidate regtest cached artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
McSinyx committed Jan 14, 2025
1 parent 8289b1a commit 7a2210d
Showing 1 changed file with 31 additions and 29 deletions.
60 changes: 31 additions & 29 deletions test/regtest/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.PHONY: check clean-check

E9TOOL ?= ../../e9tool
E9COMPILE ?= ../../e9compile.sh

FCF_NONE := $(shell \
if gcc -fcf-protection=none --version 2>&1 | grep -q 'unrecognized'; \
then true; \
Expand All @@ -14,58 +17,57 @@ check: regtest $(EXE)
./$^

%.exe: in=$(shell head -1 $<)
%.exe: %.in $(BASE) $(TRAMPOLINE)
../../e9tool $(E9TOOL_OPTIONS) -M 'addr >= &"entry"' $(in)\
%.exe: %.in $(BASE) $(TRAMPOLINE) $(E9TOOL)
$(E9TOOL) $(E9TOOL_OPTIONS) -M 'addr >= &"entry"' $(in)\
-E data..data_END -E data2...text -E .text..begin -o $@

test:
gcc -x assembler-with-cpp -o test test.s -no-pie -nostdlib \
test: test.s
$(CC) -x assembler-with-cpp -o $@ $< -no-pie -nostdlib \
-Wl,--section-start=.text=0xa000000 -Wl,--section-start=.bss=0xc000000 \
-Wl,-z -Wl,max-page-size=4096 -DPIE=0

test.pie:
gcc -x assembler-with-cpp -o test.pie test.s -pie -nostdlib \
test.pie: test.s
$(CC) -x assembler-with-cpp -o $@ $< -pie -nostdlib \
-Wl,--section-start=.text=0xa000000 -Wl,--section-start=.bss=0xc000000 \
-Wl,-z -Wl,max-page-size=4096 -DPIE=1 \
-Wl,--export-dynamic

bugs:
gcc -x assembler-with-cpp -o bugs bugs.s -no-pie -nostdlib \
bugs: bugs.s
$(CC) -x assembler-with-cpp -o $@ $< -no-pie -nostdlib \
-Wl,--section-start=.text=0xa000000 -Wl,--section-start=.bss=0xc000000 \
-Wl,-z -Wl,max-page-size=4096 -DPIE=0

test.libc:
gcc -x assembler-with-cpp -o test.libc test_libc.s -pie -Wl,--export-dynamic
test.libc: test_libc.s
$(CC) -x assembler-with-cpp -pie $< -Wl,--export-dynamic -o $@

libtest.so:
gcc -x assembler-with-cpp -shared -o libtest.so libtest.s
libtest.so: libtest.s
$(CC) -x assembler-with-cpp $< -shared -o $@

test_c:
gcc -O2 -fPIC $(FCF_NONE) -pie -o test_c test_c.c \
test_c: test_c.c
$(CC) -O2 -fPIC $(FCF_NONE) -pie -o $@ $< \
-Wl,--export-dynamic -U_FORTIFY_SOURCE
strip test_c

test_c.debug:
gcc -O0 -g -fPIC -pie -o test_c.debug test_c.c
test_c.debug: test_c.c
$(CC) -O0 -g -fPIC -pie $< -o $@

inst:
../../e9compile.sh inst.c -I ../../examples/
inst: inst.c ../../examples/stdlib.c $(E9COMPILE)
$(E9COMPILE) $< -I../../examples

patch:
../../e9compile.sh patch.cpp -std=c++11 -I ../../examples/
patch: patch.cpp ../../examples/stdlib.c $(E9COMPILE)
$(E9COMPILE) $< -std=c++11 -I../../examples

dl:
NO_SIMD_CHECK=1 ../../e9compile.sh dl.c -I ../../examples/
dl: dl.c ../../examples/stdlib.c $(E9COMPILE)
NO_SIMD_CHECK=1 $(E9COMPILE) $< -I../../examples

init:
../../e9compile.sh init.c -I ../../examples/
init: init.c ../../examples/stdlib.c $(E9COMPILE)
$(E9COMPILE) $< -I../../examples

fini:
../../e9compile.sh fini.c -I ../../examples/
fini: fini.c ../../examples/stdlib.c $(E9COMPILE)
$(E9COMPILE) $< -I../../examples

example.so:
g++ -std=c++11 -fPIC -shared -o example.so -O2 \
../../examples/plugins/example.cpp -I ../../src/e9tool/
example.so: ../../examples/plugins/example.cpp ../../src/e9tool/e9plugin.h
$(CXX) -std=c++11 -O2 -fPIC -I../../src/e9tool $< -shared -o $@

clean-check:
rm -f $(BASE) $(TRAMPOLINE) $(EXE)
Expand Down

0 comments on commit 7a2210d

Please sign in to comment.