bump: zig-0.13.0 -> zig-0.14.1 (#3166)

* bump: zig-0.13.0 -> zig-0.14.1

* fix

* fix musl without hard fload abi

* fix tests asm

* fix heap_bugs?

* libpthread.so.0 is required for glibc 2.33, see https://sourceware.org/pipermail/libc-alpha/2021-August/129718.html
pull/3169/head
patryk4815 5 months ago committed by GitHub
parent c24bf4046d
commit 33002925f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -63,7 +63,7 @@ in
curl
parallel
qemu
zig_0_13 # version match setup-dev.sh
zig # version match setup-dev.sh
go
# for onegadget command
@ -85,7 +85,7 @@ in
export PWNDBG_NO_AUTOUPDATE=1
export PWNDBG_NO_UV=1
export PWNDBG_VENV_PATH="${pyEnv}"
export ZIGPATH="${pkgs.lib.getBin pkgs.zig_0_13}/bin/"
export ZIGPATH="${pkgs.lib.getBin pkgs.zig}/bin/"
export REPO_ROOT=$(git rev-parse --show-toplevel)
'';
};

@ -94,9 +94,9 @@ download_zig_binary() {
# Install zig to current directory
# We use zig to compile some test binaries as it is much easier than with gcc
TARGET_ZIG_VERSION="0.13.0"
ZIG_TAR_URL="https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz"
ZIG_TAR_SHA256="d45312e61ebcc48032b77bc4cf7fd6915c11fa16e4aad116b66c9468211230ea"
TARGET_ZIG_VERSION="0.14.1"
ZIG_TAR_URL="https://ziglang.org/download/0.14.1/zig-x86_64-linux-0.14.1.tar.xz"
ZIG_TAR_SHA256="24aeeec8af16c381934a6cd7d95c807a8cb2cf7df9fa40d359aa884195c4716c"
if command -v "${ZIGPATH}"/zig &> /dev/null; then
ZIG_VERSION=$("$ZIGPATH/zig" version)
@ -124,7 +124,7 @@ download_zig_binary() {
# Delete previous installation
rm -rf "${ZIGPATH}"
mv /tmp/zig-linux-x86_64-* ${ZIGPATH} &> /dev/null || true
mv /tmp/zig-* ${ZIGPATH} &> /dev/null || true
echo "Zig installed to ${ZIGPATH}"
}
@ -302,7 +302,7 @@ configure_venv() {
if osx; then
echo "Not supported on macOS. Please use one of the alternative methods listed at:"
echo "https://github.com/pwndbg/pwndbg?tab=readme-ov-file#installing-gdb"
echo "https://pwndbg.re/pwndbg/dev/contributing/setup-pwndbg-dev/"
exit 1
fi

@ -122,7 +122,7 @@ PYTHON=''
if osx; then
echo "Not supported on macOS. Please use one of the alternative methods listed at:"
echo "https://github.com/pwndbg/pwndbg?tab=readme-ov-file#installing-gdb"
echo "https://pwndbg.re/pwndbg/dev/contributing/setup-pwndbg-dev/"
exit 1
fi

@ -69,7 +69,7 @@ heap_bugs.out: heap_bugs.c
${ZIGCC} \
${CFLAGS} \
-Wno-int-to-pointer-cast -Wno-int-conversion -Wno-unused-variable \
-target native-native-gnu.2.33 \
-target x86_64-linux-gnu.2.33 \
-Wl,-rpath=${GLIBC_2_33}:\
-Wl,--dynamic-linker=${GLIBC_2_33}/ld-linux-x86-64.so.2 \
-o heap_bugs.out heap_bugs.c
@ -78,7 +78,7 @@ heap_bugs.out: heap_bugs.c
#heap_bins.out: heap_bins.c
# @echo "[+] Building heap_bins.out"
# ${ZIGCC} \
# -target native-native-gnu.2.33 \
# -target x86_64-linux-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

@ -24,9 +24,9 @@ CFLAGS.aarch64 = $(ALL_FLAGS) --target=aarch64-linux-musl
CFLAGS.arm = $(ALL_FLAGS) --target=arm-linux-musleabihf
# CFLAGS.riscv32 = $(ALL_FLAGS) --target=riscv32-linux-musl
CFLAGS.riscv64 = $(ALL_FLAGS) --target=riscv64-linux-musl
CFLAGS.mips32 = $(ALL_FLAGS) --target=mips-linux-musl # Big-endian MIPS
CFLAGS.mipsel32 = $(ALL_FLAGS) --target=mipsel-linux-musl # Little-endian MIPS
CFLAGS.mips64 = $(ALL_FLAGS) --target=mips64-linux-musl
CFLAGS.mips32 = $(ALL_FLAGS) --target=mips-linux-musleabi # Big-endian MIPS
CFLAGS.mipsel32 = $(ALL_FLAGS) --target=mipsel-linux-musleabi # Little-endian MIPS
CFLAGS.mips64 = $(ALL_FLAGS) --target=mips64-linux-muslabi64
# CFLAGS.loongarch64 = $(ALL_FLAGS) --target=loongarch64-linux-musl
# CFLAGS.s390x = $(ALL_FLAGS) --target=s390x-linux-musl -mcpu=z13
CFLAGS.powerpc32 = $(ALL_FLAGS) --target=powerpc-linux-musl

@ -43,8 +43,7 @@ COMPILATION_TARGETS: list[COMPILATION_TARGETS_TYPE] = list(
# Tuple contains (Zig target,extra_cli_args,qemu_suffix),
COMPILE_AND_RUN_INFO: Dict[COMPILATION_TARGETS_TYPE, Tuple[str, Tuple[str, ...], str]] = {
"aarch64": ("aarch64-freestanding", (), "aarch64"),
# TODO: when updating to newer version of Zig, this -mcpu option can be removed
"arm": ("arm-freestanding", ("-mcpu=cortex_a7",), "arm"),
"arm": ("arm-freestanding", (), "arm"),
"riscv32": ("riscv32-freestanding", (), "riscv32"),
"riscv64": ("riscv64-freestanding", (), "riscv64"),
"mips32": ("mips-freestanding", (), "mips"),

@ -91,7 +91,7 @@ def test_arm_simple_branch(qemu_assembly_run):
" 0x200f0 <end> mov r0, #0 R0 => 0\n"
" 0x200f4 <end+4> mov r7, #0xf8 R7 => 0xf8\n"
" 0x200f8 <end+8> svc #0 <SYS_exit_group>\n"
" 0x200fc andeq r3, r0, r1, asr #32\n"
" 0x200fc andeq r1, r0, r1, asr #18\n"
"────────────────────────────────────────────────────────────────────────────────\n"
)
@ -301,7 +301,7 @@ def test_arm_implicit_branch_ldr(qemu_assembly_run):
" 0x200c0 <end+4> mov r7, #0xf8 R7 => 0xf8\n"
" 0x200c4 <end+8> svc #0 <SYS_exit_group>\n"
" 0x200c8 <end+12> strheq r0, [r2], -r12\n"
" 0x200cc andeq r3, r0, r1, asr #32\n"
" 0x200cc andeq r1, r0, r1, asr #18\n"
"\n"
"\n"
"\n"
@ -325,7 +325,7 @@ def test_arm_implicit_branch_ldr(qemu_assembly_run):
" 0x200c0 <end+4> mov r7, #0xf8 R7 => 0xf8\n"
" 0x200c4 <end+8> svc #0 <SYS_exit_group>\n"
" 0x200c8 <end+12> strheq r0, [r2], -r12\n"
" 0x200cc andeq r3, r0, r1, asr #32\n"
" 0x200cc andeq r1, r0, r1, asr #18\n"
"\n"
"\n"
"\n"
@ -438,7 +438,7 @@ def test_arm_cmp_instructions(qemu_assembly_run):
" 0x200d0 <end> mov r0, #0 R0 => 0\n"
" 0x200d4 <end+4> mov r7, #0xf8 R7 => 0xf8\n"
" 0x200d8 <end+8> svc #0 <SYS_exit_group>\n"
" 0x200dc andeq r3, r0, r1, asr #32\n"
" 0x200dc andeq r1, r0, r1, asr #18\n"
"\n"
"\n"
"────────────────────────────────────────────────────────────────────────────────\n"

@ -303,7 +303,7 @@ def test_riscv64_jump_chain(qemu_assembly_run):
" 0x1001166 <end+2> addi a7, zero, 0x5d A7 => 93 (0x0 + 0x5d)\n"
" 0x100116a <end+6> c.li a0, 0 A0 => 0\n"
" 0x100116c <end+8> ecall <SYS_exit>\n"
" 0x1001170 c.addiw s6, -0x10\n"
" 0x1001170 c.li s0, 0x10 S0 => 0x10\n"
"────────────────────────────────────────────────────────────────────────────────\n"
)

Loading…
Cancel
Save