mirror of https://github.com/upx/upx.git
CI updates
This commit is contained in:
parent
071579b5b6
commit
d23484b9db
|
@ -22,6 +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
|
||||
|
||||
jobs:
|
||||
job-rebuild-and-verify-stubs:
|
||||
|
@ -490,6 +492,7 @@ jobs:
|
|||
- { zig_target: arm-linux-musleabihf, qemu: qemu-arm }
|
||||
- { zig_target: armeb-linux-musleabihf, qemu: qemu-armeb }
|
||||
- { zig_target: i386-linux-gnu.2.3.4, zig_flags: -march=i586 }
|
||||
- { zig_target: i386-linux-gnu.2.17, zig_flags: -march=i586 }
|
||||
- { zig_target: i386-linux-musl, zig_flags: -march=i586, qemu: qemu-i386 }
|
||||
- { zig_target: i386-windows-gnu }
|
||||
- { zig_target: mips-linux-musleabi, zig_flags: -msoft-float, qemu: qemu-mips }
|
||||
|
@ -497,9 +500,10 @@ 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
|
||||
- { zig_target: x86_64-linux-musl, qemu: qemu-x86_64 }
|
||||
- { zig_target: x86_64-macos.11.0-none }
|
||||
- { zig_target: x86_64-windows-gnu }
|
||||
|
@ -530,10 +534,10 @@ jobs:
|
|||
run: |
|
||||
rev=$(git rev-parse --short=7 HEAD)
|
||||
echo "UPX_GITREV_SHORT=$rev" >> $GITHUB_ENV
|
||||
if [[ "${{ matrix.zig_target }}" == i386-linux-gnu.2.3.4 ]]; then
|
||||
if [[ "${{ matrix.zig_target }}" == i386-linux-gnu.2.3.* ]]; then true;
|
||||
echo "UPX_CONFIG_DISABLE_SHARED_LIBS=ON" >> $GITHUB_ENV # zig problem when linking in Debug mode
|
||||
fi
|
||||
if [[ "${{ matrix.zig_target }}" == x86_64-linux-gnu.2.3.4 ]]; then
|
||||
if [[ "${{ matrix.zig_target }}" == x86_64-linux-gnu.2* ]]; then true;
|
||||
echo "NEED_GCOMPAT=1" >> $GITHUB_ENV
|
||||
# TODO FIXME: problem with self-packed upx and musl+gcompat: "Not a valid dynamic program"
|
||||
echo "UPX_CONFIG_DISABLE_RUN_PACKED_TEST=ON" >> $GITHUB_ENV
|
||||
|
@ -542,7 +546,8 @@ jobs:
|
|||
mkdir -p -v ~/.local/bin
|
||||
cd ~/.local/bin
|
||||
ZIG_DIST_NAME=zig-linux-x86_64-${ZIG_DIST_VERSION}
|
||||
curl -sS -L -O https://ziglang.org/builds/${ZIG_DIST_NAME}.tar.xz
|
||||
#curl -sS -L -O https://ziglang.org/builds/${ZIG_DIST_NAME}.tar.xz
|
||||
curl -sS -L -O https://ziglang.org/download/0.14.0/${ZIG_DIST_NAME}.tar.xz
|
||||
ls -l ${ZIG_DIST_NAME}.tar.xz
|
||||
tar -xoJf ${ZIG_DIST_NAME}.tar.xz
|
||||
rm ${ZIG_DIST_NAME}.tar.xz
|
||||
|
@ -613,14 +618,14 @@ jobs:
|
|||
(cd build/zig/${ZIG_TARGET}${ZIG_PIC}/release && DESTDIR="$PWD/Install with cmake" cmake --install .)
|
||||
(cd build/zig/${ZIG_TARGET}${ZIG_PIC}/release && DESTDIR="$PWD/Install with make" make install)
|
||||
- name: Run ctest tests
|
||||
if: ${{ matrix.zig_target == 'i386-linux-musl' || matrix.zig_target == 'x86_64-linux-musl' || matrix.zig_target == 'x86_64-linux-gnu.2.3.4' }}
|
||||
if: ${{ matrix.zig_target == 'i386-linux-musl' || matrix.zig_target == 'x86_64-linux-musl' || contains(matrix.zig_target, 'x86_64-linux-gnu.2') }}
|
||||
run: |
|
||||
test -n "$NEED_GCOMPAT" && apk add gcompat
|
||||
jobs="${ZIG_TARGET}${ZIG_PIC}/debug ${ZIG_TARGET}${ZIG_PIC}/release"
|
||||
echo "===== parallel jobs: $jobs"
|
||||
parallel -kv --lb 'make build/zig/{}+test' ::: $jobs
|
||||
- name: Mimic ctest tests
|
||||
if: ${{ matrix.zig_target == 'i386-linux-musl' || matrix.zig_target == 'x86_64-linux-musl' || matrix.zig_target == 'x86_64-linux-gnu.2.3.4' }}
|
||||
if: ${{ matrix.zig_target == 'i386-linux-musl' || matrix.zig_target == 'x86_64-linux-musl' || contains(matrix.zig_target, 'x86_64-linux-gnu.2') }}
|
||||
run: |
|
||||
test -n "$NEED_GCOMPAT" && apk add gcompat
|
||||
jobs="${ZIG_TARGET}${ZIG_PIC}/debug ${ZIG_TARGET}${ZIG_PIC}/release"
|
||||
|
@ -637,7 +642,7 @@ jobs:
|
|||
echo "===== parallel jobs: $jobs"
|
||||
parallel -kv --lb 'cd build/zig/{} && bash ../../../../misc/testsuite/mimic_ctest.sh' ::: $jobs
|
||||
- name: Mimic ctest tests with Valgrind
|
||||
if: ${{ matrix.zig_target == 'x86_64-linux-musl' || matrix.zig_target == 'x86_64-linux-gnu.2.3.4' }}
|
||||
if: ${{ matrix.zig_target == 'x86_64-linux-musl' || contains(matrix.zig_target, 'x86_64-linux-gnu.2') }}
|
||||
run: |
|
||||
export UPX_CONFIG_DISABLE_EXHAUSTIVE_TESTS=ON # valgrind is SLOW
|
||||
apk add coreutils valgrind
|
||||
|
@ -648,7 +653,7 @@ jobs:
|
|||
echo "===== parallel jobs: $jobs"
|
||||
parallel -kv --lb 'cd build/zig/{} && bash ../../../../misc/testsuite/mimic_ctest.sh' ::: $jobs
|
||||
- name: Run file system tests
|
||||
if: ${{ matrix.zig_target == 'i386-linux-musl' || matrix.zig_target == 'x86_64-linux-musl' || matrix.zig_target == 'x86_64-linux-gnu.2.3.4' }}
|
||||
if: ${{ matrix.zig_target == 'i386-linux-musl' || matrix.zig_target == 'x86_64-linux-musl' || contains(matrix.zig_target, 'x86_64-linux-gnu.2') }}
|
||||
run: |
|
||||
apk add coreutils sudo
|
||||
test -n "$NEED_GCOMPAT" && apk add gcompat
|
||||
|
|
|
@ -102,6 +102,14 @@ build/extra/clang-std-cxx23/%: export CXX = clang++ -std=gnu++2b
|
|||
build/extra/clang-std-cxx23/%: export UPX_CONFIG_DISABLE_C_STANDARD = ON
|
||||
build/extra/clang-std-cxx23/%: export UPX_CONFIG_DISABLE_CXX_STANDARD = ON
|
||||
|
||||
# force building with clang/clang++ C++26 (and C23)
|
||||
build/extra/clang-std-cxx26/debug: PHONY; $(call run_config_and_build,$@,Debug)
|
||||
build/extra/clang-std-cxx26/release: PHONY; $(call run_config_and_build,$@,Release)
|
||||
build/extra/clang-std-cxx26/%: export CC = clang -std=gnu2x -Wno-constant-logical-operand
|
||||
build/extra/clang-std-cxx26/%: export CXX = clang++ -std=gnu++2c
|
||||
build/extra/clang-std-cxx26/%: export UPX_CONFIG_DISABLE_C_STANDARD = ON
|
||||
build/extra/clang-std-cxx26/%: export UPX_CONFIG_DISABLE_CXX_STANDARD = ON
|
||||
|
||||
# force building with gcc/g++
|
||||
build/extra/gcc/debug: PHONY; $(call run_config_and_build,$@,Debug)
|
||||
build/extra/gcc/release: PHONY; $(call run_config_and_build,$@,Release)
|
||||
|
|
|
@ -1132,6 +1132,7 @@ void upx_compiler_sanity_check(void) noexcept {
|
|||
assert_noexcept(bele->get32(d) == 0xfffefdfc);
|
||||
assert_noexcept(get_be32_signed(d) == -66052);
|
||||
assert_noexcept(get_be64(d) == 0xfffefdfcfbfaf9f8ULL);
|
||||
assert_noexcept(bele->get64(d) == 0xfffefdfcfbfaf9f8ULL);
|
||||
assert_noexcept(get_be64_signed(d) == -283686952306184LL);
|
||||
bele = &N_BELE_RTP::le_policy;
|
||||
assert_noexcept(get_le16(d) == 0xfeff);
|
||||
|
@ -1144,6 +1145,7 @@ void upx_compiler_sanity_check(void) noexcept {
|
|||
assert_noexcept(bele->get32(d) == 0xfcfdfeff);
|
||||
assert_noexcept(get_le32_signed(d) == -50462977);
|
||||
assert_noexcept(get_le64(d) == 0xf8f9fafbfcfdfeffULL);
|
||||
assert_noexcept(bele->get64(d) == 0xf8f9fafbfcfdfeffULL);
|
||||
assert_noexcept(get_le64_signed(d) == -506097522914230529LL);
|
||||
static_assert(get_be24(d) == 0xfffefd);
|
||||
static_assert(get_le24(d) == 0xfdfeff);
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
#include "conf.h"
|
||||
|
||||
static Options global_options;
|
||||
Options *opt = &global_options; // also see class PackMaster for per-file local options
|
||||
// also see class PackMaster for per-file local options
|
||||
upx_thread_local Options *opt = &global_options;
|
||||
|
||||
#if WITH_THREADS
|
||||
std::mutex opt_lock_mutex; // for locking "opt"
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
struct Options;
|
||||
#define options_t Options // old name
|
||||
|
||||
extern Options *opt; // global options, see class PackMaster for per-file local options
|
||||
// global options, see class PackMaster for per-file local options
|
||||
extern upx_thread_local Options *opt;
|
||||
|
||||
#if WITH_THREADS
|
||||
extern std::mutex opt_lock_mutex; // for locking "opt"
|
||||
|
|
|
@ -413,10 +413,10 @@ constexpr bool mem_eq(const unsigned char *a, const unsigned char *b, std::size_
|
|||
return n == 0 || (*a == *b && mem_eq(a + 1, b + 1, n - 1));
|
||||
}
|
||||
constexpr bool mem_eq(const char *a, const unsigned char *b, std::size_t n) noexcept {
|
||||
return n == 0 || (*a == *b && mem_eq(a + 1, b + 1, n - 1));
|
||||
return n == 0 || ((uchar) *a == *b && mem_eq(a + 1, b + 1, n - 1));
|
||||
}
|
||||
constexpr bool mem_eq(const unsigned char *a, const char *b, std::size_t n) noexcept {
|
||||
return n == 0 || (*a == *b && mem_eq(a + 1, b + 1, n - 1));
|
||||
return n == 0 || (*a == (uchar) *b && mem_eq(a + 1, b + 1, n - 1));
|
||||
}
|
||||
|
||||
constexpr void mem_set(char *p, char c, std::size_t n) noexcept {
|
||||
|
|
|
@ -34,14 +34,6 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
// aligned_alloc() was added in glibc-2.16
|
||||
#if !defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION) && defined(__cplusplus)
|
||||
#if defined(__GLIBC__) && defined(__GLIBC_MINOR__) && (__GLIBC__ + 0 == 2) && \
|
||||
(__GLIBC_MINOR__ + 0 > 0) && (__GLIBC_MINOR__ + 0 < 16)
|
||||
#define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
|
||||
|
||||
// libc++ hardenining
|
||||
#if defined(__cplusplus) && 0 // TODO later
|
||||
|
||||
|
@ -65,4 +57,24 @@
|
|||
|
||||
#endif // TODO later
|
||||
|
||||
// aligned_alloc() was added in glibc-2.16
|
||||
#if !defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION) && defined(__cplusplus)
|
||||
#if defined(__GLIBC__) && defined(__GLIBC_MINOR__) && (__GLIBC__ + 0 == 2) && \
|
||||
(__GLIBC_MINOR__ + 0 > 0) && (__GLIBC_MINOR__ + 0 < 16)
|
||||
#define _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
|
||||
#endif
|
||||
#endif // _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
|
||||
|
||||
#if defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION) && defined(__cplusplus)
|
||||
#if defined(__has_include)
|
||||
#if __has_include(<__config>)
|
||||
#include <__config>
|
||||
#undef _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION
|
||||
#undef _LIBCPP_HAS_ALIGNED_ALLOCATION
|
||||
#define _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION 0
|
||||
#define _LIBCPP_HAS_ALIGNED_ALLOCATION 0
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* vim:set ts=4 sw=4 et: */
|
||||
|
|
Loading…
Reference in New Issue