misc: upx_testsuite; move podman directories into subdirectory

This commit is contained in:
Markus F.X.J. Oberhumer 2023-07-22 00:19:11 +02:00
parent b866631448
commit 891dc87064
49 changed files with 313 additions and 227 deletions

View File

@ -61,7 +61,7 @@ To compile the packer sources
If you want to modify the stub sources you'll also need 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 is the preferred way of rebuilding the stubs
- otherwise you will need: - otherwise you will need:

View File

@ -6,10 +6,10 @@ argv0=$0; argv0abs="$(readlink -fn "$argv0")"; argv0dir="$(dirname "$argv0abs")"
# create the image from Dockerfile # create the image from Dockerfile
# using a rootless Podman container # 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 # so you have to create that image first
# WARNING: we install many packages, so the resulting image needs A LOT of disk space! # 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 [[ $1 == --print-image ]] && echo "$image" && exit 0
podman build -t "$image" -f "$argv0dir/Dockerfile" "$argv0dir" podman build -t "$image" -f "$argv0dir/Dockerfile" "$argv0dir"

View File

@ -21,7 +21,7 @@ if [[ 1 == 1 ]]; then
flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 ) flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 )
# NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx # 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! # 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+=( -w /home/upx/src/upx ) # set working directory
flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs
flags+=( --tmpfs /home/upx/.local: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 lots of other cross-compilers are installed; see "ls /usr/bin/*g++*"
# and finally see # 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: # 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 # 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 # qemu-hppa -L /usr/hppa-linux-gnu ./upx --version
# (similar for many other architectures/builds) # (similar for many other architectures/builds)

View File

@ -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 # so you have to create that image first
# WARNING: we install many packages, so the resulting image needs A LOT of disk space! # WARNING: we install many packages, so the resulting image needs A LOT of disk space!
FROM localhost/upx-stubtools-20221212-v6 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 ARG DEBIAN_FRONTEND=noninteractive
USER root USER root

View File

@ -13,7 +13,7 @@ if [[ $UPX_CONTAINER_IMAGE_NAME != upx-cross-compile-* ]]; then
fi fi
# go to upx top-level directory # go to upx top-level directory
cd "$argv0dir/../.." || exit 1 cd "$argv0dir/../../.." || exit 1
pwd pwd
test -f doc/upx.pod || exit 1 # sanity check test -f doc/upx.pod || exit 1 # sanity check
test -f src/version.h || exit 1 # sanity check test -f src/version.h || exit 1 # sanity check
@ -44,14 +44,15 @@ function run_config_and_build {
fi fi
# for all build types # for all build types
for build_type in Debug Release; do for build_type in Debug Release; do
bdir=build/cross-compile-upx-with-podman/$toolchain/${build_type,,} bdir="build/cross-compile-upx-ubuntu2204/$toolchain/${build_type,,}"
mkdir -p $bdir mkdir -p "$bdir"
# run_config # run_config
if [[ ! -f $bdir/CMakeCache.txt ]]; then 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 fi
# run_build # run_build
cmake --build $bdir --config $build_type --parallel cmake --build "$bdir" --config $build_type --parallel
done done
} }

View File

