Skip to content

Commit

Permalink
re-lifting from gts
Browse files Browse the repository at this point in the history
  • Loading branch information
ailrst committed Jun 4, 2024
1 parent 0588bfe commit aedc724
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/test/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
TARGETSS := all verify clean cleanall cleanlift recompile json cleanjson cleangts gts
TARGETSS := all verify clean cleanall cleanlift recompile json cleanjson cleangts gts reliftgts

SUBTARGETS = $(wildcard correct/*/ incorrect/*/ correct_analyse/*/)
.PHONY : $(TARGETSS) $(SUBTARGETS) correct incorrect

$(TARGETSS): $(SUBTARGETS)

correct: $(realpath $(wildcard correct/*))
correct: $(realpath $(wildcard correct/*)) $(realpath $(wildcard correct_analyse/*))
incorrect: $(realpath $(wildcard incorrect/*))

$(SUBTARGETS):
Expand Down
3 changes: 2 additions & 1 deletion src/test/make/lift-directories.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ GIT_ROOT?=$(realpath ../../../../)

GCC ?= aarch64-linux-gnu-gcc
CLANG ?= clang-15 -target $(TARGET)
GTIRB_SEMANTICS ?= gtirb_semantics
CC ?= $(GCC)
#CFLAGS=-fno-pic -fno-plt
TARGET=aarch64-linux-gnu
Expand All @@ -29,7 +30,7 @@ LIFT_ARTEFACTS=$(NAME).adt $(NAME).bir $(NAME).relf $(NAME).gts

ENABLED_COMPILERS ?= clang clang_O2 clang_pic clang_no_plt_no_pic gcc gcc_O2 gcc_no_plt_no_pic gcc_pic

TARGETS := all verify clean cleanall cleanlift cleanjson cleangts cleantest recompile json gts
TARGETS := all verify clean cleanall cleanlift cleanjson cleangts cleantest recompile json gts reliftgts
.PHONY : $(TARGETS) $(ENABLED_COMPILERS)

$(TARGETS): $(ENABLED_COMPILERS)
Expand Down
11 changes: 7 additions & 4 deletions src/test/make/lift.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $(LIFT_ARTEFACTS): a.out
$(READELF) -s -r -W a.out > $(NAME).relf
$(BAP) a.out -d adt:$(NAME).adt -d bir:$(NAME).bir
ddisasm a.out --ir $(NAME).gtirb
gtirb-semantics $(NAME).gtirb $(NAME).gts
$(GTIRB_SEMANTICS) $(NAME).gtirb $(NAME).gts

ifdef $(SPEC)
BASIL_SPECARG = --spec $(SPEC)
Expand All @@ -27,15 +27,18 @@ $(BASIL):
a.out: $(C_SOURCE)
$(CC) $(CFLAGS) $(C_SOURCE)

.PHONY=recompile verify clean cleanlift cleanall cleanbin cleantest cleangts json gts
.PHONY=recompile verify clean cleanlift cleanall cleanbin cleantest cleangts json gts reliftgts
verify: $(NAME)_bap.bpl $(NAME)_gtirb.bpl

recompile: a.out

reliftgts:
$(GTIRB_SEMANTICS) $(NAME).gts $(NAME)-2.gts
mv $(NAME)-2.gts $(NAME).gts

gts: a.out
ddisasm a.out --ir $(NAME).gtirb
gtirb-semantics $(NAME).gtirb $(NAME).gts
rm -rf $(NAME).gtirb

json:
debug-gts.py $(NAME).gts > $(NAME).json
Expand Down Expand Up @@ -72,4 +75,4 @@ cleanlift:
rm -rf $(NAME).gts

cleangts:
rm -rf $(NAME).gts
rm -rf $(NAME).gts

0 comments on commit aedc724

Please sign in to comment.