Skip to content

Commit

Permalink
refurbish: more aarch32 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
langston-barrett committed Jun 8, 2020
1 parent 71a6d6e commit ddb2f44
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 1 deletion.
12 changes: 12 additions & 0 deletions refurbish/tests/binaries/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Tests should use this Docker container to compile the checked-in executables
# so that the builds can be reproduced.
#
# docker build -t sfe-tests . && docker run --rm -v "$PWD:/build" -w /build -it sfe-tests make vulnerable-indirect-call.noopt.stdlib.x86_64.exe
FROM ubuntu:18.04
RUN apt-get update && apt-get install -y \
binutils-multiarch \
gcc \
gcc-arm-linux-gnueabi \
make \
musl-tools && \
rm -rf /var/lib/apt/lists/*
11 changes: 10 additions & 1 deletion refurbish/tests/binaries/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
x86exe = $(patsubst %.c,%.nostdlib.x86_64.exe,$(wildcard *.c)) $(patsubst %.c,%.musl.x86_64.exe,$(wildcard *.c)) $(patsubst %.c,%.glibc.x86_64.exe,$(wildcard *.c))
# ppc32exe = $(patsubst %.c,%.nostdlib.ppc32.exe,$(wildcard *.c)) $(patsubst %.c,%.stdlib.ppc32.exe,$(wildcard *.c))
ppc64exe = $(patsubst %.c,%.nostdlib.ppc64.exe,$(wildcard *.c)) $(patsubst %.c,%.stdlib.ppc64.exe,$(wildcard *.c))
aarch32exe = $(patsubst %.c,%.noopt.nostdlib.aarch32.exe,$(wildcard *.c)) $(patsubst %.c,%.noopt.stdlib.aarch32.exe,$(wildcard *.c)) $(patsubst %.c,%.opt.nostdlib.aarch32.exe,$(wildcard *.c)) $(patsubst %.c,%.opt.stdlib.aarch32.exe,$(wildcard *.c))

all: $(x86exe) $(ppc64exe)
all: $(x86exe) $(ppc64exe) $(aarch32exe)

x86muslcc = musl-gcc
x86cc = gcc
ppc32cc = powerpc-linux-gnu-gcc
ppc64cc = powerpc64-linux-gnu-gcc
aarch32cc = arm-linux-gnueabi-gcc

CFLAGS = -static -fno-stack-protector
aarch32_cflags = -fno-pie -fno-pic

%.nostdlib.x86_64.exe: %.c
$(x86cc) -DNOSTDLIB -nostdlib $(CFLAGS) $< -o $@
Expand All @@ -31,6 +34,12 @@ CFLAGS = -static -fno-stack-protector
%.stdlib.ppc64.exe: %.c
$(ppc64cc) $(CFLAGS) $< -o $@

%.noopt.nostdlib.aarch32.exe: %.c util.h
$(aarch32cc) $(aarch32_cflags) -DNOSTDLIB -nostdlib $(CFLAGS) $< -o $@

%.noopt.stdlib.aarch32.exe: %.c util.h
$(aarch32cc) $(aarch32_cflags) $(CFLAGS) $< -o $@

clean:
rm -f *.exe

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit ddb2f44

Please sign in to comment.