From f6a210ecf0947470c7292055d471617e06c35451 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Mon, 23 Mar 2026 13:27:34 +0100 Subject: [PATCH] CI updates --- .github/workflows/ci.yml | 5 +++-- .gitignore | 4 +++- CMakeLists.txt | 8 ++++---- src/bele.h | 8 ++++---- src/util/xspan_fwd.h | 18 +++++++++--------- 5 files changed, 23 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c86fa4a2..a82962da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -712,9 +712,10 @@ jobs: echo -e '#!/bin/sh\n'$log'exec zig ar "$@"' > zig-ar echo -e '#!/bin/sh\n'$log'exec zig cc -target $ZIG_TARGET $ZIG_PIC $ZIG_FLAGS $ZIG_CPPFLAGS $ZIG_CFLAGS "$@"' > zig-cc echo -e '#!/bin/sh\n'$log'exec zig c++ -target $ZIG_TARGET $ZIG_PIC $ZIG_FLAGS $ZIG_CPPFLAGS $ZIG_CXXFLAGS "$@"' > zig-cxx + echo -e '#!/bin/sh\n'$log'exec zig objcopy "$@"' > zig-objcopy echo -e '#!/bin/sh\n'$log'exec zig ranlib "$@"' > zig-ranlib - chmod +x zig-ar zig-cc zig-cxx zig-ranlib - ls -la; head zig-ar zig-cc zig-cxx zig-ranlib + chmod +x zig-ar zig-cc zig-cxx zig-objcopy zig-ranlib + ls -la; head zig-ar zig-cc zig-cxx zig-objcopy zig-ranlib # update ZIG_TARGET [[ $ZIG_TARGET == mips-linux-musleabi-* ]] && ZIG_TARGET=mips-linux-musleabi [[ $ZIG_TARGET == mips-linux-musleabihf-* ]] && ZIG_TARGET=mips-linux-musleabihf diff --git a/.gitignore b/.gitignore index 64d88162..612dca3b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ /.cache* -/.idea/ +/.gram/ /.hg* +/.idea/ +/.jj/ /.vscode* /.zed/ /CMakeCache* diff --git a/CMakeLists.txt b/CMakeLists.txt index 65acb55e..050e0898 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -297,12 +297,12 @@ if(Threads_FOUND) endforeach() endif() -if(NOT UPX_CONFIG_DISABLE_BZIP2) upx_add_glob_files(bzip2_SOURCES "vendor/bzip2/*.c") add_library(upx_vendor_bzip2 STATIC ${bzip2_SOURCES}) if(NOT UPX_CONFIG_DISABLE_C_STANDARD) set_property(TARGET upx_vendor_bzip2 PROPERTY C_STANDARD 11) endif() +if(NOT UPX_CONFIG_DISABLE_BZIP2) endif() # UPX_CONFIG_DISABLE_BZIP2 upx_add_glob_files(ucl_SOURCES "vendor/ucl/src/*.c") @@ -317,12 +317,12 @@ if(NOT UPX_CONFIG_DISABLE_C_STANDARD) set_property(TARGET upx_vendor_zlib PROPERTY C_STANDARD 11) endif() -if(NOT UPX_CONFIG_DISABLE_ZSTD) upx_add_glob_files(zstd_SOURCES "vendor/zstd/lib/*/*.c") add_library(upx_vendor_zstd STATIC ${zstd_SOURCES}) if(NOT UPX_CONFIG_DISABLE_C_STANDARD) set_property(TARGET upx_vendor_zstd PROPERTY C_STANDARD 11) endif() +if(NOT UPX_CONFIG_DISABLE_ZSTD) endif() # UPX_CONFIG_DISABLE_ZSTD upx_add_glob_files(upx_SOURCES "src/*.cpp" "src/[cfu]*/*.cpp") @@ -347,7 +347,6 @@ endif() upx_cmake_include_hook(5_target_compilation_flags) -if(NOT UPX_CONFIG_DISABLE_BZIP2) set(t upx_vendor_bzip2) upx_compile_target_debug_with_O2(${t}) upx_sanitize_target(${t}) @@ -358,6 +357,7 @@ elseif(GNU_FRONTEND) target_compile_options(${t} PRIVATE ${warn_Wall} ${warn_Werror}) endif() upx_add_target_extra_compile_options(${t} UPX_CONFIG_EXTRA_COMPILE_OPTIONS_BZIP2) +if(NOT UPX_CONFIG_DISABLE_BZIP2) endif() # UPX_CONFIG_DISABLE_BZIP2 set(t upx_vendor_ucl) @@ -386,7 +386,6 @@ elseif(GNU_FRONTEND) endif() upx_add_target_extra_compile_options(${t} UPX_CONFIG_EXTRA_COMPILE_OPTIONS_ZLIB) -if(NOT UPX_CONFIG_DISABLE_ZSTD) set(t upx_vendor_zstd) upx_compile_target_debug_with_O2(${t}) upx_sanitize_target(${t}) @@ -397,6 +396,7 @@ elseif(GNU_FRONTEND) target_compile_options(${t} PRIVATE ${warn_Wall} ${warn_Werror}) endif() upx_add_target_extra_compile_options(${t} UPX_CONFIG_EXTRA_COMPILE_OPTIONS_ZSTD) +if(NOT UPX_CONFIG_DISABLE_ZSTD) endif() # UPX_CONFIG_DISABLE_ZSTD set(t upx) diff --git a/src/bele.h b/src/bele.h index fc33a2e2..47fb55a4 100644 --- a/src/bele.h +++ b/src/bele.h @@ -983,14 +983,14 @@ inline bele_constexpr T align_down(const LE32 &a, const T &b) noexcept { return align_down(T(a), b); } -REQUIRE_UINT32 -inline bele_constexpr T align_up(const T &a, const LE32 &b) noexcept { return align_up(a, T(b)); } -REQUIRE_UINT32 -inline bele_constexpr T align_up(const LE32 &a, const T &b) noexcept { return align_up(T(a), b); } REQUIRE_UINT32 inline bele_constexpr T align_up(const T &a, const BE32 &b) noexcept { return align_up(a, T(b)); } REQUIRE_UINT32 inline bele_constexpr T align_up(const BE32 &a, const T &b) noexcept { return align_up(T(a), b); } +REQUIRE_UINT32 +inline bele_constexpr T align_up(const T &a, const LE32 &b) noexcept { return align_up(a, T(b)); } +REQUIRE_UINT32 +inline bele_constexpr T align_up(const LE32 &a, const T &b) noexcept { return align_up(T(a), b); } REQUIRE_UINT32 inline bele_constexpr T min(const T &a, const BE16 &b) noexcept { return min(a, T(b)); } diff --git a/src/util/xspan_fwd.h b/src/util/xspan_fwd.h index f2bd4131..78fc94f6 100644 --- a/src/util/xspan_fwd.h +++ b/src/util/xspan_fwd.h @@ -304,41 +304,41 @@ inline void set_le64(const C &a, upx_uint64_t v) { #ifndef XSPAN_FWD_C_IS_MEMBUFFER template inline C operator+(const C &a, const BE16 &v) { - return a + unsigned(v); + return a + size_t(unsigned(v)); } template inline C operator+(const C &a, const BE32 &v) { - return a + unsigned(v); + return a + size_t(unsigned(v)); } template inline C operator+(const C &a, const LE16 &v) { - return a + unsigned(v); + return a + size_t(unsigned(v)); } template inline C operator+(const C &a, const LE32 &v) { - return a + unsigned(v); + return a + size_t(unsigned(v)); } template inline C operator-(const C &a, const BE16 &v) { - return a - unsigned(v); + return a - size_t(unsigned(v)); } template inline C operator-(const C &a, const BE32 &v) { - return a - unsigned(v); + return a - size_t(unsigned(v)); } template inline C operator-(const C &a, const LE16 &v) { - return a - unsigned(v); + return a - size_t(unsigned(v)); } template inline C operator-(const C &a, const LE32 &v) { - return a - unsigned(v); + return a - size_t(unsigned(v)); } #endif // XSPAN_FWD_C_IS_MEMBUFFER template -typename std::enable_if::type upx_safe_strlen(const C &a) { +inline typename std::enable_if::type upx_safe_strlen(const C &a) { // not fully checked, but can require at least 1 byte upx_rsize_t len = upx_safe_strlen(a.raw_bytes(1)); (void) a.raw_bytes(len + 1); // now can do a full check