@ -6,7 +6,7 @@ ii acl 2.3.1-1
ii adduser 3.118ubuntu5 all add and remove users and groups 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 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-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 apt 2.4.9 amd64 commandline package manager
ii aria2 1.36.0-1 amd64 High speed download utility 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) 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-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 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 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 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 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) 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 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: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 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 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.10 amd64 easy-to-use client-side URL transfer library (OpenSSL 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.10 i386 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:amd64 0.2.13-2 amd64 Double-array trie library
ii libdatrie1:i386 0.2.13-2 i386 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 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 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 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 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: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.1 i386 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-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-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) 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-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 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 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-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-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 1:6.2+dfsg-2ubuntu6.12 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-arm 1:6.2+dfsg-2ubuntu6.12 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-common 1:6.2+dfsg-2ubuntu6.12 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-data 1:6.2+dfsg-2ubuntu6.12 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-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.11 amd64 QEMU full system emulation binaries (mips) 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.11 amd64 QEMU full system emulation binaries (miscellaneous) 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.11 amd64 QEMU full system emulation binaries (ppc) 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.11 amd64 QEMU full system emulation binaries (s390x) 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.11 amd64 QEMU full system emulation binaries (sparc) 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.11 amd64 QEMU full system emulation binaries (x86) 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.11 amd64 QEMU user mode emulation binaries ii qemu-user 1:6.2+dfsg-2ubuntu6.12 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-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.11 amd64 QEMU utilities 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 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 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 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 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 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 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 2:8.2.3995-1ubuntu2.9 amd64 Vi IMproved - enhanced vi editor
ii vim-common 2:8.2.3995-1ubuntu2.8 all Vi IMproved - Common files ii vim-common 2:8.2.3995-1ubuntu2.9 all Vi IMproved - Common files
ii vim-runtime 2:8.2.3995-1ubuntu2.8 all Vi IMproved - Runtime 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 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 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 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 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 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 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 xz-utils 5.2.5-2ubuntu1 amd64 XZ-format compression utilities
ii yash 2.51-1 amd64 yet another shell ii yash 2.51-1 amd64 yet another shell
ii zip 3.0-12build2 amd64 Archiver for .zip files 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 ||/ Name Version Architecture Description
Packages sorted by Installed-Size: Packages sorted by Installed-Size:
8312145 ===== TOTAL (1219 packages) 8312149 ===== TOTAL (1219 packages)
545062 libwine amd64 545062 libwine amd64
474522 libwine i386 474522 libwine i386
270993 llvm-14-dev amd64 270993 llvm-14-dev amd64
@ -1248,7 +1248,7 @@ Packages sorted by Installed-Size:
62269 gcc-mingw-w64-x86-64-win32-runtime amd64 62269 gcc-mingw-w64-x86-64-win32-runtime amd64
59580 gcc-11-x86-64-linux-gnux32 amd64 59580 gcc-11-x86-64-linux-gnux32 amd64
59580 gcc-11-i686-linux-gnu amd64 59580 gcc-11-i686-linux-gnu amd64
59006 qemu-system-mips amd64 59002 qemu-system-mips amd64
58528 mingw-w64-common all 58528 mingw-w64-common all
58413 gcc-11-aarch64-linux-gnu amd64 58413 gcc-11-aarch64-linux-gnu amd64
57248 libclang-cpp14 amd64 57248 libclang-cpp14 amd64
@ -1329,7 +1329,7 @@ Packages sorted by Installed-Size:
21312 cpp-10-mips64el-linux-gnuabi64 amd64 21312 cpp-10-mips64el-linux-gnuabi64 amd64
21312 cpp-10-mips64-linux-gnuabi64 amd64 21312 cpp-10-mips64-linux-gnuabi64 amd64
21312 cpp-10-mips-linux-gnu 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 21064 cpp-11-sparc64-linux-gnu amd64
20742 cmake amd64 20742 cmake amd64
20701 libstdc++-11-dev-alpha-cross all 20701 libstdc++-11-dev-alpha-cross all
@ -1719,10 +1719,10 @@ Packages sorted by Installed-Size:
564 libssh-4 i386 564 libssh-4 i386
563 libpango-1.0-0 amd64 563 libpango-1.0-0 amd64
560 libglx-mesa0 amd64 560 libglx-mesa0 amd64
560 alsa-ucm-conf all
558 libtinfo6 amd64 558 libtinfo6 amd64
558 libodbc2 i386 558 libodbc2 i386
557 libmount1 i386 557 libmount1 i386
556 alsa-ucm-conf all
552 libgl1 i386 552 libgl1 i386
549 libvulkan1 i386 549 libvulkan1 i386
544 libtinfo5 amd64 544 libtinfo5 amd64

View File

@ -21,7 +21,7 @@ if [[ 1 == 1 ]]; then
flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 ) flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 )
# NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx # 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! # 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+=( -w /home/upx/src/upx ) # set working directory
flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs
flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs

