diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a92a821f..81ea2976 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,8 +22,8 @@ env: ZSTD_CLEVEL: 9 # 2025-03-05 ZIG_DIST_VERSION: 0.14.0 - # 2025-04-08 - #ZIG_DIST_VERSION: 0.15.0-dev.263+d8153fa74 + # 2025-04-10 + #ZIG_DIST_VERSION: 0.15.0-dev.286+ddcf6fcdf jobs: job-rebuild-and-verify-stubs: @@ -500,7 +500,7 @@ jobs: - { zig_target: mipsel-linux-musleabi, zig_flags: -msoft-float, qemu: qemu-mipsel } - { zig_target: mipsel-linux-musleabihf, qemu: qemu-mipsel } - { zig_target: powerpc-linux-musleabihf, qemu: qemu-ppc } - # { zig_target: powerpc64-linux-musl, qemu: qemu-ppc64 } + - { zig_target: powerpc64-linux-musl, qemu: qemu-ppc64 } - { zig_target: powerpc64le-linux-musl, qemu: qemu-ppc64le } - { zig_target: x86_64-linux-gnu.2.3.4, qemu: qemu-x86_64 } # can use QEMU because of gcompat - { zig_target: x86_64-linux-gnu.2.17, qemu: qemu-x86_64 } # can use QEMU because of gcompat @@ -509,7 +509,9 @@ jobs: - { zig_target: x86_64-windows-gnu } name: ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} runs-on: ubuntu-latest - container: 'alpine:3.21' + #container: 'alpine:3.21' + #container: ${{ contains(matrix.qemu, 'qemu-ppc64') && 'alpine:3.19' || 'alpine:3.21' }} # QEMU bug + container: ${{ (matrix.qemu == 'qemu-ppc64') && 'alpine:edge' || 'alpine:3.21' }} # QEMU bug env: UPX_CONFIG_HAVE_WORKING_BUILD_RPATH: '' # for zig-cc wrapper scripts (see below): @@ -522,7 +524,7 @@ jobs: if: ${{ job.container }} shell: sh run: | - apk update && apk upgrade && apk add bash cmake curl file git make parallel tar util-linux xz zstd + apk update && apk upgrade && apk add bash cmake curl file git make parallel patch tar util-linux xz zstd # set PATH like in Ubuntu echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV git config --global --add safe.directory '*' # needed when running in a container @@ -554,6 +556,9 @@ jobs: ln -s -v ${ZIG_DIST_NAME}/zig zig #echo "PATH=$PATH" && which zig echo -n 'zig version: '; zig version + # patch zig + echo "HOME=$HOME"; ls -la "$HOME" /__w /__w/upx || true + #(cd ${ZIG_DIST_NAME} && patch -p1 -i /__w/upx/upx/misc/patches/zig/0001-x.patch) # create wrapper scripts (needed for CMake) log= log='set -x\n' diff --git a/misc/patches/zig/0001-x.patch b/misc/patches/zig/0001-x.patch new file mode 100644 index 00000000..56f7da8c --- /dev/null +++ b/misc/patches/zig/0001-x.patch @@ -0,0 +1,29 @@ +From 741b9d2f24b5796fc499a411f632820ab4f889e5 Mon Sep 17 00:00:00 2001 +From: "Markus F.X.J. Oberhumer" +Date: Wed, 9 Apr 2025 20:00:24 +0200 +Subject: [PATCH] x + +--- + lib/libcxx/include/__config | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/lib/libcxx/include/__config b/lib/libcxx/include/__config +index fec323f..a16d145 100644 +--- a/lib/libcxx/include/__config ++++ b/lib/libcxx/include/__config +@@ -637,9 +637,11 @@ typedef __char32_t char32_t; + # define _DECLARE_C99_LDBL_MATH 1 + # endif + ++# if defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION) ++# define _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION 0 + // If we are getting operator new from the MSVC CRT, then allocation overloads + // for align_val_t were added in 19.12, aka VS 2017 version 15.3. +-# if defined(_LIBCPP_MSVCRT) && defined(_MSC_VER) && _MSC_VER < 1912 ++# elif defined(_LIBCPP_MSVCRT) && defined(_MSC_VER) && _MSC_VER < 1912 + # define _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION 0 + # elif defined(_LIBCPP_ABI_VCRUNTIME) && !defined(__cpp_aligned_new) + // We're deferring to Microsoft's STL to provide aligned new et al. We don't +-- +2.49.0 + diff --git a/misc/scripts/check_whitespace.sh b/misc/scripts/check_whitespace.sh index 83b71fb5..dbc20bc2 100755 --- a/misc/scripts/check_whitespace.sh +++ b/misc/scripts/check_whitespace.sh @@ -25,13 +25,12 @@ LC_ALL=C sort -z | xargs -0r perl -n -e ' if (m,[\x00\x01\x02\x7f\xfe\xff],) { print "ERROR: binary file detected $ARGV: $_"; exit(1); } if (m,[\r\x1a],) { print "ERROR: DOS EOL detected $ARGV: $_"; exit(1); } if (m,([ \t]+)$,) { - # allow exactly two trailing spaces for GitHub flavoured Markdown in .md files - if ($1 ne " " || $ARGV !~ m,\.md$,) { - print "ERROR: trailing whitespace detected $ARGV: $_"; exit(1); - } + if ($ARGV =~ m,\.patch$,) { } + else { print "ERROR: trailing whitespace detected $ARGV: $_"; exit(1); } } if (m,\t,) { - if ($ARGV =~ m,(^|/)(gnu|m)?make(file|vars),i) { } + if ($ARGV =~ m,\.patch$,) { } + elsif ($ARGV =~ m,(^|/)(gnu|m)?make(file|vars),i) { } elsif ($ARGV =~ m,\.mk$,) { } elsif ($ARGV =~ m,/tmp/.*\.(disasm|dump)$,) { } elsif ($ARGV =~ m,/src/stub/src/arch/.*/lzma\w+\.S$,) { } diff --git a/misc/scripts/check_whitespace_git.sh b/misc/scripts/check_whitespace_git.sh index 8401f2ab..5dd54b05 100755 --- a/misc/scripts/check_whitespace_git.sh +++ b/misc/scripts/check_whitespace_git.sh @@ -19,13 +19,12 @@ git ls-files --full-name -z | perl -0 -n -e ' if (m,[\x00\x01\x02\x7f\xfe\xff],) { print "ERROR: binary file detected $ARGV: $_"; exit(1); } if (m,[\r\x1a],) { print "ERROR: DOS EOL detected $ARGV: $_"; exit(1); } if (m,([ \t]+)$,) { - # allow exactly two trailing spaces for GitHub flavoured Markdown in .md files - if ($1 ne " " || $ARGV !~ m,\.md$,) { - print "ERROR: trailing whitespace detected $ARGV: $_"; exit(1); - } + if ($ARGV =~ m,\.patch$,) { } + else { print "ERROR: trailing whitespace detected $ARGV: $_"; exit(1); } } if (m,\t,) { - if ($ARGV =~ m,(^|/)(gnu|m)?make(file|vars),i) { } + if ($ARGV =~ m,\.patch$,) { } + elsif ($ARGV =~ m,(^|/)(gnu|m)?make(file|vars),i) { } elsif ($ARGV =~ m,\.mk$,) { } elsif ($ARGV =~ m,/tmp/.*\.(disasm|dump)$,) { } elsif ($ARGV =~ m,/src/stub/src/arch/.*/lzma\w+\.S$,) { } diff --git a/src/options.cpp b/src/options.cpp index fdc36e86..c44c7abd 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -29,7 +29,7 @@ static Options global_options; // also see class PackMaster for per-file local options -upx_thread_local Options *opt = &global_options; +Options *opt = &global_options; #if WITH_THREADS std::mutex opt_lock_mutex; // for locking "opt" diff --git a/src/options.h b/src/options.h index 0dbc8ebd..8317aa74 100644 --- a/src/options.h +++ b/src/options.h @@ -31,7 +31,7 @@ struct Options; #define options_t Options // old name // global options, see class PackMaster for per-file local options -extern upx_thread_local Options *opt; +extern Options *opt; #if WITH_THREADS extern std::mutex opt_lock_mutex; // for locking "opt"