|
|
|
@ -1,3 +1,5 @@
|
|
|
|
|
|
|
|
ZIGCC = zig cc
|
|
|
|
|
|
|
|
|
|
|
|
CC = gcc
|
|
|
|
CC = gcc
|
|
|
|
DEBUG = 1
|
|
|
|
DEBUG = 1
|
|
|
|
CFLAGS += -Wall
|
|
|
|
CFLAGS += -Wall
|
|
|
|
@ -29,7 +31,8 @@ CFLAGS += -O1
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
PWD=$(shell pwd)
|
|
|
|
PWD=$(shell pwd)
|
|
|
|
GLIBC=/glibc_versions/2.29/tcache_x64
|
|
|
|
# Apparently we don't have this version? :(
|
|
|
|
|
|
|
|
#GLIBC=/glibc_versions/2.29/tcache_x64
|
|
|
|
GLIBC_2_33=$(PWD)/glibcs/2.33
|
|
|
|
GLIBC_2_33=$(PWD)/glibcs/2.33
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY : all clean
|
|
|
|
.PHONY : all clean
|
|
|
|
@ -59,27 +62,32 @@ all: $(LINKED) $(LINKED_ASM) $(COMPILED_GO)
|
|
|
|
@GOARCH=amd64 $(GO) build $?
|
|
|
|
@GOARCH=amd64 $(GO) build $?
|
|
|
|
@# Not stripped on purpose
|
|
|
|
@# Not stripped on purpose
|
|
|
|
|
|
|
|
|
|
|
|
heap_bugs: heap_bugs.c
|
|
|
|
heap_bugs.out: heap_bugs.c
|
|
|
|
${CC} \
|
|
|
|
@echo "[+] Building heap_bugs.out"
|
|
|
|
-Wl,-rpath=${GLIBC}:\
|
|
|
|
${ZIGCC} \
|
|
|
|
${GLIBC}/math:\
|
|
|
|
-target native-native-gnu.2.33 \
|
|
|
|
${GLIBC}/elf:\
|
|
|
|
-Wl,-rpath=${GLIBC_2_33}:\
|
|
|
|
${GLIBC}/dlfcn:\
|
|
|
|
${GLIBC_2_33}/math:\
|
|
|
|
${GLIBC}/nss:\
|
|
|
|
${GLIBC_2_33}/elf:\
|
|
|
|
${GLIBC}/nis:\
|
|
|
|
${GLIBC_2_33}/dlfcn:\
|
|
|
|
${GLIBC}/rt:\
|
|
|
|
${GLIBC_2_33}/nss:\
|
|
|
|
${GLIBC}/resolv:\
|
|
|
|
${GLIBC_2_33}/nis:\
|
|
|
|
${GLIBC}/crypt:\
|
|
|
|
${GLIBC_2_33}/rt:\
|
|
|
|
${GLIBC}/nptl_db:\
|
|
|
|
${GLIBC_2_33}/resolv:\
|
|
|
|
${GLIBC}/nptl:\
|
|
|
|
${GLIBC_2_33}/crypt:\
|
|
|
|
-Wl,--dynamic-linker=${GLIBC}/elf/ld.so \
|
|
|
|
${GLIBC_2_33}/nptl_db:\
|
|
|
|
|
|
|
|
${GLIBC_2_33}/nptl:\
|
|
|
|
|
|
|
|
-Wl,--dynamic-linker=${GLIBC_2_33}/ld-linux-x86-64.so.2 \
|
|
|
|
-g -o heap_bugs.out heap_bugs.c
|
|
|
|
-g -o heap_bugs.out heap_bugs.c
|
|
|
|
|
|
|
|
|
|
|
|
heap_bins: heap_bins.c
|
|
|
|
# TODO/FIXME: We should probably force this to 2.29? a version with tcache?
|
|
|
|
${CC} \
|
|
|
|
#heap_bins.out: heap_bins.c
|
|
|
|
-Wl,-rpath=${GLIBC_2_33} \
|
|
|
|
# @echo "[+] Building heap_bins.out"
|
|
|
|
-Wl,--dynamic-linker=${GLIBC_2_33}/ld-linux-x86-64.so.2 \
|
|
|
|
# ${ZIGCC} \
|
|
|
|
-g -O0 -o heap_bins.out heap_bins.c
|
|
|
|
# -target native-native-gnu.2.33 \
|
|
|
|
|
|
|
|
# -Wl,-rpath=${GLIBC_2_33} \
|
|
|
|
|
|
|
|
# -Wl,--dynamic-linker=${GLIBC_2_33}/ld-linux-x86-64.so.2 \
|
|
|
|
|
|
|
|
# -g -O0 -o heap_bins.out heap_bins.c
|
|
|
|
|
|
|
|
|
|
|
|
# Note: we use -pthread -lpthread because we hit this bug on CI builds:
|
|
|
|
# Note: we use -pthread -lpthread because we hit this bug on CI builds:
|
|
|
|
# https://sourceware.org/bugzilla/show_bug.cgi?id=24548
|
|
|
|
# https://sourceware.org/bugzilla/show_bug.cgi?id=24548
|
|
|
|
|