View File

@ -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 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 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 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 dash 0.5.11+git20210903+057cd650a4ed-3build1 amd64 POSIX-compliant shell
ii debconf 1.5.79ubuntu1 all Debian configuration management system ii debconf 1.5.79ubuntu1 all Debian configuration management system
ii debianutils 5.5-1ubuntu2 amd64 Miscellaneous utilities specific to Debian 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 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 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 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 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.10 amd64 easy-to-use client-side URL transfer library (OpenSSL 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 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 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 ii libdebuginfod-common 0.186-1build1 all configuration to enable the Debian debug info server

View File

@ -1,4 +1,4 @@
test-qemu-with-podman test-qemu with Podman
===================== =====================
This directory provides some simple scripts for creating and running This directory provides some simple scripts for creating and running

View File

@ -21,7 +21,7 @@ if [[ 1 == 1 ]]; then
flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 ) flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 )
# NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx # 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! # 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+=( -w /home/upx/src/upx ) # set working directory
flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs
flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs

View File

@ -5,14 +5,19 @@ RUN apk update && apk upgrade && apk add \
bash-completion \ bash-completion \
musl-dbg \ musl-dbg \
qemu-aarch64 \ qemu-aarch64 \
qemu-aarch64_be \
qemu-arm \ qemu-arm \
qemu-armeb \ qemu-armeb \
qemu-i386 \ qemu-i386 \
qemu-m68k \
qemu-mips \ qemu-mips \
qemu-mipsel \ qemu-mipsel \
qemu-ppc \ qemu-ppc \
qemu-ppc64 \ qemu-ppc64 \
qemu-ppc64le \ qemu-ppc64le \
qemu-riscv32 \
qemu-riscv64 \
qemu-s390x \
qemu-x86_64 \ qemu-x86_64 \
strace \ strace \
&& true && true

View File

@ -21,7 +21,7 @@ if [[ 1 == 1 ]]; then
flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 ) flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 )
# NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx # 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! # 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+=( -w /home/upx/src/upx ) # set working directory
flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs
flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs

View File

@ -5,14 +5,19 @@ RUN apk update && apk upgrade && apk add \
bash-completion \ bash-completion \
musl-dbg \ musl-dbg \
qemu-aarch64 \ qemu-aarch64 \
qemu-aarch64_be \
qemu-arm \ qemu-arm \
qemu-armeb \ qemu-armeb \
qemu-i386 \ qemu-i386 \
qemu-m68k \
qemu-mips \ qemu-mips \
qemu-mipsel \ qemu-mipsel \
qemu-ppc \ qemu-ppc \
qemu-ppc64 \ qemu-ppc64 \
qemu-ppc64le \ qemu-ppc64le \
qemu-riscv32 \
qemu-riscv64 \
qemu-s390x \
qemu-x86_64 \ qemu-x86_64 \
strace \ strace \
&& true && true

View File

@ -21,7 +21,7 @@ if [[ 1 == 1 ]]; then
flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 ) flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 )
# NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx # 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! # 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+=( -w /home/upx/src/upx ) # set working directory
flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs
flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs

View File

@ -5,14 +5,19 @@ RUN apk update && apk upgrade && apk add \
bash-completion \ bash-completion \
musl-dbg \ musl-dbg \
qemu-aarch64 \ qemu-aarch64 \
qemu-aarch64_be \
qemu-arm \ qemu-arm \
qemu-armeb \ qemu-armeb \
qemu-i386 \ qemu-i386 \
qemu-m68k \
qemu-mips \ qemu-mips \
qemu-mipsel \ qemu-mipsel \
qemu-ppc \ qemu-ppc \
qemu-ppc64 \ qemu-ppc64 \
qemu-ppc64le \ qemu-ppc64le \
qemu-riscv32 \
qemu-riscv64 \
qemu-s390x \
qemu-x86_64 \ qemu-x86_64 \
strace \ strace \
&& true && true

