diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af1549df..34d462d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,8 +17,8 @@ env: UPX_CMAKE_CONFIG_FLAGS: -Wdev --warn-uninitialized UPX_DEBUG_TEST_FLOAT_DIVISION_BY_ZERO: 1 UPX_DEBUG_TEST_LIBC_QSORT: 1 - # 2024-04-04 - ZIG_DIST_VERSION: 0.12.0-dev.3533+e5d900268 + # 2024-04-10 + ZIG_DIST_VERSION: 0.12.0-dev.3610+9d27f34d0 jobs: job-rebuild-and-verify-stubs: @@ -66,6 +66,10 @@ jobs: run: | UPX_CLANG_FORMAT="$PWD/../deps/bin-upx-20221212/clang-format-15.0.6" make -C src clang-format if ! git diff --quiet; then git diff; exit 1; fi + - name: 'Rebuild docs' + run: | + make -C doc clean all + if ! git diff --quiet; then git diff || true; fi # ignore diff error job-linux-cmake: # uses cmake + make if: true diff --git a/CMakeLists.txt b/CMakeLists.txt index ef4f8bb2..5da8a5ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,6 +83,7 @@ upx_cache_bool_vars(OFF UPX_CONFIG_CMAKE_DISABLE_TEST UPX_CONFIG_CMAKE_DISABLE_INSTALL UPX_CONFIG_CMAKE_DISABLE_PRINT_INFO UPX_CONFIG_CMAKE_DISABLE_PLATFORM_CHECK UPX_CONFIG_DISABLE_C_STANDARD UPX_CONFIG_DISABLE_CXX_STANDARD + UPX_CONFIG_DISABLE_RUN_UNPACKED_TEST UPX_CONFIG_DISABLE_RUN_PACKED_TEST UPX_CONFIG_REQUIRE_THREADS ) upx_cache_bool_vars(ON UPX_CONFIG_EXPECT_THREADS) @@ -432,9 +433,11 @@ if(NOT UPX_CONFIG_CMAKE_DISABLE_TEST) include(CTest) if(NOT CMAKE_CROSSCOMPILING OR CMAKE_CROSSCOMPILING_EMULATOR) - add_test(NAME upx-version COMMAND upx --version) - add_test(NAME upx-help COMMAND upx --help) - add_test(NAME upx-sysinfo COMMAND upx --sysinfo -v) + add_test(NAME upx-version COMMAND upx --version) + add_test(NAME upx-version-short COMMAND upx --version-short) + add_test(NAME upx-help COMMAND upx --help) + add_test(NAME upx-license COMMAND upx --license) + add_test(NAME upx-sysinfo COMMAND upx --sysinfo -v) if(NOT UPX_CONFIG_DISABLE_SELF_PACK_TEST) # IMPORTANT NOTE: these tests can only work if the host executable format is supported by UPX! set(emu "") @@ -444,34 +447,43 @@ if(NOT UPX_CONFIG_DISABLE_SELF_PACK_TEST) set(exe "${CMAKE_EXECUTABLE_SUFFIX}") set(upx_self_exe "$") set(fo "--force-overwrite") - upx_add_serial_test(upx-self-pack upx -3 --all-filters "${upx_self_exe}" ${fo} -o upx-packed${exe}) - upx_add_serial_test(upx-self-pack-n2b upx -3 --nrv2b "${upx_self_exe}" ${fo} -o upx-packed-n2b${exe}) - upx_add_serial_test(upx-self-pack-n2d upx -3 --nrv2d "${upx_self_exe}" ${fo} -o upx-packed-n2d${exe}) - upx_add_serial_test(upx-self-pack-n2e upx -3 --nrv2e "${upx_self_exe}" ${fo} -o upx-packed-n2e${exe}) - upx_add_serial_test(upx-self-pack-lzma upx -1 --lzma "${upx_self_exe}" ${fo} -o upx-packed-lzma${exe}) - upx_add_serial_test(upx-list upx -l upx-packed${exe} upx-packed-n2b${exe} upx-packed-n2d${exe} upx-packed-n2e${exe} upx-packed-lzma${exe}) - upx_add_serial_test(upx-fileinfo upx --fileinfo upx-packed${exe} upx-packed-n2b${exe} upx-packed-n2d${exe} upx-packed-n2e${exe} upx-packed-lzma${exe}) - upx_add_serial_test(upx-test upx -t upx-packed${exe} upx-packed-n2b${exe} upx-packed-n2d${exe} upx-packed-n2e${exe} upx-packed-lzma${exe}) - upx_add_serial_test(upx-unpack upx -d upx-packed${exe} ${fo} -o upx-unpacked${exe}) - upx_add_serial_test(upx-unpack-n2b upx -d upx-packed-n2b${exe} ${fo} -o upx-unpacked-n2b${exe}) - upx_add_serial_test(upx-unpack-n2d upx -d upx-packed-n2d${exe} ${fo} -o upx-unpacked-n2d${exe}) - upx_add_serial_test(upx-unpack-n2e upx -d upx-packed-n2e${exe} ${fo} -o upx-unpacked-n2e${exe}) - upx_add_serial_test(upx-unpack-lzma upx -d upx-packed-lzma${exe} ${fo} -o upx-unpacked-lzma${exe}) + # use fast compression levels because + # - we want to test UPX and not the compression libraries + # - higher compression levels are somewhat slow in our automated QEMU/Valgrind CI tests + upx_add_serial_test(upx-self-pack upx -3 --all-filters "${upx_self_exe}" ${fo} -o upx-packed${exe}) + upx_add_serial_test(upx-self-pack-n2b upx -3 --nrv2b "${upx_self_exe}" ${fo} -o upx-packed-n2b${exe}) + upx_add_serial_test(upx-self-pack-n2d upx -3 --nrv2d "${upx_self_exe}" ${fo} -o upx-packed-n2d${exe}) + upx_add_serial_test(upx-self-pack-n2e upx -3 --nrv2e "${upx_self_exe}" ${fo} -o upx-packed-n2e${exe}) + upx_add_serial_test(upx-self-pack-lzma upx -1 --lzma "${upx_self_exe}" ${fo} -o upx-packed-lzma${exe}) + upx_add_serial_test(upx-list upx -l upx-packed${exe} upx-packed-n2b${exe} upx-packed-n2d${exe} upx-packed-n2e${exe} upx-packed-lzma${exe}) + upx_add_serial_test(upx-fileinfo upx --fileinfo upx-packed${exe} upx-packed-n2b${exe} upx-packed-n2d${exe} upx-packed-n2e${exe} upx-packed-lzma${exe}) + upx_add_serial_test(upx-test upx -t upx-packed${exe} upx-packed-n2b${exe} upx-packed-n2d${exe} upx-packed-n2e${exe} upx-packed-lzma${exe}) + + upx_add_serial_test(upx-unpack upx -d upx-packed${exe} ${fo} -o upx-unpacked${exe}) + upx_add_serial_test(upx-unpack-n2b upx -d upx-packed-n2b${exe} ${fo} -o upx-unpacked-n2b${exe}) + upx_add_serial_test(upx-unpack-n2d upx -d upx-packed-n2d${exe} ${fo} -o upx-unpacked-n2d${exe}) + upx_add_serial_test(upx-unpack-n2e upx -d upx-packed-n2e${exe} ${fo} -o upx-unpacked-n2e${exe}) + upx_add_serial_test(upx-unpack-lzma upx -d upx-packed-lzma${exe} ${fo} -o upx-unpacked-lzma${exe}) + + if(NOT UPX_CONFIG_DISABLE_RUN_UNPACKED_TEST) upx_add_serial_test(upx-run-unpacked ${emu} ./upx-unpacked${exe} --version-short) upx_add_serial_test(upx-run-unpacked-n2b ${emu} ./upx-unpacked-n2b${exe} --version-short) upx_add_serial_test(upx-run-unpacked-n2d ${emu} ./upx-unpacked-n2d${exe} --version-short) upx_add_serial_test(upx-run-unpacked-n2e ${emu} ./upx-unpacked-n2e${exe} --version-short) upx_add_serial_test(upx-run-unpacked-lzma ${emu} ./upx-unpacked-lzma${exe} --version-short) + endif() - upx_add_serial_test(upx-run-packed ${emu} ./upx-packed${exe} --version-short) - upx_add_serial_test(upx-run-packed-n2b ${emu} ./upx-packed-n2b${exe} --version-short) - upx_add_serial_test(upx-run-packed-n2d ${emu} ./upx-packed-n2d${exe} --version-short) - upx_add_serial_test(upx-run-packed-n2e ${emu} ./upx-packed-n2e${exe} --version-short) - upx_add_serial_test(upx-run-packed-lzma ${emu} ./upx-packed-lzma${exe} --version-short) + if(NOT UPX_CONFIG_DISABLE_RUN_PACKED_TEST) + upx_add_serial_test(upx-run-packed ${emu} ./upx-packed${exe} --version-short) + upx_add_serial_test(upx-run-packed-n2b ${emu} ./upx-packed-n2b${exe} --version-short) + upx_add_serial_test(upx-run-packed-n2d ${emu} ./upx-packed-n2d${exe} --version-short) + upx_add_serial_test(upx-run-packed-n2e ${emu} ./upx-packed-n2e${exe} --version-short) + upx_add_serial_test(upx-run-packed-lzma ${emu} ./upx-packed-lzma${exe} --version-short) + endif() endif() # UPX_CONFIG_DISABLE_SELF_PACK_TEST -endif() +endif() # CMAKE_CROSSCOMPILING endif() # UPX_CONFIG_CMAKE_DISABLE_TEST diff --git a/doc/Makefile b/doc/Makefile index 3dcbf4d8..cf57c1d3 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -43,6 +43,8 @@ mostlyclean clean distclean maintainer-clean: PHONY %.1 : %.pod pod2man --center=" " --release="$(PACKAGE) $(VERSION)" --date="$(VERSION_DATE)" $< | $(RTRIM) > $@ test -s $@ +# # strip version number from "Pod::Man" comment + sed -i -e 's/^\(\.\\" Automatically generated by Pod::Man\).*/\1/' $@ %-doc.html : %.pod pod2html --noindex $< | $(RTRIM) | $(DETAB2) > $@ diff --git a/doc/upx.1 b/doc/upx.1 index f2f4c57c..e2e14d72 100644 --- a/doc/upx.1 +++ b/doc/upx.1 @@ -1,5 +1,5 @@ .\" -*- mode: troff; coding: utf-8 -*- -.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) +.\" Automatically generated by Pod::Man .\" .\" Standard preamble: .\" ======================================================================== diff --git a/misc/cmake/functions.cmake b/misc/cmake/functions.cmake index beec3298..62a5dcc2 100644 --- a/misc/cmake/functions.cmake +++ b/misc/cmake/functions.cmake @@ -8,7 +8,7 @@ if(NOT DEFINED USE_STRICT_DEFAULTS AND IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR} include("${CMAKE_CURRENT_SOURCE_DIR}/misc/cmake/use_strict_defaults.cmake" OPTIONAL) endif() if(NOT DEFINED USE_STRICT_DEFAULTS) - # permissive config defaults when building from source code tarball + # use permissive config defaults when building from source code tarball set(USE_STRICT_DEFAULTS FALSE CACHE INTERNAL "" FORCE) endif() diff --git a/misc/cmake/use_strict_defaults.cmake b/misc/cmake/use_strict_defaults.cmake index 1ae82c5c..6db0189f 100644 --- a/misc/cmake/use_strict_defaults.cmake +++ b/misc/cmake/use_strict_defaults.cmake @@ -4,7 +4,7 @@ # if(NOT DEFINED USE_STRICT_DEFAULTS) - # strict config defaults for Git developer builds + # use strict config defaults for Git developer builds set(USE_STRICT_DEFAULTS TRUE CACHE INTERNAL "" FORCE) endif() diff --git a/misc/podman/rebuild-stubs/Dockerfile b/misc/podman/rebuild-stubs/Dockerfile index d9eb5bda..525a8d76 100644 --- a/misc/podman/rebuild-stubs/Dockerfile +++ b/misc/podman/rebuild-stubs/Dockerfile @@ -15,7 +15,7 @@ RUN dpkg --add-architecture i386 \ # they do make the image *much* more convenient and also allow building # the full UPX binary inside the container via CMake: 7zip bfs busybox bzip2 cabextract ccache chrpath cmake cpio curl elfutils fd-find file fish fzf \ - g++ gawk gdb gojq ht htop hyperfine jq libzstd-dev lsb-release lz4 lzip lzop \ + g++ gawk gdb gojq ht htop hyperfine jq ksh libzstd-dev lsb-release lz4 lzip lzop \ minify mksh moreutils neovim ninja-build p7zip parallel patch patchelf patchutils pax-utils \ python3 python3-pyasn1 python3-pycryptodome python3-zstd \ re2c ripgrep rsync screen universal-ctags unzip yash yq zip zlib1g-dev zsh zstd \ diff --git a/misc/podman/rebuild-stubs/packages.txt b/misc/podman/rebuild-stubs/packages.txt index 275d3d54..dde59eb0 100644 --- a/misc/podman/rebuild-stubs/packages.txt +++ b/misc/podman/rebuild-stubs/packages.txt @@ -6,7 +6,7 @@ ii apt 2.7.12 amd64 ii aria2 1.37.0+debian-1build2 amd64 High speed download utility ii base-files 13ubuntu9 amd64 Debian base system miscellaneous files ii base-passwd 3.6.3 amd64 Debian base system master password and group files -ii bash 5.2.21-2ubuntu2 amd64 GNU Bourne Again SHell +ii bash 5.2.21-2ubuntu4 amd64 GNU Bourne Again SHell ii bash-completion 1:2.11-8 all programmable completion for the bash shell ii bfs 3.1.2-1build1 amd64 Breadth-first version of find(1) ii binutils 2.42-4ubuntu2 amd64 GNU assembler, linker and binary utilities @@ -22,7 +22,7 @@ ii ccache 4.9.1-1 amd64 ii chrpath 0.16-2build1 amd64 Tool to edit the rpath in ELF binaries ii cmake 3.28.3-1build6 amd64 cross-platform, open-source make system ii cmake-data 3.28.3-1build6 all CMake data files (modules, templates and documentation) -ii coreutils 9.4-3ubuntu5 amd64 GNU core utilities +ii coreutils 9.4-2ubuntu4 amd64 GNU core utilities ii cpio 2.15+dfsg-1ubuntu1 amd64 GNU cpio -- a program to manage archives of files ii cpp 4:13.2.0-7ubuntu1 amd64 GNU C preprocessor (cpp) ii cpp-13 13.2.0-23ubuntu3 amd64 GNU C preprocessor @@ -35,7 +35,7 @@ ii debianutils 5.17build1 amd64 ii diffutils 1:3.10-1 amd64 File comparison utilities ii dpkg 1.22.6ubuntu6 amd64 Debian package management system ii e2fsprogs 1.47.0-2.4~exp1ubuntu3 amd64 ext2/ext3/ext4 file system utilities -ii elfutils 0.190-1.1build3 amd64 collection of utilities to handle ELF objects +ii elfutils 0.190-1.1build4 amd64 collection of utilities to handle ELF objects ii fd-find 9.0.0-1 amd64 Simple, fast and user-friendly alternative to find ii file 1:5.45-3build1 amd64 Recognize the type of data in a file using "magic" numbers ii findutils 4.9.0-5 amd64 utilities for finding files--find, xargs @@ -58,11 +58,11 @@ ii gcc-14-base:amd64 14-20240330-1ubuntu2 amd64 ii gcc-14-base:i386 14-20240330-1ubuntu2 i386 GCC, the GNU Compiler Collection (base package) ii gcc-multilib 4:13.2.0-7ubuntu1 amd64 GNU C compiler (multilib files) ii gcc-x86-64-linux-gnu 4:13.2.0-7ubuntu1 amd64 GNU C compiler for the amd64 architecture -ii gdb 15.0.50.20240219-0ubuntu1 amd64 GNU Debugger +ii gdb 15.0.50.20240403-0ubuntu1 amd64 GNU Debugger ii git 1:2.43.0-1ubuntu6 amd64 fast, scalable, distributed revision control system ii git-man 1:2.43.0-1ubuntu6 all fast, scalable, distributed revision control system (manual pages) ii gojq 0.12.13-1 amd64 pure Go implementation of jq (program) -ii gpgv 2.4.4-2ubuntu16 amd64 GNU privacy guard - signature verification tool +ii gpgv 2.4.4-2ubuntu7 amd64 GNU privacy guard - signature verification tool ii grep 3.11-4 amd64 GNU grep, egrep and fgrep ii groff-base 1.23.0-3build2 amd64 GNU troff text-formatting system (base system components) ii gzip 1.12-1ubuntu2 amd64 GNU compression utilities @@ -72,6 +72,8 @@ ii htop 3.3.0-4 amd64 ii hyperfine 1.18.0-2build1 amd64 Command-line benchmarking tool ii init-system-helpers 1.66ubuntu1 all helper tools for all init systems ii jq 1.7.1-3build1 amd64 lightweight and flexible command-line JSON processor +ii ksh 20240113 all transitional package +ii ksh93u+m 1.0.8-1 amd64 AT&T KornShell ii less 590-2ubuntu2 amd64 pager program similar to more ii lib32asan8 14-20240330-1ubuntu2 amd64 AddressSanitizer -- a fast memory error detector (32bit) ii lib32atomic1 14-20240330-1ubuntu2 amd64 support library providing __atomic built-in functions (32bit) @@ -88,7 +90,7 @@ ii libapt-pkg6.0:amd64 2.7.12 amd64 ii libarchive13t64:amd64 3.7.2-2 amd64 Multi-format archive and compression library (shared library) ii libaria2-0:amd64 1.37.0+debian-1build2 amd64 C++ library interface to aria2 ii libasan8:amd64 14-20240330-1ubuntu2 amd64 AddressSanitizer -- a fast memory error detector -ii libasm1t64:amd64 0.190-1.1build3 amd64 library with a programmable assembler interface +ii libasm1t64:amd64 0.190-1.1build4 amd64 library with a programmable assembler interface ii libassuan0:amd64 2.5.6-1 amd64 IPC library for the GnuPG components ii libatomic1:amd64 14-20240330-1ubuntu2 amd64 support library providing __atomic built-in functions ii libattr1:amd64 1:2.5.2-1 amd64 extended attribute handling - shared library @@ -122,10 +124,10 @@ ii libcurl3t64-gnutls:amd64 8.5.0-2ubuntu9 amd64 ii libcurl4t64:amd64 8.5.0-2ubuntu9 amd64 easy-to-use client-side URL transfer library (OpenSSL flavour) ii libdb5.3t64:amd64 5.3.28+dfsg2-6build1 amd64 Berkeley v5.3 Database Libraries [runtime] ii libdebconfclient0:amd64 0.271ubuntu3 amd64 Debian Configuration Management System (C-implementation library) -ii libdebuginfod-common 0.190-1.1build3 all configuration to enable the Debian debug info server -ii libdebuginfod1t64:amd64 0.190-1.1build3 amd64 library to interact with debuginfod (development files) -ii libdw1t64:amd64 0.190-1.1build3 amd64 library that provides access to the DWARF debug information -ii libelf1t64:amd64 0.190-1.1build3 amd64 library to read and write ELF files +ii libdebuginfod-common 0.190-1.1build4 all configuration to enable the Debian debug info server +ii libdebuginfod1t64:amd64 0.190-1.1build4 amd64 library to interact with debuginfod (development files) +ii libdw1t64:amd64 0.190-1.1build4 amd64 library that provides access to the DWARF debug information +ii libelf1t64:amd64 0.190-1.1build4 amd64 library to read and write ELF files ii liberror-perl 0.17029-2 all Perl module for error/exception handling in an OO-ish way ii libexpat1:amd64 2.6.1-2build1 amd64 XML parsing C library - runtime library ii libext2fs2t64:amd64 1.47.0-2.4~exp1ubuntu3 amd64 ext2/ext3/ext4 file system libraries @@ -153,7 +155,7 @@ ii libipc-run-perl 20231003.0-1 all ii libipt2 2.0.6-1 amd64 Intel Processor Trace Decoder Library ii libisl23:amd64 0.26-3 amd64 manipulating sets and relations of integer points bounded by linear constraints ii libitm1:amd64 14-20240330-1ubuntu2 amd64 GNU Transactional Memory Library -ii libjansson4:amd64 2.14-2 amd64 C library for encoding, decoding and manipulating JSON data +ii libjansson4:amd64 2.14-2build2 amd64 C library for encoding, decoding and manipulating JSON data ii libjq1:amd64 1.7.1-3build1 amd64 lightweight and flexible command-line JSON processor - shared library ii libjsoncpp25:amd64 1.9.5-6 amd64 library for reading and writing JSON for C++ ii libk5crypto3:amd64 1.20.1-6ubuntu2 amd64 MIT Kerberos runtime libraries - Crypto Library @@ -190,22 +192,22 @@ ii libpam-runtime 1.5.3-5ubuntu4 all ii libpam0g:amd64 1.5.3-5ubuntu4 amd64 Pluggable Authentication Modules library ii libpcre2-32-0:amd64 10.42-4ubuntu1 amd64 New Perl Compatible Regular Expression Library - 32 bit runtime files ii libpcre2-8-0:amd64 10.42-4ubuntu1 amd64 New Perl Compatible Regular Expression Library- 8 bit runtime files -ii libperl5.38t64:amd64 5.38.2-3.2build1 amd64 shared Perl library +ii libperl5.38t64:amd64 5.38.2-3.2build2 amd64 shared Perl library ii libpipeline1:amd64 1.5.7-2 amd64 Unix process pipeline manipulation library ii libpopt0:amd64 1.19+dfsg-1 amd64 lib for parsing cmdline parameters ii libproc2-0:amd64 2:4.0.4-4ubuntu3 amd64 library for accessing process information from /proc ii libpsl5t64:amd64 0.21.2-1.1build1 amd64 Library for Public Suffix List (shared libraries) ii libpython2.7-minimal:amd64 2.7.18-8+deb11u1 amd64 Minimal subset of the Python language (version 2.7) ii libpython3-stdlib:amd64 3.12.2-0ubuntu2 amd64 interactive high-level object-oriented language (default python3 version) -ii libpython3.12-minimal:amd64 3.12.2-4build4 amd64 Minimal subset of the Python language (version 3.12) -ii libpython3.12-stdlib:amd64 3.12.2-4build4 amd64 Interactive high-level object-oriented language (standard library, version 3.12) -ii libpython3.12t64:amd64 3.12.2-4build4 amd64 Shared Python runtime library (version 3.12) +ii libpython3.12-minimal:amd64 3.12.2-5ubuntu3 amd64 Minimal subset of the Python language (version 3.12) +ii libpython3.12-stdlib:amd64 3.12.2-5ubuntu3 amd64 Interactive high-level object-oriented language (standard library, version 3.12) +ii libpython3.12t64:amd64 3.12.2-5ubuntu3 amd64 Shared Python runtime library (version 3.12) ii libquadmath0:amd64 14-20240330-1ubuntu2 amd64 GCC Quad-Precision Math Library ii libreadline8t64:amd64 8.2-4build1 amd64 GNU readline and history libraries, run-time libraries ii librhash0:amd64 1.4.3-3 amd64 shared library for hash functions computing ii librtmp1:amd64 2.4+20151223.gitfa8646d.1-2build7 amd64 toolkit for RTMP streams (shared library) -ii libsasl2-2:amd64 2.1.28+dfsg1-5ubuntu2 amd64 Cyrus SASL - authentication abstraction library -ii libsasl2-modules-db:amd64 2.1.28+dfsg1-5ubuntu2 amd64 Cyrus SASL - pluggable authentication modules (DB) +ii libsasl2-2:amd64 2.1.28+dfsg1-5ubuntu3 amd64 Cyrus SASL - authentication abstraction library +ii libsasl2-modules-db:amd64 2.1.28+dfsg1-5ubuntu3 amd64 Cyrus SASL - pluggable authentication modules (DB) ii libseccomp2:amd64 2.5.5-1ubuntu3 amd64 high level interface to Linux seccomp filter ii libselinux1:amd64 3.5-2ubuntu2 amd64 SELinux runtime shared libraries ii libsemanage-common 3.5-1build5 all Common files for SELinux policy management libraries @@ -263,7 +265,7 @@ ii libxxhash0:amd64 0.8.2-2 amd64 ii libyaml-0-2:amd64 0.2.5-1 amd64 Fast YAML 1.1 parser and emitter library ii libzstd-dev:amd64 1.5.5+dfsg2-2 amd64 fast lossless compression algorithm -- development files ii libzstd1:amd64 1.5.5+dfsg2-2 amd64 fast lossless compression algorithm -ii linux-libc-dev:amd64 6.8.0-11.11 amd64 Linux Kernel Headers for development +ii linux-libc-dev:amd64 6.8.0-22.22 amd64 Linux Kernel Headers for development ii login 1:4.13+dfsg1-4ubuntu1 amd64 system login tools ii logsave 1.47.0-2.4~exp1ubuntu3 amd64 save the output of a command in a log file ii lsb-release 12.0-2 all Linux Standard Base version reporting utility (minimal implementation) @@ -276,7 +278,7 @@ ii man-db 2.12.0-4build1 amd64 ii mawk 1.3.4.20240123-1 amd64 Pattern scanning and text processing language ii media-types 10.1.0 all List of standard media types and their usual file extension ii minify 2.20.17-1 amd64 CLI implementation of the Go minify library package -ii mksh 59c-34 amd64 MirBSD Korn Shell +ii mksh 59c-37 amd64 MirBSD Korn Shell ii moreutils 0.69-1 amd64 additional Unix utilities ii mount 2.39.3-9ubuntu4 amd64 tools for mounting and manipulating filesystems ii ncurses-base 6.4+20240113-1ubuntu1 all basic terminal type definitions @@ -294,9 +296,9 @@ ii patch 2.7.6-7build2 amd64 ii patchelf 0.18.0-1.1build1 amd64 modify properties of ELF executables ii patchutils 0.4.2-1build2 amd64 Utilities to work with patches ii pax-utils 1.3.7-1 amd64 Security-focused ELF files checking tool -ii perl 5.38.2-3.2build1 amd64 Larry Wall's Practical Extraction and Report Language -ii perl-base 5.38.2-3.2build1 amd64 minimal Perl system -ii perl-modules-5.38 5.38.2-3.2build1 all Core Perl modules +ii perl 5.38.2-3.2build2 amd64 Larry Wall's Practical Extraction and Report Language +ii perl-base 5.38.2-3.2build2 amd64 minimal Perl system +ii perl-modules-5.38 5.38.2-3.2build2 all Core Perl modules ii procps 2:4.0.4-4ubuntu3 amd64 /proc file system utilities ii python2.7-minimal 2.7.18-8+deb11u1 amd64 Minimal subset of the Python language (version 2.7) ii python3 3.12.2-0ubuntu2 amd64 interactive high-level object-oriented language (default python3 version) @@ -309,8 +311,8 @@ ii python3-toml 0.10.2-1 all ii python3-xmltodict 0.13.0-1 all Makes working with XML feel like you are working with JSON (Python 3) ii python3-yaml 6.0.1-2build2 amd64 YAML parser and emitter for Python3 ii python3-zstd 1.5.5.1-1 amd64 python bindings to Yann Collet ZSTD compression library -ii python3.12 3.12.2-4build4 amd64 Interactive high-level object-oriented language (version 3.12) -ii python3.12-minimal 3.12.2-4build4 amd64 Minimal subset of the Python language (version 3.12) +ii python3.12 3.12.2-5ubuntu3 amd64 Interactive high-level object-oriented language (version 3.12) +ii python3.12-minimal 3.12.2-5ubuntu3 amd64 Minimal subset of the Python language (version 3.12) ii re2c 3.1-1 amd64 lexer generator for C, C++, Go and Rust ii readline-common 8.2-4build1 all GNU readline and history libraries, common files ii ripgrep 14.1.0-1 amd64 Recursively searches directories for a regex pattern @@ -346,7 +348,7 @@ rc libgnutls30:amd64 3.8.3-1ubuntu1 amd64 ||/ Name Version Architecture Description Packages sorted by Installed-Size: - 870769 ===== TOTAL (340 packages) + 873771 ===== TOTAL (342 packages) 72237 gcc-13-x86-64-linux-gnu amd64 37833 g++-13-x86-64-linux-gnu amd64 36493 cmake amd64 @@ -361,7 +363,7 @@ Packages sorted by Installed-Size: 16091 libgcc-13-dev amd64 13430 libc6 amd64 13111 libc6-dev amd64 - 12695 gdb amd64 + 12519 gdb amd64 12321 fish-common all 12296 libc6 i386 12003 libc6-x32 amd64 @@ -371,18 +373,18 @@ Packages sorted by Installed-Size: 10767 libasan8 amd64 9669 libx32asan8 amd64 9568 lib32asan8 amd64 - 8968 libpython3.12-stdlib amd64 - 8896 libpython3.12t64 amd64 + 9013 libpython3.12-stdlib amd64 + 8905 libpython3.12t64 amd64 8884 libtsan2 amd64 8635 lib32gcc-13-dev amd64 8335 libmagic-mgc amd64 8118 libc6-dev-x32 amd64 - 7998 python3.12-minimal amd64 + 7919 python3.12-minimal amd64 7913 perl-base amd64 7493 libx32gcc-13-dev amd64 - 7162 linux-libc-dev amd64 + 7164 linux-libc-dev amd64 6946 libc6-dev-i386 amd64 - 6936 coreutils amd64 + 6944 coreutils amd64 6775 neovim amd64 6743 lib32stdc++-13-dev amd64 6607 libssl3t64 amd64 @@ -411,6 +413,7 @@ Packages sorted by Installed-Size: 3339 libubsan1 amd64 3240 libapt-pkg6.0 amd64 3148 libx32ubsan1 amd64 + 3111 ksh93u+m amd64 3110 libstdc++6 amd64 3102 lib32ubsan1 amd64 2995 parallel all @@ -440,7 +443,7 @@ Packages sorted by Installed-Size: 1736 gawk amd64 1730 libsqlite3-0 amd64 1712 libp11-kit0 amd64 - 1611 mksh amd64 + 1634 mksh amd64 1579 ccache amd64 1504 e2fsprogs amd64 1464 sysstat amd64 @@ -522,8 +525,8 @@ Packages sorted by Installed-Size: 344 grep amd64 340 sed amd64 337 libhogweed6t64 amd64 - 337 gpgv amd64 336 libncurses6 amd64 + 332 gpgv amd64 328 cpio amd64 313 libudev1 amd64 310 libctf-nobfd0 amd64 @@ -619,11 +622,11 @@ Packages sorted by Installed-Size: 97 libcap2 amd64 95 liburing2 amd64 95 libunibilium4 amd64 + 95 libjansson4 amd64 95 libbz2-1.0 amd64 93 media-types all 93 libvterm0 amd64 93 libgdbm6t64 amd64 - 92 libjansson4 amd64 90 libxxhash0 amd64 83 libuuid1 amd64 82 python3 amd64 @@ -645,6 +648,7 @@ Packages sorted by Installed-Size: 63 sensible-utils all 63 libtermkey1 amd64 63 file amd64 + 61 ksh all 60 libcap-ng0 amd64 60 libattr1 amd64 57 libcom-err2 amd64 diff --git a/misc/testsuite/mimic_ctest.sh b/misc/testsuite/mimic_ctest.sh index 7b2ea3dd..c64b3836 100755 --- a/misc/testsuite/mimic_ctest.sh +++ b/misc/testsuite/mimic_ctest.sh @@ -7,6 +7,7 @@ argv0=$0; argv0abs=$(readlink -fn "$argv0"); argv0dir=$(dirname "$argv0abs") # Copyright (C) Markus Franz Xaver Johannes Oberhumer # # mimic running "ctest", i.e. the "test" section of CMakeLists.txt; does not redirect stdout +# (allows freely setting $upx_exe_runner, while CMake is restricted to configure-time settings) # # requires: # $upx_exe (required, but with convenience fallback "./upx") @@ -47,16 +48,32 @@ if ! "${upx_run[@]}" --help >/dev/null; then echo "UPX-ERROR: FATAL: upx --help # see CMakeLists.txt #*********************************************************************** +set_on_off() { + local var_name + for var_name do + case "${!var_name}" in + "" | "0" | "FALSE" | "OFF") eval $var_name=OFF ;; + *) eval $var_name=ON ;; + esac + done +} + +set -x +set_on_off UPX_CONFIG_DISABLE_SELF_PACK_TEST +set_on_off UPX_CONFIG_DISABLE_RUN_UNPACKED_TEST +set_on_off UPX_CONFIG_DISABLE_RUN_PACKED_TEST + export UPX="--no-color --no-progress" "${upx_run[@]}" --version +"${upx_run[@]}" --version-short "${upx_run[@]}" --help +"${upx_run[@]}" --license "${upx_run[@]}" --sysinfo -v -case "$UPX_CONFIG_DISABLE_SELF_PACK_TEST" in -"" | "0" | "FALSE" | "OFF") ;; -*) echo "Self-pack test disabled. All done."; exit 0 ;; -esac +if [[ $UPX_CONFIG_DISABLE_SELF_PACK_TEST == ON ]]; then + echo "Self-pack test disabled. All done."; exit 0 +fi exe=".out" upx_self_exe=$upx_exe @@ -78,17 +95,20 @@ fo="--force-overwrite" "${upx_run[@]}" -d upx-packed-n2e${exe} ${fo} -o upx-unpacked-n2e${exe} "${upx_run[@]}" -d upx-packed-lzma${exe} ${fo} -o upx-unpacked-lzma${exe} -set -x +if [[ $UPX_CONFIG_DISABLE_RUN_UNPACKED_TEST == OFF ]]; then "${upx_runner[@]}" ./upx-unpacked${exe} --version-short "${upx_runner[@]}" ./upx-unpacked-n2b${exe} --version-short "${upx_runner[@]}" ./upx-unpacked-n2d${exe} --version-short "${upx_runner[@]}" ./upx-unpacked-n2e${exe} --version-short "${upx_runner[@]}" ./upx-unpacked-lzma${exe} --version-short +fi +if [[ $UPX_CONFIG_DISABLE_RUN_PACKED_TEST == OFF ]]; then "${upx_runner[@]}" ./upx-packed${exe} --version-short "${upx_runner[@]}" ./upx-packed-n2b${exe} --version-short "${upx_runner[@]}" ./upx-packed-n2d${exe} --version-short "${upx_runner[@]}" ./upx-packed-n2e${exe} --version-short "${upx_runner[@]}" ./upx-packed-lzma${exe} --version-short +fi echo "All done." diff --git a/misc/testsuite/test_symlinks.sh b/misc/testsuite/test_symlinks.sh index a6f9f79f..b7ec5f7f 100755 --- a/misc/testsuite/test_symlinks.sh +++ b/misc/testsuite/test_symlinks.sh @@ -190,11 +190,12 @@ leave_dir() { tmpdir="$(mktemp -d tmp-upx-test-XXXXXX)" cd "./$tmpdir" || exit 1 -if [[ -f /bin/ls ]]; then - test_file="$(readlink -fn /bin/ls)" -else - test_file="$(readlink -fn /usr/bin/env)" -fi +for test_file in /usr/bin/make /usr/bin/gmake /usr/bin/env /bin/ls; do + if [[ -f $test_file ]]; then + test_file="$(readlink -fn "$test_file")" + break + fi +done testsuite_header "default" flags="-qq -1 --no-filter" diff --git a/src/check/dt_check.cpp b/src/check/dt_check.cpp index 6ec9e614..fa363246 100644 --- a/src/check/dt_check.cpp +++ b/src/check/dt_check.cpp @@ -78,7 +78,7 @@ int upx_doctest_check(int argc, char **argv) { context.setOption("dt-duration", true); if (success) context.setOption("dt-success", true); - // this requires that main_get_options() understands "--dt-XXX" options + // this requires that main_get_options() understands/ignores doctest "--dt-XXX" options if (argc > 0 && argv != nullptr) context.applyCommandLine(argc, argv); int r = context.run(); diff --git a/src/check/dt_impl.cpp b/src/check/dt_impl.cpp index d89289c0..93392fb2 100644 --- a/src/check/dt_impl.cpp +++ b/src/check/dt_impl.cpp @@ -49,7 +49,7 @@ #pragma GCC diagnostic ignored "-Wshadow" #endif -#if !defined(UPX_DOCTEST_CONFIG_MULTITHREADING) && !(WITH_THREADS) +#if !(WITH_THREADS) && !defined(UPX_DOCTEST_CONFIG_MULTITHREADING) #ifndef DOCTEST_CONFIG_NO_MULTITHREADING #define DOCTEST_CONFIG_NO_MULTITHREADING #endif diff --git a/src/conf.h b/src/conf.h index 44521979..dbd588b9 100644 --- a/src/conf.h +++ b/src/conf.h @@ -589,7 +589,7 @@ using upx::tribool; // #define M_CL1B_8 12 // #define M_CL1B_LE16 13 #define M_LZMA 14 -#define M_DEFLATE 15 // zlib +#define M_DEFLATE 15 // NOT YET USED #define M_ZSTD 16 // NOT YET USED #define M_BZIP2 17 // NOT YET USED // compression methods internal usage @@ -781,19 +781,19 @@ struct upx_compress_result_t final { // classes class ElfLinker; -typedef ElfLinker Linker; +typedef ElfLinker Linker; // shortcut class Throwable; +// check/dt_check.cpp +noinline void upx_compiler_sanity_check() noexcept; +noinline int upx_doctest_check(int argc, char **argv); +int upx_doctest_check(); + // util/membuffer.h class MemBuffer; void *membuffer_get_void_ptr(MemBuffer &mb) noexcept; unsigned membuffer_get_size(MemBuffer &mb) noexcept; -// util/dt_check.cpp -noinline void upx_compiler_sanity_check() noexcept; -noinline int upx_doctest_check(int argc, char **argv); -int upx_doctest_check(); - // main.cpp extern const char *progname; bool main_set_exit_code(int ec); diff --git a/src/main.cpp b/src/main.cpp index 67dc7a04..ddcb0c7e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -792,7 +792,7 @@ static int do_option(int optc, const char *arg) { break; #if !defined(DOCTEST_CONFIG_DISABLE) - case 999: // doctest --dt-XXX option + case 999: // [doctest] --dt-XXX option; ignored here, see upx_doctest_check() break; #endif @@ -816,7 +816,7 @@ int main_get_options(int argc, char **argv) { // commands {"best", 0x10, N, 900}, // compress best {"brute", 0x10, N, 901}, // compress best, brute force - {"ultra-brute", 0x10, N, 902}, // compress best, brute force + {"ultra-brute", 0x10, N, 902}, // compress best, ultra-brute force {"decompress", 0, N, 'd'}, // decompress {"fast", 0x10, N, '1'}, // compress faster {"fileinfo", 0x10, N, 909}, // display info about file @@ -966,7 +966,7 @@ int main_get_options(int argc, char **argv) { {"strip-relocs", 0x12, N, 634}, {"keep-resource", 0x31, N, 635}, -#if !defined(DOCTEST_CONFIG_DISABLE) +#if !defined(DOCTEST_CONFIG_DISABLE) // accept and ignore some doctest --dt-XXX options // [doctest] Query flags - the program quits after them. Available: {"dt-c", 0x10, N, 999}, {"dt-count", 0x10, N, 999}, @@ -1023,7 +1023,7 @@ void main_get_envoptions() { // commands {"best", 0x10, N, 900}, // compress best {"brute", 0x10, N, 901}, // compress best, brute force - {"ultra-brute", 0x10, N, 902}, // compress best, brute force + {"ultra-brute", 0x10, N, 902}, // compress best, ultra-brute force {"fast", 0x10, N, '1'}, // compress faster // options diff --git a/src/msg.cpp b/src/msg.cpp index 2e66da07..2eca335f 100644 --- a/src/msg.cpp +++ b/src/msg.cpp @@ -143,7 +143,7 @@ void printWarn(const char *iname, const char *format, ...) noexcept { } void printUnhandledException(const char *iname, const std::exception *e) noexcept { - if (e) + if (e != nullptr) printErr(iname, "unhandled exception: %s\n", prettyName(e->what())); else printErr(iname, "internal error: unhandled exception!\n"); diff --git a/src/options.cpp b/src/options.cpp index 3662399c..8d5a7753 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -28,10 +28,10 @@ #include "conf.h" static Options global_options; -Options *opt = &global_options; // also see class PackMaster +Options *opt = &global_options; // also see class PackMaster for per-file local options #if WITH_THREADS -std::mutex opt_lock_mutex; +std::mutex opt_lock_mutex; // for locking "opt" #endif /************************************************************************* diff --git a/src/options.h b/src/options.h index 65709620..c74f4843 100644 --- a/src/options.h +++ b/src/options.h @@ -33,7 +33,7 @@ struct Options; extern Options *opt; // global options, see class PackMaster for per-file local options #if WITH_THREADS -extern std::mutex opt_lock_mutex; +extern std::mutex opt_lock_mutex; // for locking "opt" #endif /************************************************************************* diff --git a/src/packer_c.cpp b/src/packer_c.cpp index 4e94f1e8..23b4e8f3 100644 --- a/src/packer_c.cpp +++ b/src/packer_c.cpp @@ -33,10 +33,8 @@ // compression method util **************************************************************************/ -/*static*/ bool Packer::isValidCompressionMethod(int method) { - if (M_IS_LZMA(method)) - return true; - return method >= M_NRV2B_LE32 && method <= M_LZMA; +/*static*/ bool Packer::isValidCompressionMethod(int m) { + return M_IS_LZMA(m) || M_IS_NRV2B(m) || M_IS_NRV2D(m) || M_IS_NRV2E(m); } const int *Packer::getDefaultCompressionMethods_8(int method, int level, int small) const {