From 12d1c6bbdad98cb7735fbfc99a5111af4ae8a650 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Tue, 30 Sep 2025 20:38:33 +0200 Subject: [PATCH] CI updates --- .github/workflows/ci.yml | 1 + CMakeLists.txt | 4 ++-- Makefile | 2 ++ README | 5 +++-- misc/make/Makefile-extra.mk | 3 +++ src/bele_policy.h | 4 ++-- src/check/dt_check.cpp | 2 +- src/conf.h | 8 ++++---- src/packer.cpp | 6 +++--- src/packer.h | 2 +- src/util/cxxlib.h | 1 - 11 files changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47f1c5a1..eb968774 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -653,6 +653,7 @@ jobs: # install zig; note that ~/.local/bin is included in the default $PATH on Ubuntu mkdir -p -v ~/.local/bin cd ~/.local/bin + ZIG_DIST_VERSION=${ZIG_DIST_VERSION/#zig-/} ZIG_DIST_NAME=zig-linux-x86_64-${ZIG_DIST_VERSION} ZIG_DIST_NAME=zig-x86_64-linux-${ZIG_DIST_VERSION} #curl -sS -L -O https://ziglang.org/builds/${ZIG_DIST_NAME}.tar.xz diff --git a/CMakeLists.txt b/CMakeLists.txt index 21dc5624..a4ed514c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,8 +57,8 @@ endif() # test config options (see below) # IMPORTANT NOTE: self-pack test can only work if the host executable format is supported by UPX! -option(UPX_CONFIG_DISABLE_SELF_PACK_TEST "Do not test packing UPX with itself" OFF) -option(UPX_CONFIG_DISABLE_EXHAUSTIVE_TESTS "Do not run exhaustive tests" OFF) +option(UPX_CONFIG_DISABLE_SELF_PACK_TEST "Do not test packing UPX with itself." OFF) +option(UPX_CONFIG_DISABLE_EXHAUSTIVE_TESTS "Do not run exhaustive tests." OFF) #*********************************************************************** # init diff --git a/Makefile b/Makefile index 929c271d..d28732ba 100644 --- a/Makefile +++ b/Makefile @@ -104,3 +104,5 @@ check-whitespace clang-format run-testsuite run-testsuite-all run-testsuite-debu $(MAKE) -C src $@ endif endif + +# vim:set ts=8 sw=8 noet: diff --git a/README b/README index dc1692bc..19899113 100644 --- a/README +++ b/README @@ -61,8 +61,9 @@ SHORT DOCUMENTATION 'upx program.exe' will compress a program or DLL. For best compression results try 'upx --best program.exe' or 'upx --brute program.exe'. -Please see the file UPX.DOC for the full documentation. The files -NEWS and BUGS also contain various tidbits of information. +Please see the file doc/upx-doc.html for the full documentation. The files +NEWS and doc/BUGS.txt also contain various tidbits of information, as +does the output of 'upx --help'. THE FUTURE diff --git a/misc/make/Makefile-extra.mk b/misc/make/Makefile-extra.mk index 115bc9fc..fda36ef5 100644 --- a/misc/make/Makefile-extra.mk +++ b/misc/make/Makefile-extra.mk @@ -281,6 +281,7 @@ build/analyze/clang-tidy/debug build/analyze/clang-tidy/release: build/analyze/c build/analyze/clang-tidy/debug build/analyze/clang-tidy/release: build/analyze/clang-tidy-ucl/$$(notdir $$@) build/analyze/clang-tidy/debug build/analyze/clang-tidy/release: build/analyze/clang-tidy-zlib/$$(notdir $$@) build/analyze/clang-tidy/debug build/analyze/clang-tidy/release: build/analyze/clang-tidy-zstd/$$(notdir $$@) +build/analyze/clang-tidy/debug build/analyze/clang-tidy/release: PHONY # OLD names [deprecated] build/extra/scan-build/debug: build/analyze/clang-analyzer/debug PHONY @@ -380,3 +381,5 @@ $(foreach 1,$(SUBMODULES),$(if $(wildcard vendor/$1/[CL]*),,\ $(error ERROR: missing git submodule '$1'; run 'git submodule update --init'))) endif # UPX_MAKEFILE_EXTRA_MK_INCLUDED + +# vim:set ts=8 sw=8 noet: diff --git a/src/bele_policy.h b/src/bele_policy.h index 186aa4df..d2fa5b4c 100644 --- a/src/bele_policy.h +++ b/src/bele_policy.h @@ -135,7 +135,7 @@ struct BEPolicy final S u32_compare_signed(const void *a, const void *b) C { return be32_compare_signed(a, b); } S u64_compare_signed(const void *a, const void *b) C { return be64_compare_signed(a, b); } - static void compileTimeAssertions() { + static void compileTimeAssertions() noexcept { COMPILE_TIME_ASSERT(sizeof(U16) == 2) COMPILE_TIME_ASSERT(sizeof(U32) == 4) COMPILE_TIME_ASSERT(sizeof(U64) == 8) @@ -194,7 +194,7 @@ struct LEPolicy final S u32_compare_signed(const void *a, const void *b) C { return le32_compare_signed(a, b); } S u64_compare_signed(const void *a, const void *b) C { return le64_compare_signed(a, b); } - static void compileTimeAssertions() { + static void compileTimeAssertions() noexcept { COMPILE_TIME_ASSERT(sizeof(U16) == 2) COMPILE_TIME_ASSERT(sizeof(U32) == 4) COMPILE_TIME_ASSERT(sizeof(U64) == 8) diff --git a/src/check/dt_check.cpp b/src/check/dt_check.cpp index 34ad036d..9bd38a57 100644 --- a/src/check/dt_check.cpp +++ b/src/check/dt_check.cpp @@ -262,7 +262,7 @@ ASSERT_SAME_TYPE(short, upx_int16_t); ASSERT_SAME_TYPE(unsigned short, upx_uint16_t); ASSERT_SAME_TYPE(int, upx_int32_t); ASSERT_SAME_TYPE(unsigned, upx_uint32_t); -#if (__SIZEOF_LONG_LONG__ + 0 < 128) +#if (__SIZEOF_LONG_LONG__ + 0 < 16) ASSERT_SAME_TYPE(long long, upx_int64_t); ASSERT_SAME_TYPE(unsigned long long, upx_uint64_t); #endif diff --git a/src/conf.h b/src/conf.h index 9333bb6c..34021df3 100644 --- a/src/conf.h +++ b/src/conf.h @@ -119,7 +119,7 @@ static_assert((char) (-1) == 255); // -funsigned-char #define upx_std_atomic(Type) Type #define upx_std_once_flag upx_std_atomic(size_t) template -inline void upx_std_call_once(upx_std_once_flag &flag, NoexceptCallable &&f) { +inline void upx_std_call_once(upx_std_once_flag &flag, NoexceptCallable &&f) noexcept { if (__acc_unlikely(!flag)) { flag = 1; f(); @@ -809,7 +809,7 @@ extern const char *progname; bool main_set_exit_code(int ec); int main_get_options(int argc, char **argv); void main_get_envoptions(); -int upx_main(int argc, char *argv[]) may_throw; +noinline int upx_main(int argc, char *argv[]) may_throw; // msg.cpp void printSetNl(int need_nl) noexcept; @@ -826,8 +826,8 @@ void infoHeader(); void infoWriting(const char *what, upx_int64_t size); // work.cpp -void do_one_file(const char *iname, char *oname) may_throw; -int do_files(int i, int argc, char *argv[]) may_throw; +noinline void do_one_file(const char *iname, char *oname) may_throw; +noinline int do_files(int i, int argc, char *argv[]) may_throw; // help.cpp extern const char gitrev[]; diff --git a/src/packer.cpp b/src/packer.cpp index 7ad7d80c..665849ff 100644 --- a/src/packer.cpp +++ b/src/packer.cpp @@ -857,9 +857,9 @@ void Packer::relocateLoader() { } /************************************************************************* -// void Packer::compressWithFilters(): -// Try compression with several methods and filters, choose the best -/ or first working one. Needs buildLoader(). +// void Packer::compressWithFilters(): +// Try compression with several methods and filters, choose the best +// or first working one. Needs buildLoader(). // // Required inputs: // this->ph diff --git a/src/packer.h b/src/packer.h index 1dd32aec..b7a56796 100644 --- a/src/packer.h +++ b/src/packer.h @@ -248,7 +248,7 @@ protected: int patch_le32(void *b, int blen, const void *old, unsigned new_); void checkPatch(void *b, int blen, int boff, int size); - // relocation util + // relocation util [see packer_r.cpp] static unsigned optimizeReloc(unsigned relocnum, SPAN_P(byte) relocs, SPAN_S(byte) out, SPAN_P(byte) image, unsigned image_size, int bits, bool bswap, int *big); diff --git a/src/util/cxxlib.h b/src/util/cxxlib.h index c39e09e9..06ff520d 100644 --- a/src/util/cxxlib.h +++ b/src/util/cxxlib.h @@ -477,7 +477,6 @@ forceinline constexpr T wrapping_add(const T &a, const T &b) noexcept { typedef std::make_unsigned_t U; return T(U(a) + U(b)); } - template forceinline constexpr T wrapping_sub(const T &a, const T &b) noexcept { static_assert(std::is_integral_v);