mirror of
https://github.com/upx/upx.git
synced 2025-08-11 22:52:30 +08:00
CI updates
This commit is contained in:
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@ -467,8 +467,8 @@ jobs:
|
||||
# { zig_target: aarch64-macos.12.0-none }
|
||||
# { zig_target: aarch64-macos.13.0-none }
|
||||
- { zig_target: aarch64-windows-gnu }
|
||||
- { zig_target: arm-linux-musleabihf, qemu: qemu-arm }
|
||||
# { zig_target: arm-linux-musleabihf, qemu: qemu-arm, zig_pic: -fPIE }
|
||||
- { zig_target: arm-linux-musleabihf, zig_flags: -mcpu=cortex_a5, qemu: qemu-arm }
|
||||
# { zig_target: arm-linux-musleabihf, zig_flags: -mcpu=cortex_a5, qemu: qemu-arm, zig_pic: -fPIE }
|
||||
- { zig_target: i386-linux-gnu.2.3.4, zig_flags: -march=i586 }
|
||||
- { zig_target: i386-linux-musl, zig_flags: -march=i586, qemu: qemu-i386 }
|
||||
# { zig_target: i386-linux-musl, zig_flags: -march=i586, qemu: qemu-i386, zig_pic: -fPIE }
|
||||
@ -490,7 +490,7 @@ jobs:
|
||||
- { zig_target: x86_64-windows-gnu }
|
||||
env:
|
||||
# zig is currently missing winpthreads; see https://github.com/ziglang/zig/issues/10989
|
||||
UPX_CONFIG_EXPECT_THREADS: ${{ contains(matrix.zig_target, '-windows-') && 'OFF' || 'ON' }}
|
||||
UPX_CONFIG_EXPECT_THREADS: ${{ contains(matrix.zig_target, '-windows') && 'OFF' || 'ON' }}
|
||||
# for zig-cc wrapper scripts (see below):
|
||||
ZIG_CPPFLAGS: -DUPX_DOCTEST_CONFIG_MULTITHREADING
|
||||
ZIG_FLAGS: ${{ matrix.zig_flags }}
|
||||
|
@ -41,9 +41,18 @@
|
||||
#if !defined(__has_builtin)
|
||||
#define __has_builtin(x) 0
|
||||
#endif
|
||||
#if !defined(__has_declspec_attribute)
|
||||
#define __has_declspec_attribute(x) 0
|
||||
#endif
|
||||
#if !defined(__has_feature)
|
||||
#define __has_feature(x) 0
|
||||
#endif
|
||||
#if !defined(__has_include)
|
||||
#define __has_include(x) 0
|
||||
#endif
|
||||
#if !defined(__has_warning)
|
||||
#define __has_warning(x) 0
|
||||
#endif
|
||||
|
||||
// reserve name "upx" for namespace
|
||||
namespace upx {}
|
||||
|
@ -163,6 +163,7 @@ static noinline void list_all_packers(FILE *f, int verbose) {
|
||||
PackerNames pn;
|
||||
pn.o = &o;
|
||||
(void) PackMaster::visitAllPackers(PackerNames::visit, nullptr, &o, &pn);
|
||||
// NOLINTNEXTLINE(bugprone-multi-level-implicit-pointer-conversion)
|
||||
upx_gnomesort(pn.names, pn.names_count, sizeof(pn.names[0]), PackerNames::compare_fname);
|
||||
size_t pos = 0;
|
||||
for (size_t i = 0; i < pn.names_count; i++) {
|
||||
|
@ -446,6 +446,7 @@ TEST_CASE("upx_memswap") {
|
||||
typedef byte element_type;
|
||||
element_type a = 11, b = 22;
|
||||
element_type *array[4];
|
||||
// NOLINTNEXTLINE(bugprone-multi-level-implicit-pointer-conversion)
|
||||
memset(array, 0xfb, sizeof(array));
|
||||
array[1] = &a;
|
||||
array[3] = &b;
|
||||
@ -454,14 +455,17 @@ TEST_CASE("upx_memswap") {
|
||||
#if defined(__CHERI__) && defined(__CHERI_PURE_CAPABILITY__)
|
||||
// TODO later: CHERI clang-14 bug/miscompilation with upx_memswap(); or
|
||||
// maybe caused by tagged-memory issues ???
|
||||
// NOLINTNEXTLINE(bugprone-multi-level-implicit-pointer-conversion)
|
||||
memswap_no_overlap((byte *) array, (byte *) (array + 2), 2 * sizeof(array[0]));
|
||||
#else
|
||||
// NOLINTNEXTLINE(bugprone-multi-level-implicit-pointer-conversion)
|
||||
upx_memswap(array, array + 2, 2 * sizeof(array[0]));
|
||||
#endif
|
||||
CHECK(array[1] == &b);
|
||||
CHECK(array[3] == &a);
|
||||
CHECK(*array[1] == 22);
|
||||
CHECK(*array[3] == 11);
|
||||
// NOLINTNEXTLINE(bugprone-multi-level-implicit-pointer-conversion)
|
||||
memswap_no_overlap((byte *) array, (byte *) (array + 2), 2 * sizeof(array[0]));
|
||||
CHECK(array[1] == &a);
|
||||
CHECK(array[3] == &b);
|
||||
|
Reference in New Issue
Block a user