diff --git a/README.SRC b/README.SRC index d2df66e5..684998e8 100644 --- a/README.SRC +++ b/README.SRC @@ -61,7 +61,7 @@ To compile the packer sources If you want to modify the stub sources you'll also need ------------------------------------------------------- - - Podman/Docker: see misc/rebuild-stubs-with-podman - this + - Podman/Docker: see misc/podman/rebuild-stubs - this is the preferred way of rebuilding the stubs - otherwise you will need: diff --git a/misc/cross-compile-upx-with-podman/10-create-image.sh b/misc/podman/cross-compile-upx-ubuntu/10-create-image.sh similarity index 81% rename from misc/cross-compile-upx-with-podman/10-create-image.sh rename to misc/podman/cross-compile-upx-ubuntu/10-create-image.sh index 69689475..058d8739 100755 --- a/misc/cross-compile-upx-with-podman/10-create-image.sh +++ b/misc/podman/cross-compile-upx-ubuntu/10-create-image.sh @@ -6,10 +6,10 @@ argv0=$0; argv0abs="$(readlink -fn "$argv0")"; argv0dir="$(dirname "$argv0abs")" # create the image from Dockerfile # using a rootless Podman container -# NOTE: this image is based on rebuild-stubs-with-podman/upx-stubtools-20221212-v6, +# NOTE: this image is based on rebuild-stubs/upx-stubtools-20221212-v6, # so you have to create that image first # WARNING: we install many packages, so the resulting image needs A LOT of disk space! -image=upx-cross-compile-20230115-v4 +image=upx-cross-compile-ubuntu2204-20230721-v1 [[ $1 == --print-image ]] && echo "$image" && exit 0 podman build -t "$image" -f "$argv0dir/Dockerfile" "$argv0dir" diff --git a/misc/cross-compile-upx-with-podman/11-list-packages.sh b/misc/podman/cross-compile-upx-ubuntu/11-list-packages.sh similarity index 100% rename from misc/cross-compile-upx-with-podman/11-list-packages.sh rename to misc/podman/cross-compile-upx-ubuntu/11-list-packages.sh diff --git a/misc/cross-compile-upx-with-podman/20-image-run-shell.sh b/misc/podman/cross-compile-upx-ubuntu/20-image-run-shell.sh similarity index 89% rename from misc/cross-compile-upx-with-podman/20-image-run-shell.sh rename to misc/podman/cross-compile-upx-ubuntu/20-image-run-shell.sh index 1c445176..3712795a 100755 --- a/misc/cross-compile-upx-with-podman/20-image-run-shell.sh +++ b/misc/podman/cross-compile-upx-ubuntu/20-image-run-shell.sh @@ -21,7 +21,7 @@ if [[ 1 == 1 ]]; then flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 ) # NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx # INFO: SELinux users *may* have to add ":z" to the volume mount flags; check the docs! - flags+=( -v "${argv0dir}/../..:/home/upx/src/upx" ) + flags+=( -v "${argv0dir}/../../..:/home/upx/src/upx" ) flags+=( -w /home/upx/src/upx ) # set working directory flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs @@ -51,10 +51,10 @@ fi # and lots of other cross-compilers are installed; see "ls /usr/bin/*g++*" # and finally see -# ./misc/cross-compile-upx-with-podman/build-all-inside-container.sh +# ./misc/podman/cross-compile-upx-ubuntu/build-all-inside-container.sh # after running that script we can do cool things like: -# cd /home/upx/src/upx/build/cross-compile-upx-with-podman/alpha-linux-gnu/debug +# cd /home/upx/src/upx/build/cross-compile-upx-ubuntu2204/alpha-linux-gnu/debug # qemu-alpha -L /usr/alpha-linux-gnu ./upx --version -# cd /home/upx/src/upx/build/cross-compile-upx-with-podman/hppa-linux-gnu/debug +# cd /home/upx/src/upx/build/cross-compile-upx-ubuntu2204/hppa-linux-gnu/debug # qemu-hppa -L /usr/hppa-linux-gnu ./upx --version # (similar for many other architectures/builds) diff --git a/misc/cross-compile-upx-with-podman/Dockerfile b/misc/podman/cross-compile-upx-ubuntu/Dockerfile similarity index 92% rename from misc/cross-compile-upx-with-podman/Dockerfile rename to misc/podman/cross-compile-upx-ubuntu/Dockerfile index caa4caba..24eafa64 100644 --- a/misc/cross-compile-upx-with-podman/Dockerfile +++ b/misc/podman/cross-compile-upx-ubuntu/Dockerfile @@ -1,8 +1,8 @@ -# NOTE: this image is based on rebuild-stubs-with-podman/upx-stubtools-20221212-v6, +# NOTE: this image is based on rebuild-stubs/upx-stubtools-20221212-v6, # so you have to create that image first # WARNING: we install many packages, so the resulting image needs A LOT of disk space! FROM localhost/upx-stubtools-20221212-v6 -ENV UPX_CONTAINER_IMAGE_NAME=upx-cross-compile-20230115-v4 +ENV UPX_CONTAINER_IMAGE_NAME=upx-cross-compile-ubuntu2204-20230721-v1 ARG DEBIAN_FRONTEND=noninteractive USER root diff --git a/misc/cross-compile-upx-with-podman/build-all-inside-container.sh b/misc/podman/cross-compile-upx-ubuntu/build-all-inside-container.sh similarity index 89% rename from misc/cross-compile-upx-with-podman/build-all-inside-container.sh rename to misc/podman/cross-compile-upx-ubuntu/build-all-inside-container.sh index 9b5d0b57..b893604e 100755 --- a/misc/cross-compile-upx-with-podman/build-all-inside-container.sh +++ b/misc/podman/cross-compile-upx-ubuntu/build-all-inside-container.sh @@ -13,7 +13,7 @@ if [[ $UPX_CONTAINER_IMAGE_NAME != upx-cross-compile-* ]]; then fi # go to upx top-level directory -cd "$argv0dir/../.." || exit 1 +cd "$argv0dir/../../.." || exit 1 pwd test -f doc/upx.pod || exit 1 # sanity check test -f src/version.h || exit 1 # sanity check @@ -44,14 +44,15 @@ function run_config_and_build { fi # for all build types for build_type in Debug Release; do - bdir=build/cross-compile-upx-with-podman/$toolchain/${build_type,,} - mkdir -p $bdir + bdir="build/cross-compile-upx-ubuntu2204/$toolchain/${build_type,,}" + mkdir -p "$bdir" # run_config if [[ ! -f $bdir/CMakeCache.txt ]]; then - cmake -S . -B $bdir -DCMAKE_BUILD_TYPE=$build_type -DCMAKE_AR=$AR -DCMAKE_RANLIB=$RANLIB $cmake_config_flags + export CMAKE_REQUIRED_QUIET=OFF + cmake -S . -B "$bdir" -DCMAKE_BUILD_TYPE=$build_type -DCMAKE_AR=$AR -DCMAKE_RANLIB=$RANLIB $cmake_config_flags fi # run_build - cmake --build $bdir --config $build_type --parallel + cmake --build "$bdir" --config $build_type --parallel done } diff --git a/misc/cross-compile-upx-with-podman/packages.txt b/misc/podman/cross-compile-upx-ubuntu/packages.txt similarity index 99% rename from misc/cross-compile-upx-with-podman/packages.txt rename to misc/podman/cross-compile-upx-ubuntu/packages.txt index 0da92ca9..9492430e 100644 --- a/misc/cross-compile-upx-with-podman/packages.txt +++ b/misc/podman/cross-compile-upx-ubuntu/packages.txt @@ -6,7 +6,7 @@ ii acl 2.3.1-1 ii adduser 3.118ubuntu5 all add and remove users and groups ii adwaita-icon-theme 41.0-1ubuntu1 all default icon theme of GNOME (small subset) ii alsa-topology-conf 1.2.5.1-2 all ALSA topology configuration files -ii alsa-ucm-conf 1.2.6.3-1ubuntu1.6 all ALSA Use Case Manager configuration files +ii alsa-ucm-conf 1.2.6.3-1ubuntu1.7 all ALSA Use Case Manager configuration files ii apt 2.4.9 amd64 commandline package manager ii aria2 1.36.0-1 amd64 High speed download utility ii at-spi2-core 2.44.0-3 amd64 Assistive Technology Service Provider Interface (dbus core) @@ -96,7 +96,7 @@ ii cpp-sh4-linux-gnu 4:11.2.0--1ubuntu1 ii cpp-sparc64-linux-gnu 4:11.2.0--1ubuntu1 amd64 GNU C preprocessor (cpp) for the sparc64 architecture ii cpp-x86-64-linux-gnux32 4:11.2.0--1ubuntu1 amd64 GNU C preprocessor (cpp) for the x32 architecture ii cpu-checker 0.7-1.3build1 amd64 tools to help evaluate certain CPU (or BIOS) features -ii curl 7.81.0-1ubuntu1.10 amd64 command line tool for transferring data with URL syntax +ii curl 7.81.0-1ubuntu1.13 amd64 command line tool for transferring data with URL syntax ii dash 0.5.11+git20210903+057cd650a4ed-3build1 amd64 POSIX-compliant shell ii dbus 1.12.20-2ubuntu4.1 amd64 simple interprocess messaging system (daemon and utilities) ii dbus-user-session 1.12.20-2ubuntu4.1 amd64 simple interprocess messaging system (systemd --user integration) @@ -450,9 +450,9 @@ ii libctf-nobfd0:amd64 2.38-4ubuntu2.2 ii libctf0:amd64 2.38-4ubuntu2.2 amd64 Compact C Type Format library (runtime, BFD dependency) ii libcups2:amd64 2.4.1op1-1ubuntu4.4 amd64 Common UNIX Printing System(tm) - Core library ii libcups2:i386 2.4.1op1-1ubuntu4.4 i386 Common UNIX Printing System(tm) - Core library -ii libcurl3-gnutls:amd64 7.81.0-1ubuntu1.10 amd64 easy-to-use client-side URL transfer library (GnuTLS flavour) -ii libcurl4:amd64 7.81.0-1ubuntu1.10 amd64 easy-to-use client-side URL transfer library (OpenSSL flavour) -ii libcurl4:i386 7.81.0-1ubuntu1.10 i386 easy-to-use client-side URL transfer library (OpenSSL flavour) +ii libcurl3-gnutls:amd64 7.81.0-1ubuntu1.13 amd64 easy-to-use client-side URL transfer library (GnuTLS flavour) +ii libcurl4:amd64 7.81.0-1ubuntu1.13 amd64 easy-to-use client-side URL transfer library (OpenSSL flavour) +ii libcurl4:i386 7.81.0-1ubuntu1.13 i386 easy-to-use client-side URL transfer library (OpenSSL flavour) ii libdatrie1:amd64 0.2.13-2 amd64 Double-array trie library ii libdatrie1:i386 0.2.13-2 i386 Double-array trie library ii libdaxctl1:amd64 72.1-1 amd64 Utility library for managing the device DAX subsystem @@ -695,8 +695,8 @@ ii libldap-2.5-0:i386 2.5.14+dfsg-0ubuntu0.22.04.2 ii libldap-common 2.5.14+dfsg-0ubuntu0.22.04.2 all OpenLDAP common files for libraries ii liblldb-14 1:14.0.0-1ubuntu1 amd64 Next generation, high-performance debugger, library ii libllvm14:amd64 1:14.0.0-1ubuntu1 amd64 Modular compiler and toolchain technologies, runtime library -ii libllvm15:amd64 1:15.0.7-0ubuntu0.22.04.1 amd64 Modular compiler and toolchain technologies, runtime library -ii libllvm15:i386 1:15.0.7-0ubuntu0.22.04.1 i386 Modular compiler and toolchain technologies, runtime library +ii libllvm15:amd64 1:15.0.7-0ubuntu0.22.04.2 amd64 Modular compiler and toolchain technologies, runtime library +ii libllvm15:i386 1:15.0.7-0ubuntu0.22.04.2 i386 Modular compiler and toolchain technologies, runtime library ii liblsan0-arm64-cross 12.1.0-2ubuntu1~22.04cross1 all LeakSanitizer -- a memory leak detector (runtime) ii liblsan0-ppc64-cross 12.1.0-2ubuntu1~22.04cross1 all LeakSanitizer -- a memory leak detector (runtime) ii liblsan0-ppc64el-cross 12.1.0-2ubuntu1~22.04cross1 all LeakSanitizer -- a memory leak detector (runtime) @@ -1156,23 +1156,23 @@ ii python3-six 1.16.0-3ubuntu1 ii python3-yaml 5.4.1-1ubuntu1 amd64 YAML parser and emitter for Python3 ii python3.10 3.10.6-1~22.04.2ubuntu1.1 amd64 Interactive high-level object-oriented language (version 3.10) ii python3.10-minimal 3.10.6-1~22.04.2ubuntu1.1 amd64 Minimal subset of the Python language (version 3.10) -ii qemu-block-extra 1:6.2+dfsg-2ubuntu6.11 amd64 extra block backend modules for qemu-system and qemu-utils +ii qemu-block-extra 1:6.2+dfsg-2ubuntu6.12 amd64 extra block backend modules for qemu-system and qemu-utils ii qemu-efi-aarch64 2022.02-3ubuntu0.22.04.1 all UEFI firmware for 64-bit ARM virtual machines ii qemu-efi-arm 2022.02-3ubuntu0.22.04.1 all UEFI firmware for 32-bit ARM virtual machines -ii qemu-system 1:6.2+dfsg-2ubuntu6.11 amd64 QEMU full system emulation binaries -ii qemu-system-arm 1:6.2+dfsg-2ubuntu6.11 amd64 QEMU full system emulation binaries (arm) -ii qemu-system-common 1:6.2+dfsg-2ubuntu6.11 amd64 QEMU full system emulation binaries (common files) -ii qemu-system-data 1:6.2+dfsg-2ubuntu6.11 all QEMU full system emulation (data files) -ii qemu-system-gui 1:6.2+dfsg-2ubuntu6.11 amd64 QEMU full system emulation binaries (user interface and audio support) -ii qemu-system-mips 1:6.2+dfsg-2ubuntu6.11 amd64 QEMU full system emulation binaries (mips) -ii qemu-system-misc 1:6.2+dfsg-2ubuntu6.11 amd64 QEMU full system emulation binaries (miscellaneous) -ii qemu-system-ppc 1:6.2+dfsg-2ubuntu6.11 amd64 QEMU full system emulation binaries (ppc) -ii qemu-system-s390x 1:6.2+dfsg-2ubuntu6.11 amd64 QEMU full system emulation binaries (s390x) -ii qemu-system-sparc 1:6.2+dfsg-2ubuntu6.11 amd64 QEMU full system emulation binaries (sparc) -ii qemu-system-x86 1:6.2+dfsg-2ubuntu6.11 amd64 QEMU full system emulation binaries (x86) -ii qemu-user 1:6.2+dfsg-2ubuntu6.11 amd64 QEMU user mode emulation binaries -ii qemu-user-binfmt 1:6.2+dfsg-2ubuntu6.11 amd64 QEMU user mode binfmt registration for qemu-user -ii qemu-utils 1:6.2+dfsg-2ubuntu6.11 amd64 QEMU utilities +ii qemu-system 1:6.2+dfsg-2ubuntu6.12 amd64 QEMU full system emulation binaries +ii qemu-system-arm 1:6.2+dfsg-2ubuntu6.12 amd64 QEMU full system emulation binaries (arm) +ii qemu-system-common 1:6.2+dfsg-2ubuntu6.12 amd64 QEMU full system emulation binaries (common files) +ii qemu-system-data 1:6.2+dfsg-2ubuntu6.12 all QEMU full system emulation (data files) +ii qemu-system-gui 1:6.2+dfsg-2ubuntu6.12 amd64 QEMU full system emulation binaries (user interface and audio support) +ii qemu-system-mips 1:6.2+dfsg-2ubuntu6.12 amd64 QEMU full system emulation binaries (mips) +ii qemu-system-misc 1:6.2+dfsg-2ubuntu6.12 amd64 QEMU full system emulation binaries (miscellaneous) +ii qemu-system-ppc 1:6.2+dfsg-2ubuntu6.12 amd64 QEMU full system emulation binaries (ppc) +ii qemu-system-s390x 1:6.2+dfsg-2ubuntu6.12 amd64 QEMU full system emulation binaries (s390x) +ii qemu-system-sparc 1:6.2+dfsg-2ubuntu6.12 amd64 QEMU full system emulation binaries (sparc) +ii qemu-system-x86 1:6.2+dfsg-2ubuntu6.12 amd64 QEMU full system emulation binaries (x86) +ii qemu-user 1:6.2+dfsg-2ubuntu6.12 amd64 QEMU user mode emulation binaries +ii qemu-user-binfmt 1:6.2+dfsg-2ubuntu6.12 amd64 QEMU user mode binfmt registration for qemu-user +ii qemu-utils 1:6.2+dfsg-2ubuntu6.12 amd64 QEMU utilities ii re2c 3.0-1 amd64 lexer generator for C, C++, Go and Rust ii readline-common 8.1.2-1 all GNU readline and history libraries, common files ii ripgrep 13.0.0-2ubuntu0.1 amd64 Recursively searches directories for a regex pattern @@ -1200,9 +1200,9 @@ ii usrmerge 25ubuntu2 ii util-linux 2.37.2-4ubuntu3 amd64 miscellaneous system utilities ii uuid-runtime 2.37.2-4ubuntu3 amd64 runtime components for the Universally Unique ID library ii valgrind 1:3.18.1-1ubuntu2 amd64 instrumentation framework for building dynamic analysis tools -ii vim 2:8.2.3995-1ubuntu2.8 amd64 Vi IMproved - enhanced vi editor -ii vim-common 2:8.2.3995-1ubuntu2.8 all Vi IMproved - Common files -ii vim-runtime 2:8.2.3995-1ubuntu2.8 all Vi IMproved - Runtime files +ii vim 2:8.2.3995-1ubuntu2.9 amd64 Vi IMproved - enhanced vi editor +ii vim-common 2:8.2.3995-1ubuntu2.9 all Vi IMproved - Common files +ii vim-runtime 2:8.2.3995-1ubuntu2.9 all Vi IMproved - Runtime files ii wget 1.21.2-2ubuntu1 amd64 retrieves files from the web ii wine 6.0.3~repack-1 all Windows API implementation - standard suite ii wine32:i386 6.0.3~repack-1 i386 Windows API implementation - 32-bit binary loader @@ -1210,7 +1210,7 @@ ii wine64 6.0.3~repack-1 ii x11-common 1:7.7+23ubuntu2 all X Window System (X.Org) infrastructure ii xdg-user-dirs 0.17-2ubuntu4 amd64 tool to manage well known user directories ii xkb-data 2.33-1 all X Keyboard Extension (XKB) configuration data -ii xxd 2:8.2.3995-1ubuntu2.8 amd64 tool to make (or reverse) a hex dump +ii xxd 2:8.2.3995-1ubuntu2.9 amd64 tool to make (or reverse) a hex dump ii xz-utils 5.2.5-2ubuntu1 amd64 XZ-format compression utilities ii yash 2.51-1 amd64 yet another shell ii zip 3.0-12build2 amd64 Archiver for .zip files @@ -1225,7 +1225,7 @@ ii zstd 1.4.8+dfsg-3build1 ||/ Name Version Architecture Description Packages sorted by Installed-Size: - 8312145 ===== TOTAL (1219 packages) + 8312149 ===== TOTAL (1219 packages) 545062 libwine amd64 474522 libwine i386 270993 llvm-14-dev amd64 @@ -1248,7 +1248,7 @@ Packages sorted by Installed-Size: 62269 gcc-mingw-w64-x86-64-win32-runtime amd64 59580 gcc-11-x86-64-linux-gnux32 amd64 59580 gcc-11-i686-linux-gnu amd64 - 59006 qemu-system-mips amd64 + 59002 qemu-system-mips amd64 58528 mingw-w64-common all 58413 gcc-11-aarch64-linux-gnu amd64 57248 libclang-cpp14 amd64 @@ -1329,7 +1329,7 @@ Packages sorted by Installed-Size: 21312 cpp-10-mips64el-linux-gnuabi64 amd64 21312 cpp-10-mips64-linux-gnuabi64 amd64 21312 cpp-10-mips-linux-gnu amd64 - 21160 qemu-system-sparc amd64 + 21164 qemu-system-sparc amd64 21064 cpp-11-sparc64-linux-gnu amd64 20742 cmake amd64 20701 libstdc++-11-dev-alpha-cross all @@ -1719,10 +1719,10 @@ Packages sorted by Installed-Size: 564 libssh-4 i386 563 libpango-1.0-0 amd64 560 libglx-mesa0 amd64 + 560 alsa-ucm-conf all 558 libtinfo6 amd64 558 libodbc2 i386 557 libmount1 i386 - 556 alsa-ucm-conf all 552 libgl1 i386 549 libvulkan1 i386 544 libtinfo5 amd64 diff --git a/misc/rebuild-stubs-with-podman/10-create-image.sh b/misc/podman/rebuild-stubs/10-create-image.sh similarity index 100% rename from misc/rebuild-stubs-with-podman/10-create-image.sh rename to misc/podman/rebuild-stubs/10-create-image.sh diff --git a/misc/rebuild-stubs-with-podman/11-list-packages.sh b/misc/podman/rebuild-stubs/11-list-packages.sh similarity index 100% rename from misc/rebuild-stubs-with-podman/11-list-packages.sh rename to misc/podman/rebuild-stubs/11-list-packages.sh diff --git a/misc/rebuild-stubs-with-podman/20-image-run-shell.sh b/misc/podman/rebuild-stubs/20-image-run-shell.sh similarity index 98% rename from misc/rebuild-stubs-with-podman/20-image-run-shell.sh rename to misc/podman/rebuild-stubs/20-image-run-shell.sh index 478c3408..1dfd708c 100755 --- a/misc/rebuild-stubs-with-podman/20-image-run-shell.sh +++ b/misc/podman/rebuild-stubs/20-image-run-shell.sh @@ -21,7 +21,7 @@ if [[ 1 == 1 ]]; then flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 ) # NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx # INFO: SELinux users *may* have to add ":z" to the volume mount flags; check the docs! - flags+=( -v "${argv0dir}/../..:/home/upx/src/upx" ) + flags+=( -v "${argv0dir}/../../..:/home/upx/src/upx" ) flags+=( -w /home/upx/src/upx ) # set working directory flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs diff --git a/misc/rebuild-stubs-with-podman/Dockerfile b/misc/podman/rebuild-stubs/Dockerfile similarity index 100% rename from misc/rebuild-stubs-with-podman/Dockerfile rename to misc/podman/rebuild-stubs/Dockerfile diff --git a/misc/rebuild-stubs-with-podman/packages.txt b/misc/podman/rebuild-stubs/packages.txt similarity index 99% rename from misc/rebuild-stubs-with-podman/packages.txt rename to misc/podman/rebuild-stubs/packages.txt index 8c0beced..e5db4347 100644 --- a/misc/rebuild-stubs-with-podman/packages.txt +++ b/misc/podman/rebuild-stubs/packages.txt @@ -26,7 +26,7 @@ ii coreutils 8.32-4.1ubuntu1 amd64 ii cpio 2.13+dfsg-7 amd64 GNU cpio -- a program to manage archives of files ii cpp 4:11.2.0-1ubuntu1 amd64 GNU C preprocessor (cpp) ii cpp-11 11.3.0-1ubuntu1~22.04.1 amd64 GNU C preprocessor -ii curl 7.81.0-1ubuntu1.10 amd64 command line tool for transferring data with URL syntax +ii curl 7.81.0-1ubuntu1.13 amd64 command line tool for transferring data with URL syntax ii dash 0.5.11+git20210903+057cd650a4ed-3build1 amd64 POSIX-compliant shell ii debconf 1.5.79ubuntu1 all Debian configuration management system ii debianutils 5.5-1ubuntu2 amd64 Miscellaneous utilities specific to Debian @@ -113,8 +113,8 @@ ii libcrypt1:amd64 1:4.4.27-1 amd64 ii libcrypt1:i386 1:4.4.27-1 i386 libcrypt shared library ii libctf-nobfd0:amd64 2.38-4ubuntu2.2 amd64 Compact C Type Format library (runtime, no BFD dependency) ii libctf0:amd64 2.38-4ubuntu2.2 amd64 Compact C Type Format library (runtime, BFD dependency) -ii libcurl3-gnutls:amd64 7.81.0-1ubuntu1.10 amd64 easy-to-use client-side URL transfer library (GnuTLS flavour) -ii libcurl4:amd64 7.81.0-1ubuntu1.10 amd64 easy-to-use client-side URL transfer library (OpenSSL flavour) +ii libcurl3-gnutls:amd64 7.81.0-1ubuntu1.13 amd64 easy-to-use client-side URL transfer library (GnuTLS flavour) +ii libcurl4:amd64 7.81.0-1ubuntu1.13 amd64 easy-to-use client-side URL transfer library (OpenSSL flavour) ii libdb5.3:amd64 5.3.28+dfsg1-0.8ubuntu3 amd64 Berkeley v5.3 Database Libraries [runtime] ii libdebconfclient0:amd64 0.261ubuntu1 amd64 Debian Configuration Management System (C-implementation library) ii libdebuginfod-common 0.186-1build1 all configuration to enable the Debian debug info server diff --git a/misc/test-qemu-with-podman/README.md b/misc/podman/test-qemu/README.md similarity index 98% rename from misc/test-qemu-with-podman/README.md rename to misc/podman/test-qemu/README.md index c2f65a17..efe2f143 100644 --- a/misc/test-qemu-with-podman/README.md +++ b/misc/podman/test-qemu/README.md @@ -1,4 +1,4 @@ -test-qemu-with-podman +test-qemu with Podman ===================== This directory provides some simple scripts for creating and running diff --git a/misc/test-qemu-with-podman/test-qemu2-alpine/10-create-image.sh b/misc/podman/test-qemu/test-qemu2-alpine/10-create-image.sh similarity index 100% rename from misc/test-qemu-with-podman/test-qemu2-alpine/10-create-image.sh rename to misc/podman/test-qemu/test-qemu2-alpine/10-create-image.sh diff --git a/misc/test-qemu-with-podman/test-qemu2-alpine/11-list-packages.sh b/misc/podman/test-qemu/test-qemu2-alpine/11-list-packages.sh similarity index 100% rename from misc/test-qemu-with-podman/test-qemu2-alpine/11-list-packages.sh rename to misc/podman/test-qemu/test-qemu2-alpine/11-list-packages.sh diff --git a/misc/test-qemu-with-podman/test-qemu5-alpine/20-image-run-shell.sh b/misc/podman/test-qemu/test-qemu2-alpine/20-image-run-shell.sh similarity index 96% rename from misc/test-qemu-with-podman/test-qemu5-alpine/20-image-run-shell.sh rename to misc/podman/test-qemu/test-qemu2-alpine/20-image-run-shell.sh index 102ca91c..d4f61f5d 100755 --- a/misc/test-qemu-with-podman/test-qemu5-alpine/20-image-run-shell.sh +++ b/misc/podman/test-qemu/test-qemu2-alpine/20-image-run-shell.sh @@ -21,7 +21,7 @@ if [[ 1 == 1 ]]; then flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 ) # NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx # INFO: SELinux users *may* have to add ":z" to the volume mount flags; check the docs! - flags+=( -v "${argv0dir}/../../..:/home/upx/src/upx" ) + flags+=( -v "${argv0dir}/../../../..:/home/upx/src/upx" ) flags+=( -w /home/upx/src/upx ) # set working directory flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs diff --git a/misc/test-qemu-with-podman/test-qemu2-alpine/Dockerfile b/misc/podman/test-qemu/test-qemu2-alpine/Dockerfile similarity index 84% rename from misc/test-qemu-with-podman/test-qemu2-alpine/Dockerfile rename to misc/podman/test-qemu/test-qemu2-alpine/Dockerfile index 567e4d56..a2be6177 100644 --- a/misc/test-qemu-with-podman/test-qemu2-alpine/Dockerfile +++ b/misc/podman/test-qemu/test-qemu2-alpine/Dockerfile @@ -5,14 +5,19 @@ RUN apk update && apk upgrade && apk add \ bash-completion \ musl-dbg \ qemu-aarch64 \ + qemu-aarch64_be \ qemu-arm \ qemu-armeb \ qemu-i386 \ + qemu-m68k \ qemu-mips \ qemu-mipsel \ qemu-ppc \ qemu-ppc64 \ qemu-ppc64le \ + qemu-riscv32 \ + qemu-riscv64 \ + qemu-s390x \ qemu-x86_64 \ strace \ && true diff --git a/misc/test-qemu-with-podman/test-qemu3-alpine/10-create-image.sh b/misc/podman/test-qemu/test-qemu3-alpine/10-create-image.sh similarity index 100% rename from misc/test-qemu-with-podman/test-qemu3-alpine/10-create-image.sh rename to misc/podman/test-qemu/test-qemu3-alpine/10-create-image.sh diff --git a/misc/test-qemu-with-podman/test-qemu3-alpine/11-list-packages.sh b/misc/podman/test-qemu/test-qemu3-alpine/11-list-packages.sh similarity index 100% rename from misc/test-qemu-with-podman/test-qemu3-alpine/11-list-packages.sh rename to misc/podman/test-qemu/test-qemu3-alpine/11-list-packages.sh diff --git a/misc/test-qemu-with-podman/test-qemu3-alpine/20-image-run-shell.sh b/misc/podman/test-qemu/test-qemu3-alpine/20-image-run-shell.sh similarity index 96% rename from misc/test-qemu-with-podman/test-qemu3-alpine/20-image-run-shell.sh rename to misc/podman/test-qemu/test-qemu3-alpine/20-image-run-shell.sh index 102ca91c..d4f61f5d 100755 --- a/misc/test-qemu-with-podman/test-qemu3-alpine/20-image-run-shell.sh +++ b/misc/podman/test-qemu/test-qemu3-alpine/20-image-run-shell.sh @@ -21,7 +21,7 @@ if [[ 1 == 1 ]]; then flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 ) # NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx # INFO: SELinux users *may* have to add ":z" to the volume mount flags; check the docs! - flags+=( -v "${argv0dir}/../../..:/home/upx/src/upx" ) + flags+=( -v "${argv0dir}/../../../..:/home/upx/src/upx" ) flags+=( -w /home/upx/src/upx ) # set working directory flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs diff --git a/misc/test-qemu-with-podman/test-qemu3-alpine/Dockerfile b/misc/podman/test-qemu/test-qemu3-alpine/Dockerfile similarity index 84% rename from misc/test-qemu-with-podman/test-qemu3-alpine/Dockerfile rename to misc/podman/test-qemu/test-qemu3-alpine/Dockerfile index af394426..863b4cdc 100644 --- a/misc/test-qemu-with-podman/test-qemu3-alpine/Dockerfile +++ b/misc/podman/test-qemu/test-qemu3-alpine/Dockerfile @@ -5,14 +5,19 @@ RUN apk update && apk upgrade && apk add \ bash-completion \ musl-dbg \ qemu-aarch64 \ + qemu-aarch64_be \ qemu-arm \ qemu-armeb \ qemu-i386 \ + qemu-m68k \ qemu-mips \ qemu-mipsel \ qemu-ppc \ qemu-ppc64 \ qemu-ppc64le \ + qemu-riscv32 \ + qemu-riscv64 \ + qemu-s390x \ qemu-x86_64 \ strace \ && true diff --git a/misc/test-qemu-with-podman/test-qemu4-alpine/10-create-image.sh b/misc/podman/test-qemu/test-qemu4-alpine/10-create-image.sh similarity index 100% rename from misc/test-qemu-with-podman/test-qemu4-alpine/10-create-image.sh rename to misc/podman/test-qemu/test-qemu4-alpine/10-create-image.sh diff --git a/misc/test-qemu-with-podman/test-qemu4-alpine/11-list-packages.sh b/misc/podman/test-qemu/test-qemu4-alpine/11-list-packages.sh similarity index 100% rename from misc/test-qemu-with-podman/test-qemu4-alpine/11-list-packages.sh rename to misc/podman/test-qemu/test-qemu4-alpine/11-list-packages.sh diff --git a/misc/test-qemu-with-podman/test-qemu2-alpine/20-image-run-shell.sh b/misc/podman/test-qemu/test-qemu4-alpine/20-image-run-shell.sh similarity index 96% rename from misc/test-qemu-with-podman/test-qemu2-alpine/20-image-run-shell.sh rename to misc/podman/test-qemu/test-qemu4-alpine/20-image-run-shell.sh index 102ca91c..d4f61f5d 100755 --- a/misc/test-qemu-with-podman/test-qemu2-alpine/20-image-run-shell.sh +++ b/misc/podman/test-qemu/test-qemu4-alpine/20-image-run-shell.sh @@ -21,7 +21,7 @@ if [[ 1 == 1 ]]; then flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 ) # NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx # INFO: SELinux users *may* have to add ":z" to the volume mount flags; check the docs! - flags+=( -v "${argv0dir}/../../..:/home/upx/src/upx" ) + flags+=( -v "${argv0dir}/../../../..:/home/upx/src/upx" ) flags+=( -w /home/upx/src/upx ) # set working directory flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs diff --git a/misc/test-qemu-with-podman/test-qemu4-alpine/Dockerfile b/misc/podman/test-qemu/test-qemu4-alpine/Dockerfile similarity index 84% rename from misc/test-qemu-with-podman/test-qemu4-alpine/Dockerfile rename to misc/podman/test-qemu/test-qemu4-alpine/Dockerfile index 000f6537..d7f69dcf 100644 --- a/misc/test-qemu-with-podman/test-qemu4-alpine/Dockerfile +++ b/misc/podman/test-qemu/test-qemu4-alpine/Dockerfile @@ -5,14 +5,19 @@ RUN apk update && apk upgrade && apk add \ bash-completion \ musl-dbg \ qemu-aarch64 \ + qemu-aarch64_be \ qemu-arm \ qemu-armeb \ qemu-i386 \ + qemu-m68k \ qemu-mips \ qemu-mipsel \ qemu-ppc \ qemu-ppc64 \ qemu-ppc64le \ + qemu-riscv32 \ + qemu-riscv64 \ + qemu-s390x \ qemu-x86_64 \ strace \ && true diff --git a/misc/test-qemu-with-podman/test-qemu5-alpine/10-create-image.sh b/misc/podman/test-qemu/test-qemu5-alpine/10-create-image.sh similarity index 100% rename from misc/test-qemu-with-podman/test-qemu5-alpine/10-create-image.sh rename to misc/podman/test-qemu/test-qemu5-alpine/10-create-image.sh diff --git a/misc/test-qemu-with-podman/test-qemu5-alpine/11-list-packages.sh b/misc/podman/test-qemu/test-qemu5-alpine/11-list-packages.sh similarity index 100% rename from misc/test-qemu-with-podman/test-qemu5-alpine/11-list-packages.sh rename to misc/podman/test-qemu/test-qemu5-alpine/11-list-packages.sh diff --git a/misc/test-qemu-with-podman/test-qemu4-alpine/20-image-run-shell.sh b/misc/podman/test-qemu/test-qemu5-alpine/20-image-run-shell.sh similarity index 96% rename from misc/test-qemu-with-podman/test-qemu4-alpine/20-image-run-shell.sh rename to misc/podman/test-qemu/test-qemu5-alpine/20-image-run-shell.sh index 102ca91c..d4f61f5d 100755 --- a/misc/test-qemu-with-podman/test-qemu4-alpine/20-image-run-shell.sh +++ b/misc/podman/test-qemu/test-qemu5-alpine/20-image-run-shell.sh @@ -21,7 +21,7 @@ if [[ 1 == 1 ]]; then flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 ) # NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx # INFO: SELinux users *may* have to add ":z" to the volume mount flags; check the docs! - flags+=( -v "${argv0dir}/../../..:/home/upx/src/upx" ) + flags+=( -v "${argv0dir}/../../../..:/home/upx/src/upx" ) flags+=( -w /home/upx/src/upx ) # set working directory flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs diff --git a/misc/test-qemu-with-podman/test-qemu5-alpine/Dockerfile b/misc/podman/test-qemu/test-qemu5-alpine/Dockerfile similarity index 84% rename from misc/test-qemu-with-podman/test-qemu5-alpine/Dockerfile rename to misc/podman/test-qemu/test-qemu5-alpine/Dockerfile index de9c3aa7..a5d7738c 100644 --- a/misc/test-qemu-with-podman/test-qemu5-alpine/Dockerfile +++ b/misc/podman/test-qemu/test-qemu5-alpine/Dockerfile @@ -5,14 +5,19 @@ RUN apk update && apk upgrade && apk add \ bash-completion \ musl-dbg \ qemu-aarch64 \ + qemu-aarch64_be \ qemu-arm \ qemu-armeb \ qemu-i386 \ + qemu-m68k \ qemu-mips \ qemu-mipsel \ qemu-ppc \ qemu-ppc64 \ qemu-ppc64le \ + qemu-riscv32 \ + qemu-riscv64 \ + qemu-s390x \ qemu-x86_64 \ strace \ && true diff --git a/misc/test-qemu-with-podman/test-qemu6-alpine/10-create-image.sh b/misc/podman/test-qemu/test-qemu6-alpine/10-create-image.sh similarity index 100% rename from misc/test-qemu-with-podman/test-qemu6-alpine/10-create-image.sh rename to misc/podman/test-qemu/test-qemu6-alpine/10-create-image.sh diff --git a/misc/test-qemu-with-podman/test-qemu6-alpine/11-list-packages.sh b/misc/podman/test-qemu/test-qemu6-alpine/11-list-packages.sh similarity index 100% rename from misc/test-qemu-with-podman/test-qemu6-alpine/11-list-packages.sh rename to misc/podman/test-qemu/test-qemu6-alpine/11-list-packages.sh diff --git a/misc/podman/test-qemu/test-qemu6-alpine/20-image-run-shell.sh b/misc/podman/test-qemu/test-qemu6-alpine/20-image-run-shell.sh new file mode 100755 index 00000000..d4f61f5d --- /dev/null +++ b/misc/podman/test-qemu/test-qemu6-alpine/20-image-run-shell.sh @@ -0,0 +1,41 @@ +#! /usr/bin/env bash +## vim:set ts=4 sw=4 et: +set -e; set -o pipefail +argv0=$0; argv0abs="$(readlink -fn "$argv0")"; argv0dir="$(dirname "$argv0abs")" + +# run an interactive shell in the image +# using a rootless Podman container + +image="$("$argv0dir/10-create-image.sh" --print-image)" + +flags=( --read-only --rm --pull=never ) +flags+=( --cap-drop=all ) # drop all capabilities +flags+=( --network=none ) # no network needed +flags+=( -ti -e TERM="$TERM" ) # allocate an interactive pseudo-tty and pass $TERM +if [[ 1 == 1 ]]; then + # run as user upx 2000:2000 + flags+=( --user 2000 ) + # map container users 0..999 to subuid-users 1..1000, and map container user 2000 to current host user + flags+=( --uidmap=0:1:1000 --uidmap=2000:0:1 ) + # map container groups 0..999 to subgid-groups 1..1000, and map container group 2000 to current host group + flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 ) + # NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx + # INFO: SELinux users *may* have to add ":z" to the volume mount flags; check the docs! + flags+=( -v "${argv0dir}/../../../..:/home/upx/src/upx" ) + flags+=( -w /home/upx/src/upx ) # set working directory + flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs + flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs +else + # run as user root 0:0 + # ONLY FOR DEBUGGING THE IMAGE + # map container user/group 0 to current host user/group + flags+=( --user 0 ) +fi + +if [[ $# == 0 ]]; then + podman run "${flags[@]}" "$image" bash -l +else + podman run "${flags[@]}" "$image" "$@" +fi + +# please see usage instructions in ../README.md diff --git a/misc/test-qemu-with-podman/test-qemu6-alpine/Dockerfile b/misc/podman/test-qemu/test-qemu6-alpine/Dockerfile similarity index 84% rename from misc/test-qemu-with-podman/test-qemu6-alpine/Dockerfile rename to misc/podman/test-qemu/test-qemu6-alpine/Dockerfile index 865bb234..c5356512 100644 --- a/misc/test-qemu-with-podman/test-qemu6-alpine/Dockerfile +++ b/misc/podman/test-qemu/test-qemu6-alpine/Dockerfile @@ -5,14 +5,19 @@ RUN apk update && apk upgrade && apk add \ bash-completion \ musl-dbg \ qemu-aarch64 \ + qemu-aarch64_be \ qemu-arm \ qemu-armeb \ qemu-i386 \ + qemu-m68k \ qemu-mips \ qemu-mipsel \ qemu-ppc \ qemu-ppc64 \ qemu-ppc64le \ + qemu-riscv32 \ + qemu-riscv64 \ + qemu-s390x \ qemu-x86_64 \ strace \ && true diff --git a/misc/test-qemu-with-podman/test-qemu7-alpine/10-create-image.sh b/misc/podman/test-qemu/test-qemu7-alpine/10-create-image.sh similarity index 100% rename from misc/test-qemu-with-podman/test-qemu7-alpine/10-create-image.sh rename to misc/podman/test-qemu/test-qemu7-alpine/10-create-image.sh diff --git a/misc/test-qemu-with-podman/test-qemu7-alpine/11-list-packages.sh b/misc/podman/test-qemu/test-qemu7-alpine/11-list-packages.sh similarity index 100% rename from misc/test-qemu-with-podman/test-qemu7-alpine/11-list-packages.sh rename to misc/podman/test-qemu/test-qemu7-alpine/11-list-packages.sh diff --git a/misc/podman/test-qemu/test-qemu7-alpine/20-image-run-shell.sh b/misc/podman/test-qemu/test-qemu7-alpine/20-image-run-shell.sh new file mode 100755 index 00000000..d4f61f5d --- /dev/null +++ b/misc/podman/test-qemu/test-qemu7-alpine/20-image-run-shell.sh @@ -0,0 +1,41 @@ +#! /usr/bin/env bash +## vim:set ts=4 sw=4 et: +set -e; set -o pipefail +argv0=$0; argv0abs="$(readlink -fn "$argv0")"; argv0dir="$(dirname "$argv0abs")" + +# run an interactive shell in the image +# using a rootless Podman container + +image="$("$argv0dir/10-create-image.sh" --print-image)" + +flags=( --read-only --rm --pull=never ) +flags+=( --cap-drop=all ) # drop all capabilities +flags+=( --network=none ) # no network needed +flags+=( -ti -e TERM="$TERM" ) # allocate an interactive pseudo-tty and pass $TERM +if [[ 1 == 1 ]]; then + # run as user upx 2000:2000 + flags+=( --user 2000 ) + # map container users 0..999 to subuid-users 1..1000, and map container user 2000 to current host user + flags+=( --uidmap=0:1:1000 --uidmap=2000:0:1 ) + # map container groups 0..999 to subgid-groups 1..1000, and map container group 2000 to current host group + flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 ) + # NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx + # INFO: SELinux users *may* have to add ":z" to the volume mount flags; check the docs! + flags+=( -v "${argv0dir}/../../../..:/home/upx/src/upx" ) + flags+=( -w /home/upx/src/upx ) # set working directory + flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs + flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs +else + # run as user root 0:0 + # ONLY FOR DEBUGGING THE IMAGE + # map container user/group 0 to current host user/group + flags+=( --user 0 ) +fi + +if [[ $# == 0 ]]; then + podman run "${flags[@]}" "$image" bash -l +else + podman run "${flags[@]}" "$image" "$@" +fi + +# please see usage instructions in ../README.md diff --git a/misc/test-qemu-with-podman/test-qemu7-alpine/Dockerfile b/misc/podman/test-qemu/test-qemu7-alpine/Dockerfile similarity index 84% rename from misc/test-qemu-with-podman/test-qemu7-alpine/Dockerfile rename to misc/podman/test-qemu/test-qemu7-alpine/Dockerfile index d8ced8a5..1ae955a8 100644 --- a/misc/test-qemu-with-podman/test-qemu7-alpine/Dockerfile +++ b/misc/podman/test-qemu/test-qemu7-alpine/Dockerfile @@ -5,14 +5,19 @@ RUN apk update && apk upgrade && apk add \ bash-completion \ musl-dbg \ qemu-aarch64 \ + qemu-aarch64_be \ qemu-arm \ qemu-armeb \ qemu-i386 \ + qemu-m68k \ qemu-mips \ qemu-mipsel \ qemu-ppc \ qemu-ppc64 \ qemu-ppc64le \ + qemu-riscv32 \ + qemu-riscv64 \ + qemu-s390x \ qemu-x86_64 \ strace \ && true diff --git a/misc/test-qemu-with-podman/test-qemu8-alpine/10-create-image.sh b/misc/podman/test-qemu/test-qemu8-alpine/10-create-image.sh similarity index 100% rename from misc/test-qemu-with-podman/test-qemu8-alpine/10-create-image.sh rename to misc/podman/test-qemu/test-qemu8-alpine/10-create-image.sh diff --git a/misc/test-qemu-with-podman/test-qemu8-alpine/11-list-packages.sh b/misc/podman/test-qemu/test-qemu8-alpine/11-list-packages.sh similarity index 100% rename from misc/test-qemu-with-podman/test-qemu8-alpine/11-list-packages.sh rename to misc/podman/test-qemu/test-qemu8-alpine/11-list-packages.sh diff --git a/misc/podman/test-qemu/test-qemu8-alpine/20-image-run-shell.sh b/misc/podman/test-qemu/test-qemu8-alpine/20-image-run-shell.sh new file mode 100755 index 00000000..d4f61f5d --- /dev/null +++ b/misc/podman/test-qemu/test-qemu8-alpine/20-image-run-shell.sh @@ -0,0 +1,41 @@ +#! /usr/bin/env bash +## vim:set ts=4 sw=4 et: +set -e; set -o pipefail +argv0=$0; argv0abs="$(readlink -fn "$argv0")"; argv0dir="$(dirname "$argv0abs")" + +# run an interactive shell in the image +# using a rootless Podman container + +image="$("$argv0dir/10-create-image.sh" --print-image)" + +flags=( --read-only --rm --pull=never ) +flags+=( --cap-drop=all ) # drop all capabilities +flags+=( --network=none ) # no network needed +flags+=( -ti -e TERM="$TERM" ) # allocate an interactive pseudo-tty and pass $TERM +if [[ 1 == 1 ]]; then + # run as user upx 2000:2000 + flags+=( --user 2000 ) + # map container users 0..999 to subuid-users 1..1000, and map container user 2000 to current host user + flags+=( --uidmap=0:1:1000 --uidmap=2000:0:1 ) + # map container groups 0..999 to subgid-groups 1..1000, and map container group 2000 to current host group + flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 ) + # NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx + # INFO: SELinux users *may* have to add ":z" to the volume mount flags; check the docs! + flags+=( -v "${argv0dir}/../../../..:/home/upx/src/upx" ) + flags+=( -w /home/upx/src/upx ) # set working directory + flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs + flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs +else + # run as user root 0:0 + # ONLY FOR DEBUGGING THE IMAGE + # map container user/group 0 to current host user/group + flags+=( --user 0 ) +fi + +if [[ $# == 0 ]]; then + podman run "${flags[@]}" "$image" bash -l +else + podman run "${flags[@]}" "$image" "$@" +fi + +# please see usage instructions in ../README.md diff --git a/misc/test-qemu-with-podman/test-qemu8-alpine/Dockerfile b/misc/podman/test-qemu/test-qemu8-alpine/Dockerfile similarity index 78% rename from misc/test-qemu-with-podman/test-qemu8-alpine/Dockerfile rename to misc/podman/test-qemu/test-qemu8-alpine/Dockerfile index a764603d..636bbe4d 100644 --- a/misc/test-qemu-with-podman/test-qemu8-alpine/Dockerfile +++ b/misc/podman/test-qemu/test-qemu8-alpine/Dockerfile @@ -1,18 +1,23 @@ FROM docker.io/library/alpine:3.18 -# install qemu-8.0.3-r0 and some utils +# install qemu-8.0.3-r1 and some utils RUN apk update && apk upgrade && apk add \ bash-completion \ musl-dbg \ qemu-aarch64 \ + qemu-aarch64_be \ qemu-arm \ qemu-armeb \ qemu-i386 \ + qemu-m68k \ qemu-mips \ qemu-mipsel \ qemu-ppc \ qemu-ppc64 \ qemu-ppc64le \ + qemu-riscv32 \ + qemu-riscv64 \ + qemu-s390x \ qemu-x86_64 \ strace \ && true diff --git a/misc/test-qemu-with-podman/test-qemu6-alpine/20-image-run-shell.sh b/misc/test-qemu-with-podman/test-qemu6-alpine/20-image-run-shell.sh deleted file mode 100755 index 102ca91c..00000000 --- a/misc/test-qemu-with-podman/test-qemu6-alpine/20-image-run-shell.sh +++ /dev/null @@ -1,41 +0,0 @@ -#! /usr/bin/env bash -## vim:set ts=4 sw=4 et: -set -e; set -o pipefail -argv0=$0; argv0abs="$(readlink -fn "$argv0")"; argv0dir="$(dirname "$argv0abs")" - -# run an interactive shell in the image -# using a rootless Podman container - -image="$("$argv0dir/10-create-image.sh" --print-image)" - -flags=( --read-only --rm --pull=never ) -flags+=( --cap-drop=all ) # drop all capabilities -flags+=( --network=none ) # no network needed -flags+=( -ti -e TERM="$TERM" ) # allocate an interactive pseudo-tty and pass $TERM -if [[ 1 == 1 ]]; then - # run as user upx 2000:2000 - flags+=( --user 2000 ) - # map container users 0..999 to subuid-users 1..1000, and map container user 2000 to current host user - flags+=( --uidmap=0:1:1000 --uidmap=2000:0:1 ) - # map container groups 0..999 to subgid-groups 1..1000, and map container group 2000 to current host group - flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 ) - # NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx - # INFO: SELinux users *may* have to add ":z" to the volume mount flags; check the docs! - flags+=( -v "${argv0dir}/../../..:/home/upx/src/upx" ) - flags+=( -w /home/upx/src/upx ) # set working directory - flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs - flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs -else - # run as user root 0:0 - # ONLY FOR DEBUGGING THE IMAGE - # map container user/group 0 to current host user/group - flags+=( --user 0 ) -fi - -if [[ $# == 0 ]]; then - podman run "${flags[@]}" "$image" bash -l -else - podman run "${flags[@]}" "$image" "$@" -fi - -# please see usage instructions in ../README.md diff --git a/misc/test-qemu-with-podman/test-qemu7-alpine/20-image-run-shell.sh b/misc/test-qemu-with-podman/test-qemu7-alpine/20-image-run-shell.sh deleted file mode 100755 index 102ca91c..00000000 --- a/misc/test-qemu-with-podman/test-qemu7-alpine/20-image-run-shell.sh +++ /dev/null @@ -1,41 +0,0 @@ -#! /usr/bin/env bash -## vim:set ts=4 sw=4 et: -set -e; set -o pipefail -argv0=$0; argv0abs="$(readlink -fn "$argv0")"; argv0dir="$(dirname "$argv0abs")" - -# run an interactive shell in the image -# using a rootless Podman container - -image="$("$argv0dir/10-create-image.sh" --print-image)" - -flags=( --read-only --rm --pull=never ) -flags+=( --cap-drop=all ) # drop all capabilities -flags+=( --network=none ) # no network needed -flags+=( -ti -e TERM="$TERM" ) # allocate an interactive pseudo-tty and pass $TERM -if [[ 1 == 1 ]]; then - # run as user upx 2000:2000 - flags+=( --user 2000 ) - # map container users 0..999 to subuid-users 1..1000, and map container user 2000 to current host user - flags+=( --uidmap=0:1:1000 --uidmap=2000:0:1 ) - # map container groups 0..999 to subgid-groups 1..1000, and map container group 2000 to current host group - flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 ) - # NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx - # INFO: SELinux users *may* have to add ":z" to the volume mount flags; check the docs! - flags+=( -v "${argv0dir}/../../..:/home/upx/src/upx" ) - flags+=( -w /home/upx/src/upx ) # set working directory - flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs - flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs -else - # run as user root 0:0 - # ONLY FOR DEBUGGING THE IMAGE - # map container user/group 0 to current host user/group - flags+=( --user 0 ) -fi - -if [[ $# == 0 ]]; then - podman run "${flags[@]}" "$image" bash -l -else - podman run "${flags[@]}" "$image" "$@" -fi - -# please see usage instructions in ../README.md diff --git a/misc/test-qemu-with-podman/test-qemu8-alpine/20-image-run-shell.sh b/misc/test-qemu-with-podman/test-qemu8-alpine/20-image-run-shell.sh deleted file mode 100755 index 102ca91c..00000000 --- a/misc/test-qemu-with-podman/test-qemu8-alpine/20-image-run-shell.sh +++ /dev/null @@ -1,41 +0,0 @@ -#! /usr/bin/env bash -## vim:set ts=4 sw=4 et: -set -e; set -o pipefail -argv0=$0; argv0abs="$(readlink -fn "$argv0")"; argv0dir="$(dirname "$argv0abs")" - -# run an interactive shell in the image -# using a rootless Podman container - -image="$("$argv0dir/10-create-image.sh" --print-image)" - -flags=( --read-only --rm --pull=never ) -flags+=( --cap-drop=all ) # drop all capabilities -flags+=( --network=none ) # no network needed -flags+=( -ti -e TERM="$TERM" ) # allocate an interactive pseudo-tty and pass $TERM -if [[ 1 == 1 ]]; then - # run as user upx 2000:2000 - flags+=( --user 2000 ) - # map container users 0..999 to subuid-users 1..1000, and map container user 2000 to current host user - flags+=( --uidmap=0:1:1000 --uidmap=2000:0:1 ) - # map container groups 0..999 to subgid-groups 1..1000, and map container group 2000 to current host group - flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 ) - # NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx - # INFO: SELinux users *may* have to add ":z" to the volume mount flags; check the docs! - flags+=( -v "${argv0dir}/../../..:/home/upx/src/upx" ) - flags+=( -w /home/upx/src/upx ) # set working directory - flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs - flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs -else - # run as user root 0:0 - # ONLY FOR DEBUGGING THE IMAGE - # map container user/group 0 to current host user/group - flags+=( --user 0 ) -fi - -if [[ $# == 0 ]]; then - podman run "${flags[@]}" "$image" bash -l -else - podman run "${flags[@]}" "$image" "$@" -fi - -# please see usage instructions in ../README.md diff --git a/misc/testsuite/upx_testsuite_1.sh b/misc/testsuite/upx_testsuite_1.sh index 3ead7409..2b62242d 100755 --- a/misc/testsuite/upx_testsuite_1.sh +++ b/misc/testsuite/upx_testsuite_1.sh @@ -4,10 +4,14 @@ set -e; set -o pipefail argv0=$0; argv0abs=$(readlink -en -- "$argv0"); argv0dir=$(dirname "$argv0abs") # very first version of the upx-testsuite; requires: -# $upx_exe -# $upx_testsuite_SRCDIR (semi-optional) +# $upx_exe (required, but with convenience fallback "./upx") +# $upx_testsuite_SRCDIR (required, but with convenience fallback) # $upx_testsuite_BUILDDIR (optional) -# $upx_testsuite_verbose (optional) +# +# optional settings: +# $upx_exe_runner (e.g. "qemu-x86_64 -cpu Westmere" or "valgrind") +# $UPX_TESTSUITE_VERBOSE +# $UPX_TESTSUITE_LEVEL # # see https://github.com/upx/upx-testsuite.git @@ -15,17 +19,30 @@ argv0=$0; argv0abs=$(readlink -en -- "$argv0"); argv0dir=$(dirname "$argv0abs") # // init & checks # ************************************************************************/ +# upx_exe +[[ -z $upx_exe && -f ./upx && -x ./upx ]] && upx_exe=./upx # convenience fallback if [[ -z $upx_exe ]]; then echo "UPX-ERROR: please set \$upx_exe"; exit 1; fi -# convenience: try to make filename absolute -[[ -f "$upx_exe" ]] && upx_exe=$(readlink -en -- "$upx_exe") -# upx_exe check, part1 -if ! $upx_exe --version-short >/dev/null; then echo "UPX-ERROR: FATAL: upx --version-short FAILED"; exit 1; fi -if ! $upx_exe -L >/dev/null 2>&1; then echo "UPX-ERROR: FATAL: upx -L FAILED"; exit 1; fi -if ! $upx_exe --help >/dev/null; then echo "UPX-ERROR: FATAL: upx --help FAILED"; exit 1; fi +if [[ ! -f $upx_exe ]]; then echo "UPX-ERROR: file '$upx_exe' does not exist"; exit 1; fi +upx_exe=$(readlink -en -- "$upx_exe") # make absolute +upx_run=() +if [[ -n $upx_exe_runner ]]; then + # usage examples: + # export upx_exe_runner="qemu-x86_64 -cpu Westmere" + # export upx_exe_runner="valgrind --leak-check=no --error-exitcode=1 --quiet" + # export upx_exe_runner="wine" + IFS=' ' read -r -a upx_run <<< "$upx_exe_runner" # split at spaces into array +fi +upx_run+=( "$upx_exe" ) +echo "upx_run='${upx_run[*]}'" + +# upx_run check, part1 +if ! "${upx_run[@]}" --version-short >/dev/null; then echo "UPX-ERROR: FATAL: upx --version-short FAILED"; exit 1; fi +if ! "${upx_run[@]}" -L >/dev/null 2>&1; then echo "UPX-ERROR: FATAL: upx -L FAILED"; exit 1; fi +if ! "${upx_run[@]}" --help >/dev/null; then echo "UPX-ERROR: FATAL: upx --help FAILED"; exit 1; fi # upx_testsuite_SRCDIR if [[ -z $upx_testsuite_SRCDIR ]]; then - # convenience: search standard locations below upx top-level directory + # convenience fallback: search standard locations below upx top-level directory if [[ -d "$argv0dir/../../../upx--upx-testsuite.git/files/packed" ]]; then upx_testsuite_SRCDIR="$argv0dir/../../../upx--upx-testsuite.git" elif [[ -d "$argv0dir/../../../upx-testsuite.git/files/packed" ]]; then @@ -40,25 +57,35 @@ if [[ ! -d "$upx_testsuite_SRCDIR/files/packed" ]]; then echo " and set (export) the envvar upx_testsuite_SRCDIR to the local file path" exit 1 fi -upx_testsuite_SRCDIR=$(readlink -en -- "$upx_testsuite_SRCDIR") +upx_testsuite_SRCDIR=$(readlink -en -- "$upx_testsuite_SRCDIR") # make absolute # upx_testsuite_BUILDDIR if [[ -z $upx_testsuite_BUILDDIR ]]; then upx_testsuite_BUILDDIR="./tmp-upx-testsuite" fi mkdir -p "$upx_testsuite_BUILDDIR" || exit 1 -upx_testsuite_BUILDDIR=$(readlink -en -- "$upx_testsuite_BUILDDIR") +upx_testsuite_BUILDDIR=$(readlink -en -- "$upx_testsuite_BUILDDIR") # make absolute cd / && cd "$upx_testsuite_BUILDDIR" || exit 1 -# upx_exe check, part2 -if ! $upx_exe --version-short >/dev/null; then +# upx_run check, part2 +if ! "${upx_run[@]}" --version-short >/dev/null; then echo "UPX-ERROR: FATAL: upx --version-short FAILED" echo "please make sure that \$upx_exe contains ABSOLUTE file paths and can be run from any directory" + echo "INFO: upx_run='${upx_run[*]}'" exit 1 fi -if ! $upx_exe -L >/dev/null 2>&1; then echo "UPX-ERROR: FATAL: upx -L FAILED"; exit 1; fi -if ! $upx_exe --help >/dev/null; then echo "UPX-ERROR: FATAL: upx --help FAILED"; exit 1; fi +if ! "${upx_run[@]}" -L >/dev/null 2>&1; then echo "UPX-ERROR: FATAL: upx -L FAILED"; exit 1; fi +if ! "${upx_run[@]}" --help >/dev/null; then echo "UPX-ERROR: FATAL: upx --help FAILED"; exit 1; fi + +case $UPX_TESTSUITE_LEVEL in + [0-8]) ;; + *) UPX_TESTSUITE_LEVEL=999 ;; +esac +if [[ $UPX_TESTSUITE_LEVEL == 0 ]]; then + echo "UPX testsuite SKIPPED." + exit 0 +fi # /*********************************************************************** # // setup @@ -83,12 +110,12 @@ cd testsuite_1 || exit 1 run_upx() { local ec=0 - if [[ $upx_testsuite_verbose == 1 ]]; then - echo "LOG: $upx_exe $@" + if [[ $UPX_TESTSUITE_VERBOSE == 1 ]]; then + echo "LOG: '${upx_run[*]}' $*" fi - $upx_exe "$@" || ec=$? + "${upx_run[@]}" "$@" || ec=$? if [[ $ec != 0 ]]; then - echo "FATAL: $upx_exe $@" + echo "FATAL: '${upx_run[*]}' $*" echo " (exit code was $ec)" exit 42 fi @@ -110,7 +137,7 @@ testsuite_split_f() { } testsuite_check_sha() { - (cd "$1" && sha256sum -b */* | LC_ALL=C sort -k2) > $1/.sha256sums.current + (cd "$1" && sha256sum -b -- */* | LC_ALL=C sort -k2) > $1/.sha256sums.current echo cat $1/.sha256sums.current if ! cmp -s $1/.sha256sums.expected $1/.sha256sums.current; then @@ -125,7 +152,7 @@ testsuite_check_sha() { } testsuite_check_sha_decompressed() { - (cd "$1" && sha256sum -b */* | LC_ALL=C sort -k2) > $1/.sha256sums.current + (cd "$1" && sha256sum -b -- */* | LC_ALL=C sort -k2) > $1/.sha256sums.current if ! cmp -s $1/.sha256sums.expected $1/.sha256sums.current; then cat $1/.sha256sums.current echo "UPX-ERROR: FATAL: $1 FAILED: decompressed checksum mismatch" @@ -147,14 +174,14 @@ testsuite_run_compress() { testsuite_split_f "$f" [[ -z $fb ]] && continue echo "# $f" - mkdir -p $testdir/$fsubdir $testdir/.decompressed/$fsubdir - run_upx -qq --prefer-ucl "$@" "$f" -o $testdir/$fsubdir/$fb - run_upx -qq -d $testdir/$fsubdir/$fb -o $testdir/.decompressed/$fsubdir/$fb + mkdir -p "$testdir/$fsubdir" "$testdir/.decompressed/$fsubdir" + run_upx -qq --prefer-ucl "$@" "$f" -o "$testdir/$fsubdir/$fb" + run_upx -qq -d "$testdir/$fsubdir/$fb" -o "$testdir/.decompressed/$fsubdir/$fb" done testsuite_check_sha $testdir - run_upx -qq -l $testdir/*/* - run_upx -qq --file-info $testdir/*/* - run_upx -q -t $testdir/*/* + run_upx -qq -l "$testdir"/*/* + run_upx -qq --file-info "$testdir"/*/* + run_upx -q -t "$testdir"/*/* if [[ $testsuite_use_canonicalized == 1 ]]; then # check that after decompression the file matches the canonicalized version cp t020_canonicalized/.sha256sums.expected $testdir/.decompressed/ @@ -172,7 +199,7 @@ testsuite_run_compress() { # ************************************************************************/ recreate_expected_sha256sums() { - local o=$1 + local o="$1" local files f d echo "########## begin .sha256sums.recreate" > "$o" files='*/.sha256sums.current' @@ -199,8 +226,8 @@ for f in "$upx_testsuite_SRCDIR"/files/packed/*/upx-3.9[15]*; do testsuite_split_f "$f" [[ -z $fb ]] && continue echo "# $f" - mkdir -p $testdir/$fsubdir - run_upx -qq -d "$f" -o $testdir/$fsubdir/$fb + mkdir -p "$testdir/$fsubdir" + run_upx -qq -d "$f" -o "$testdir/$fsubdir/$fb" done testsuite_check_sha $testdir @@ -213,9 +240,9 @@ for f in t010_decompressed/*/*; do testsuite_split_f "$f" [[ -z $fb ]] && continue echo "# $f" - mkdir -p $testdir/$fsubdir/.packed - run_upx -qq --prefer-ucl -1 "$f" -o $testdir/$fsubdir/.packed/$fb - run_upx -qq -d $testdir/$fsubdir/.packed/$fb -o $testdir/$fsubdir/$fb + mkdir -p "$testdir/$fsubdir/.packed" + run_upx -qq --prefer-ucl -1 "$f" -o "$testdir/$fsubdir/.packed/$fb" + run_upx -qq -d "$testdir/$fsubdir/.packed/$fb" -o "$testdir/$fsubdir/$fb" done testsuite_check_sha $testdir @@ -225,48 +252,43 @@ testsuite_check_sha $testdir # // test UPX and not the compression libraries # ************************************************************************/ -case $UPX_TESTSUITE_FAST in - [0-7]) ;; - *) UPX_TESTSUITE_FAST=999 ;; -esac - -if [[ $UPX_TESTSUITE_FAST -ge 1 ]]; then +if [[ $UPX_TESTSUITE_LEVEL -ge 2 ]]; then testdir=t110_compress_ucl_nrv2b_3_no_filter mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected time testsuite_run_compress --nrv2b -3 --no-filter fi -if [[ $UPX_TESTSUITE_FAST -ge 2 ]]; then +if [[ $UPX_TESTSUITE_LEVEL -ge 3 ]]; then testdir=t120_compress_ucl_nrv2d_3_no_filter mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected time testsuite_run_compress --nrv2d -3 --no-filter fi -if [[ $UPX_TESTSUITE_FAST -ge 3 ]]; then +if [[ $UPX_TESTSUITE_LEVEL -ge 4 ]]; then testdir=t130_compress_ucl_nrv2e_3_no_filter mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected time testsuite_run_compress --nrv2e -3 --no-filter fi -if [[ $UPX_TESTSUITE_FAST -ge 4 ]]; then +if [[ $UPX_TESTSUITE_LEVEL -ge 5 ]]; then testdir=t140_compress_lzma_2_no_filter mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected time testsuite_run_compress --lzma -2 --no-filter fi -if [[ $UPX_TESTSUITE_FAST -ge 5 ]]; then +if [[ $UPX_TESTSUITE_LEVEL -ge 6 ]]; then testdir=t150_compress_ucl_2_all_filters mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected time testsuite_run_compress -2 --all-filters fi -if [[ $UPX_TESTSUITE_FAST -ge 6 ]]; then +if [[ $UPX_TESTSUITE_LEVEL -ge 7 ]]; then testdir=t160_compress_all_methods_1_no_filter mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected time testsuite_run_compress --all-methods -1 --no-filter fi -if [[ $UPX_TESTSUITE_FAST -ge 7 ]]; then +if [[ $UPX_TESTSUITE_LEVEL -ge 8 ]]; then testdir=t170_compress_all_methods_no_lzma_5_no_filter mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected time testsuite_run_compress --all-methods --no-lzma -5 --no-filter @@ -283,10 +305,11 @@ testsuite_header "UPX testsuite summary" run_upx --version-short echo echo "upx_exe='$upx_exe'" -if [[ -f "$upx_exe" ]]; then +if [[ -f $upx_exe ]]; then ls -l "$upx_exe" file "$upx_exe" || true fi +echo "upx_run='${upx_run[*]}'" echo "upx_testsuite_SRCDIR='$upx_testsuite_SRCDIR'" echo "upx_testsuite_BUILDDIR='$upx_testsuite_BUILDDIR'" echo ".sha256sums.{expected,current} counts:" diff --git a/src/check/dt_check.cpp b/src/check/dt_check.cpp index 366f7dba..8f6353a2 100644 --- a/src/check/dt_check.cpp +++ b/src/check/dt_check.cpp @@ -352,6 +352,25 @@ struct TestIntegerWrap { static inline bool neg_eq(const T x) noexcept { return T(0) - x == x; } }; +static noinline void throwSomeValue(int x) { + if (x < 0) + throw int(x); + else + throw size_t(x); +} + +static noinline void check_basic_cxx_exception_handling(void (*func)(int)) noexcept { + bool cxx_exception_handling_works = false; + try { + func(42); + } catch (const size_t &e) { + if (e == 42) + cxx_exception_handling_works = true; + } catch (...) { + } + assert_noexcept(cxx_exception_handling_works); +} + } // namespace #define ACC_WANT_ACC_CHK_CH 1 @@ -359,6 +378,9 @@ struct TestIntegerWrap { #include "../miniacc.h" void upx_compiler_sanity_check(void) noexcept { + // first check C++ exception handling to catch toolchain/qemu/wine/etc problems + check_basic_cxx_exception_handling(throwSomeValue); + #define ACC_WANT_ACC_CHK_CH 1 #undef ACCCHK_ASSERT #define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT(expr) diff --git a/src/conf.h b/src/conf.h index e20b2704..bfef441a 100644 --- a/src/conf.h +++ b/src/conf.h @@ -401,8 +401,10 @@ inline void owner_delete(OwningPointer(T) (&object)) noexcept { delete object; object = nullptr; } +#if defined(__clang__) || __GNUC__ != 7 template inline void owner_delete(T (&array)[]) noexcept DELETED_FUNCTION; +#endif template inline void owner_delete(T (&array)[N]) noexcept DELETED_FUNCTION; @@ -415,8 +417,10 @@ inline void mem_clear(T *object) noexcept { static_assert(size >= 1 && size <= UPX_RSIZE_MAX_MEM); memset((void *) object, 0, size); } +#if defined(__clang__) || __GNUC__ != 7 template inline void mem_clear(T (&array)[]) noexcept DELETED_FUNCTION; +#endif template inline void mem_clear(T (&array)[N]) noexcept DELETED_FUNCTION; @@ -821,9 +825,9 @@ void *membuffer_get_void_ptr(MemBuffer &mb) noexcept; unsigned membuffer_get_size(MemBuffer &mb) noexcept; // util/dt_check.cpp -void upx_compiler_sanity_check() noexcept; +noinline void upx_compiler_sanity_check() noexcept; +noinline int upx_doctest_check(int argc, char **argv); int upx_doctest_check(); -int upx_doctest_check(int argc, char **argv); // main.cpp extern const char *progname; diff --git a/src/stub/Makefile b/src/stub/Makefile index b81af078..9c581e94 100644 --- a/src/stub/Makefile +++ b/src/stub/Makefile @@ -1,7 +1,7 @@ # # UPX stub Makefile - needs GNU make 3.81 or better # -# Preferred: see misc/rebuild-stubs-with-podman how to use Podman/Docker. +# Preferred: see misc/podman/rebuild-stubs how to use Podman/Docker. # Otherwise you will need a number of special build tools like various # cross-assemblers and cross-compilers - see README.SRC. # diff --git a/src/util/util.cpp b/src/util/util.cpp index 40e02485..d84e3db5 100644 --- a/src/util/util.cpp +++ b/src/util/util.cpp @@ -151,6 +151,7 @@ void uintptr_check_no_overlap(upx_uintptr_t a, size_t a_size, upx_uintptr_t b, s if very_unlikely (a_end < a || b_end < b) // wrap-around throwCantPack("ptr_check_no_overlap-overflow"); // same as (!(a >= b_end || b >= a_end)) + // same as (!(a_end <= b || b_end <= a)) if very_unlikely (a < b_end && b < a_end) throwCantPack("ptr_check_no_overlap-ab"); }