View File

@ -21,7 +21,7 @@ if [[ 1 == 1 ]]; then
flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 ) flags+=( --gidmap=0:1:1000 --gidmap=2000:0:1 )
# NOTE: we mount the upx top-level directory read-write under /home/upx/src/upx # 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! # 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+=( -w /home/upx/src/upx ) # set working directory
flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs flags+=( --tmpfs /home/upx/.cache:rw,exec ) # mount a writeable tmpfs
flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs flags+=( --tmpfs /home/upx/.local:rw,exec ) # mount a writeable tmpfs

View File

@ -5,14 +5,19 @@ RUN apk update && apk upgrade && apk add \
bash-completion \ bash-completion \
musl-dbg \ musl-dbg \
qemu-aarch64 \ qemu-aarch64 \
qemu-aarch64_be \
qemu-arm \ qemu-arm \
qemu-armeb \ qemu-armeb \
qemu-i386 \ qemu-i386 \
qemu-m68k \
qemu-mips \ qemu-mips \
qemu-mipsel \ qemu-mipsel \
qemu-ppc \ qemu-ppc \
qemu-ppc64 \ qemu-ppc64 \
qemu-ppc64le \ qemu-ppc64le \
qemu-riscv32 \
qemu-riscv64 \
qemu-s390x \
qemu-x86_64 \ qemu-x86_64 \
strace \ strace \
&& true && true

View File

@ -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

View File

@ -5,14 +5,19 @@ RUN apk update && apk upgrade && apk add \
bash-completion \ bash-completion \
musl-dbg \ musl-dbg \
qemu-aarch64 \ qemu-aarch64 \
qemu-aarch64_be \
qemu-arm \ qemu-arm \
qemu-armeb \ qemu-armeb \
qemu-i386 \ qemu-i386 \
qemu-m68k \
qemu-mips \ qemu-mips \
qemu-mipsel \ qemu-mipsel \
qemu-ppc \ qemu-ppc \
qemu-ppc64 \ qemu-ppc64 \
qemu-ppc64le \ qemu-ppc64le \
qemu-riscv32 \
qemu-riscv64 \
qemu-s390x \
qemu-x86_64 \ qemu-x86_64 \
strace \ strace \
&& true && true

View File

@ -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

View File

@ -5,14 +5,19 @@ RUN apk update && apk upgrade && apk add \
bash-completion \ bash-completion \
musl-dbg \ musl-dbg \
qemu-aarch64 \ qemu-aarch64 \
qemu-aarch64_be \
qemu-arm \ qemu-arm \
qemu-armeb \ qemu-armeb \
qemu-i386 \ qemu-i386 \
qemu-m68k \
qemu-mips \ qemu-mips \
qemu-mipsel \ qemu-mipsel \
qemu-ppc \ qemu-ppc \
qemu-ppc64 \ qemu-ppc64 \
qemu-ppc64le \ qemu-ppc64le \
qemu-riscv32 \
qemu-riscv64 \
qemu-s390x \
qemu-x86_64 \ qemu-x86_64 \
strace \ strace \
&& true && true

View File

@ -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

View File

