mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-28 12:36:47 +00:00
Introduce an opt-in mode for building and running compel tests
with Guarded Control Stack (GCS) enabled on AArch64.
Changes:
- Extend compel/test/infect to support `GCS_ENABLE=1` builds,
adding `-mbranch-protection=standard` and
`-z experimental-gcs=check` to CFLAGS/LDFLAGS.
- Export required GLIBC_TUNABLES at runtime via `TEST_ENV`.
Usage:
make -C compel/test/infect GCS_ENABLE=1
make -C compel/test/infect GCS_ENABLE=1 run
By default (`GCS_ENABLE` unset or 0), builds and runs are unchanged.
Signed-off-by: Igor Svilenkov Bozic <svilenkov@gmail.com>
37 lines
727 B
Makefile
37 lines
727 B
Makefile
CC := gcc
|
|
CFLAGS ?= -O2 -g -Wall -Werror
|
|
|
|
COMPEL := ../../../compel/compel-host
|
|
|
|
ifeq ($(GCS_ENABLE),1)
|
|
CFLAGS += -mbranch-protection=standard -DGCS_TEST_ENABLE=1
|
|
LDFLAGS += -z experimental-gcs=check
|
|
endif
|
|
|
|
all: victim spy
|
|
|
|
run:
|
|
./spy
|
|
.PHONY: run
|
|
|
|
clean:
|
|
rm -f victim
|
|
rm -f spy
|
|
rm -f parasite.h
|
|
rm -f parasite.po
|
|
rm -f parasite.o
|
|
|
|
victim: victim.c
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
|
|
|
spy: spy.c parasite.h
|
|
$(CC) $(CFLAGS) $(shell $(COMPEL) includes) -o $@ $< $(shell $(COMPEL) --static libs)
|
|
|
|
parasite.h: parasite.po
|
|
$(COMPEL) hgen -o $@ -f $<
|
|
|
|
parasite.po: parasite.o
|
|
ld $(shell $(COMPEL) ldflags) -o $@ $^ $(shell $(COMPEL) plugins)
|
|
|
|
parasite.o: parasite.c
|
|
$(CC) $(CFLAGS) -c $(shell $(COMPEL) cflags) -o $@ $^
|