@ -1,18 +1,23 @@
FROM docker.io/library/alpine:3.18 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 \ RUN apk update && apk upgrade && apk add \
bash-completion \ bash-completion \
musl-dbg \ musl-dbg \
qemu-aarch64 \ qemu-aarch64 \
qemu-aarch64_be \
qemu-arm \ qemu-arm \
qemu-armeb \ qemu-armeb \
qemu-i386 \ qemu-i386 \
qemu-m68k \
qemu-mips \ qemu-mips \
qemu-mipsel \ qemu-mipsel \
qemu-ppc \ qemu-ppc \
qemu-ppc64 \ qemu-ppc64 \
qemu-ppc64le \ qemu-ppc64le \
qemu-riscv32 \
qemu-riscv64 \
qemu-s390x \
qemu-x86_64 \ qemu-x86_64 \
strace \ strace \
&& true && true

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -4,10 +4,14 @@ set -e; set -o pipefail
argv0=$0; argv0abs=$(readlink -en -- "$argv0"); argv0dir=$(dirname "$argv0abs") argv0=$0; argv0abs=$(readlink -en -- "$argv0"); argv0dir=$(dirname "$argv0abs")
# very first version of the upx-testsuite; requires: # very first version of the upx-testsuite; requires:
# $upx_exe # $upx_exe (required, but with convenience fallback "./upx")
# $upx_testsuite_SRCDIR (semi-optional) # $upx_testsuite_SRCDIR (required, but with convenience fallback)
# $upx_testsuite_BUILDDIR (optional) # $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 # see https://github.com/upx/upx-testsuite.git
@ -15,17 +19,30 @@ argv0=$0; argv0abs=$(readlink -en -- "$argv0"); argv0dir=$(dirname "$argv0abs")
# // init & checks # // 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 if [[ -z $upx_exe ]]; then echo "UPX-ERROR: please set \$upx_exe"; exit 1; fi
# convenience: try to make filename absolute if [[ ! -f $upx_exe ]]; then echo "UPX-ERROR: file '$upx_exe' does not exist"; exit 1; fi
[[ -f "$upx_exe" ]] && upx_exe=$(readlink -en -- "$upx_exe") upx_exe=$(readlink -en -- "$upx_exe") # make absolute
# upx_exe check, part1 upx_run=()
if ! $upx_exe --version-short >/dev/null; then echo "UPX-ERROR: FATAL: upx --version-short FAILED"; exit 1; fi if [[ -n $upx_exe_runner ]]; then
if ! $upx_exe -L >/dev/null 2>&1; then echo "UPX-ERROR: FATAL: upx -L FAILED"; exit 1; fi # usage examples:
if ! $upx_exe --help >/dev/null; then echo "UPX-ERROR: FATAL: upx --help FAILED"; exit 1; fi # 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 # upx_testsuite_SRCDIR
if [[ -z $upx_testsuite_SRCDIR ]]; then 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 if [[ -d "$argv0dir/../../../upx--upx-testsuite.git/files/packed" ]]; then
upx_testsuite_SRCDIR="$argv0dir/../../../upx--upx-testsuite.git" upx_testsuite_SRCDIR="$argv0dir/../../../upx--upx-testsuite.git"
elif [[ -d "$argv0dir/../../../upx-testsuite.git/files/packed" ]]; then 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" echo " and set (export) the envvar upx_testsuite_SRCDIR to the local file path"
exit 1 exit 1
fi fi
upx_testsuite_SRCDIR=$(readlink -en -- "$upx_testsuite_SRCDIR") upx_testsuite_SRCDIR=$(readlink -en -- "$upx_testsuite_SRCDIR") # make absolute
# upx_testsuite_BUILDDIR # upx_testsuite_BUILDDIR
if [[ -z $upx_testsuite_BUILDDIR ]]; then if [[ -z $upx_testsuite_BUILDDIR ]]; then
upx_testsuite_BUILDDIR="./tmp-upx-testsuite" upx_testsuite_BUILDDIR="./tmp-upx-testsuite"
fi fi
mkdir -p "$upx_testsuite_BUILDDIR" || exit 1 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 cd / && cd "$upx_testsuite_BUILDDIR" || exit 1
# upx_exe check, part2 # upx_run check, part2
if ! $upx_exe --version-short >/dev/null; then if ! "${upx_run[@]}" --version-short >/dev/null; then
echo "UPX-ERROR: FATAL: upx --version-short FAILED" 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 "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 exit 1
fi fi
if ! $upx_exe -L >/dev/null 2>&1; then echo "UPX-ERROR: FATAL: upx -L 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_exe --help >/dev/null; then echo "UPX-ERROR: FATAL: upx --help 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 # // setup
@ -83,12 +110,12 @@ cd testsuite_1 || exit 1
run_upx() { run_upx() {
local ec=0 local ec=0
if [[ $upx_testsuite_verbose == 1 ]]; then if [[ $UPX_TESTSUITE_VERBOSE == 1 ]]; then
echo "LOG: $upx_exe $@" echo "LOG: '${upx_run[*]}' $*"
fi fi
$upx_exe "$@" || ec=$? "${upx_run[@]}" "$@" || ec=$?
if [[ $ec != 0 ]]; then if [[ $ec != 0 ]]; then
echo "FATAL: $upx_exe $@" echo "FATAL: '${upx_run[*]}' $*"
echo " (exit code was $ec)" echo " (exit code was $ec)"
exit 42 exit 42
fi fi
@ -110,7 +137,7 @@ testsuite_split_f() {
} }
testsuite_check_sha() { 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 echo
cat $1/.sha256sums.current cat $1/.sha256sums.current
if ! cmp -s $1/.sha256sums.expected $1/.sha256sums.current; then if ! cmp -s $1/.sha256sums.expected $1/.sha256sums.current; then
@ -125,7 +152,7 @@ testsuite_check_sha() {
} }
testsuite_check_sha_decompressed() { 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 if ! cmp -s $1/.sha256sums.expected $1/.sha256sums.current; then
cat $1/.sha256sums.current cat $1/.sha256sums.current
echo "UPX-ERROR: FATAL: $1 FAILED: decompressed checksum mismatch" echo "UPX-ERROR: FATAL: $1 FAILED: decompressed checksum mismatch"
@ -147,14 +174,14 @@ testsuite_run_compress() {
testsuite_split_f "$f" testsuite_split_f "$f"
[[ -z $fb ]] && continue [[ -z $fb ]] && continue
echo "# $f" echo "# $f"
mkdir -p $testdir/$fsubdir $testdir/.decompressed/$fsubdir mkdir -p "$testdir/$fsubdir" "$testdir/.decompressed/$fsubdir"
run_upx -qq --prefer-ucl "$@" "$f" -o $testdir/$fsubdir/$fb run_upx -qq --prefer-ucl "$@" "$f" -o "$testdir/$fsubdir/$fb"
run_upx -qq -d $testdir/$fsubdir/$fb -o $testdir/.decompressed/$fsubdir/$fb run_upx -qq -d "$testdir/$fsubdir/$fb" -o "$testdir/.decompressed/$fsubdir/$fb"
done done
testsuite_check_sha $testdir testsuite_check_sha $testdir
run_upx -qq -l $testdir/*/* run_upx -qq -l "$testdir"/*/*
run_upx -qq --file-info $testdir/*/* run_upx -qq --file-info "$testdir"/*/*
run_upx -q -t $testdir/*/* run_upx -q -t "$testdir"/*/*
if [[ $testsuite_use_canonicalized == 1 ]]; then if [[ $testsuite_use_canonicalized == 1 ]]; then
# check that after decompression the file matches the canonicalized version # check that after decompression the file matches the canonicalized version
cp t020_canonicalized/.sha256sums.expected $testdir/.decompressed/ cp t020_canonicalized/.sha256sums.expected $testdir/.decompressed/
@ -172,7 +199,7 @@ testsuite_run_compress() {
# ************************************************************************/ # ************************************************************************/
recreate_expected_sha256sums() { recreate_expected_sha256sums() {
local o=$1 local o="$1"
local files f d local files f d
echo "########## begin .sha256sums.recreate" > "$o" echo "########## begin .sha256sums.recreate" > "$o"
files='*/.sha256sums.current' files='*/.sha256sums.current'
@ -199,8 +226,8 @@ for f in "$upx_testsuite_SRCDIR"/files/packed/*/upx-3.9[15]*; do
testsuite_split_f "$f" testsuite_split_f "$f"
[[ -z $fb ]] && continue [[ -z $fb ]] && continue
echo "# $f" echo "# $f"
mkdir -p $testdir/$fsubdir mkdir -p "$testdir/$fsubdir"
run_upx -qq -d "$f" -o $testdir/$fsubdir/$fb run_upx -qq -d "$f" -o "$testdir/$fsubdir/$fb"
done done
testsuite_check_sha $testdir testsuite_check_sha $testdir
@ -213,9 +240,9 @@ for f in t010_decompressed/*/*; do
testsuite_split_f "$f" testsuite_split_f "$f"
[[ -z $fb ]] && continue [[ -z $fb ]] && continue
echo "# $f" echo "# $f"
mkdir -p $testdir/$fsubdir/.packed mkdir -p "$testdir/$fsubdir/.packed"
run_upx -qq --prefer-ucl -1 "$f" -o $testdir/$fsubdir/.packed/$fb run_upx -qq --prefer-ucl -1 "$f" -o "$testdir/$fsubdir/.packed/$fb"
run_upx -qq -d $testdir/$fsubdir/.packed/$fb -o $testdir/$fsubdir/$fb run_upx -qq -d "$testdir/$fsubdir/.packed/$fb" -o "$testdir/$fsubdir/$fb"
done done
testsuite_check_sha $testdir testsuite_check_sha $testdir
@ -225,48 +252,43 @@ testsuite_check_sha $testdir
# // test UPX and not the compression libraries # // test UPX and not the compression libraries
# ************************************************************************/ # ************************************************************************/
case $UPX_TESTSUITE_FAST in if [[ $UPX_TESTSUITE_LEVEL -ge 2 ]]; then
[0-7]) ;;
*) UPX_TESTSUITE_FAST=999 ;;
esac
if [[ $UPX_TESTSUITE_FAST -ge 1 ]]; then
testdir=t110_compress_ucl_nrv2b_3_no_filter testdir=t110_compress_ucl_nrv2b_3_no_filter
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
time testsuite_run_compress --nrv2b -3 --no-filter time testsuite_run_compress --nrv2b -3 --no-filter
fi fi
if [[ $UPX_TESTSUITE_FAST -ge 2 ]]; then if [[ $UPX_TESTSUITE_LEVEL -ge 3 ]]; then
testdir=t120_compress_ucl_nrv2d_3_no_filter testdir=t120_compress_ucl_nrv2d_3_no_filter
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
time testsuite_run_compress --nrv2d -3 --no-filter time testsuite_run_compress --nrv2d -3 --no-filter
fi fi
if [[ $UPX_TESTSUITE_FAST -ge 3 ]]; then if [[ $UPX_TESTSUITE_LEVEL -ge 4 ]]; then
testdir=t130_compress_ucl_nrv2e_3_no_filter testdir=t130_compress_ucl_nrv2e_3_no_filter
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
time testsuite_run_compress --nrv2e -3 --no-filter time testsuite_run_compress --nrv2e -3 --no-filter
fi fi
if [[ $UPX_TESTSUITE_FAST -ge 4 ]]; then if [[ $UPX_TESTSUITE_LEVEL -ge 5 ]]; then
testdir=t140_compress_lzma_2_no_filter testdir=t140_compress_lzma_2_no_filter
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
time testsuite_run_compress --lzma -2 --no-filter time testsuite_run_compress --lzma -2 --no-filter
fi fi
if [[ $UPX_TESTSUITE_FAST -ge 5 ]]; then if [[ $UPX_TESTSUITE_LEVEL -ge 6 ]]; then
testdir=t150_compress_ucl_2_all_filters testdir=t150_compress_ucl_2_all_filters
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
time testsuite_run_compress -2 --all-filters time testsuite_run_compress -2 --all-filters
fi fi
if [[ $UPX_TESTSUITE_FAST -ge 6 ]]; then if [[ $UPX_TESTSUITE_LEVEL -ge 7 ]]; then
testdir=t160_compress_all_methods_1_no_filter testdir=t160_compress_all_methods_1_no_filter
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
time testsuite_run_compress --all-methods -1 --no-filter time testsuite_run_compress --all-methods -1 --no-filter
fi 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 testdir=t170_compress_all_methods_no_lzma_5_no_filter
mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected mkdir $testdir; v=expected_sha256sums__$testdir; echo -n "${!v}" >$testdir/.sha256sums.expected
time testsuite_run_compress --all-methods --no-lzma -5 --no-filter time testsuite_run_compress --all-methods --no-lzma -5 --no-filter
@ -283,10 +305,11 @@ testsuite_header "UPX testsuite summary"
run_upx --version-short run_upx --version-short
echo echo
echo "upx_exe='$upx_exe'" echo "upx_exe='$upx_exe'"
if [[ -f "$upx_exe" ]]; then if [[ -f $upx_exe ]]; then
ls -l "$upx_exe" ls -l "$upx_exe"
file "$upx_exe" || true file "$upx_exe" || true
fi fi
echo "upx_run='${upx_run[*]}'"
echo "upx_testsuite_SRCDIR='$upx_testsuite_SRCDIR'" echo "upx_testsuite_SRCDIR='$upx_testsuite_SRCDIR'"
echo "upx_testsuite_BUILDDIR='$upx_testsuite_BUILDDIR'" echo "upx_testsuite_BUILDDIR='$upx_testsuite_BUILDDIR'"
echo ".sha256sums.{expected,current} counts:" echo ".sha256sums.{expected,current} counts:"

View File

@ -352,6 +352,25 @@ struct TestIntegerWrap {
static inline bool neg_eq(const T x) noexcept { return T(0) - x == x; } 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 } // namespace
#define ACC_WANT_ACC_CHK_CH 1 #define ACC_WANT_ACC_CHK_CH 1
@ -359,6 +378,9 @@ struct TestIntegerWrap {
#include "../miniacc.h" #include "../miniacc.h"
void upx_compiler_sanity_check(void) noexcept { 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 #define ACC_WANT_ACC_CHK_CH 1
#undef ACCCHK_ASSERT #undef ACCCHK_ASSERT
#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT(expr) #define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT(expr)

View File

@ -401,8 +401,10 @@ inline void owner_delete(OwningPointer(T) (&object)) noexcept {
delete object; delete object;
object = nullptr; object = nullptr;
} }
#if defined(__clang__) || __GNUC__ != 7
template <class T> template <class T>
inline void owner_delete(T (&array)[]) noexcept DELETED_FUNCTION; inline void owner_delete(T (&array)[]) noexcept DELETED_FUNCTION;
#endif
template <class T, size_t N> template <class T, size_t N>
inline void owner_delete(T (&array)[N]) noexcept DELETED_FUNCTION; 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); static_assert(size >= 1 && size <= UPX_RSIZE_MAX_MEM);
memset((void *) object, 0, size); memset((void *) object, 0, size);
} }
#if defined(__clang__) || __GNUC__ != 7
template <class T> template <class T>
inline void mem_clear(T (&array)[]) noexcept DELETED_FUNCTION; inline void mem_clear(T (&array)[]) noexcept DELETED_FUNCTION;
#endif
template <class T, size_t N> template <class T, size_t N>
inline void mem_clear(T (&array)[N]) noexcept DELETED_FUNCTION; 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; unsigned membuffer_get_size(MemBuffer &mb) noexcept;
// util/dt_check.cpp // 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 upx_doctest_check(int argc, char **argv);
// main.cpp // main.cpp
extern const char *progname; extern const char *progname;

View File

@ -1,7 +1,7 @@
# #
# UPX stub Makefile - needs GNU make 3.81 or better # 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 # Otherwise you will need a number of special build tools like various
# cross-assemblers and cross-compilers - see README.SRC. # cross-assemblers and cross-compilers - see README.SRC.
# #

View File

@ -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 if very_unlikely (a_end < a || b_end < b) // wrap-around
throwCantPack("ptr_check_no_overlap-overflow"); throwCantPack("ptr_check_no_overlap-overflow");
// same as (!(a >= b_end || b >= a_end)) // 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) if very_unlikely (a < b_end && b < a_end)
throwCantPack("ptr_check_no_overlap-ab"); throwCantPack("ptr_check_no_overlap-ab");
} }