mirror of
https://github.com/upx/upx
synced 2025-10-05 19:20:23 +08:00
CI updates
This commit is contained in:
parent
b526eed346
commit
25a3c109c1
16
.github/workflows/ci.yml
vendored
16
.github/workflows/ci.yml
vendored
|
@ -12,8 +12,8 @@ env:
|
||||||
CMAKE_REQUIRED_QUIET: OFF
|
CMAKE_REQUIRED_QUIET: OFF
|
||||||
DEBIAN_FRONTEND: noninteractive
|
DEBIAN_FRONTEND: noninteractive
|
||||||
UPX_CMAKE_BUILD_FLAGS: --verbose
|
UPX_CMAKE_BUILD_FLAGS: --verbose
|
||||||
# 2023-08-22
|
# 2023-08-26
|
||||||
ZIG_DIST_VERSION: 0.12.0-dev.157+8e96be008
|
ZIG_DIST_VERSION: 0.12.0-dev.170+750998eef
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
job-rebuild-and-verify-stubs:
|
job-rebuild-and-verify-stubs:
|
||||||
|
@ -57,7 +57,7 @@ jobs:
|
||||||
if ! git diff --quiet; then git diff; exit 1; fi
|
if ! git diff --quiet; then git diff; exit 1; fi
|
||||||
|
|
||||||
job-linux-cmake: # uses cmake + make
|
job-linux-cmake: # uses cmake + make
|
||||||
if: ${{ true }}
|
if: true
|
||||||
needs: [ job-rebuild-and-verify-stubs ]
|
needs: [ job-rebuild-and-verify-stubs ]
|
||||||
name: ${{ format('{0} cmake', matrix.os) }}
|
name: ${{ format('{0} cmake', matrix.os) }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -134,7 +134,7 @@ jobs:
|
||||||
env -C build/extra/gcc/release upx_exe=./upx bash "$testsuite_1"
|
env -C build/extra/gcc/release upx_exe=./upx bash "$testsuite_1"
|
||||||
|
|
||||||
job-macos-cmake: # uses cmake + make
|
job-macos-cmake: # uses cmake + make
|
||||||
if: ${{ true }}
|
if: true
|
||||||
needs: [ job-rebuild-and-verify-stubs ]
|
needs: [ job-rebuild-and-verify-stubs ]
|
||||||
name: ${{ format('{0} cmake', matrix.os) }}
|
name: ${{ format('{0} cmake', matrix.os) }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -210,7 +210,7 @@ jobs:
|
||||||
env -C build/extra/clang/release upx_exe=./upx bash "$testsuite_1"
|
env -C build/extra/clang/release upx_exe=./upx bash "$testsuite_1"
|
||||||
|
|
||||||
job-windows-cmake: # uses cmake + msbuild
|
job-windows-cmake: # uses cmake + msbuild
|
||||||
if: ${{ true }}
|
if: true
|
||||||
needs: [ job-rebuild-and-verify-stubs ]
|
needs: [ job-rebuild-and-verify-stubs ]
|
||||||
name: ${{ format('{0} cmake', matrix.name) }}
|
name: ${{ format('{0} cmake', matrix.name) }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -265,7 +265,7 @@ jobs:
|
||||||
env -C build/release/Release upx_exe=./upx bash "$testsuite_1"
|
env -C build/release/Release upx_exe=./upx bash "$testsuite_1"
|
||||||
|
|
||||||
job-windows-toolchains: # build "by hand" using cmd.exe
|
job-windows-toolchains: # build "by hand" using cmd.exe
|
||||||
if: ${{ true }}
|
if: true
|
||||||
needs: [ job-rebuild-and-verify-stubs ]
|
needs: [ job-rebuild-and-verify-stubs ]
|
||||||
name: ${{ format('windows {0}', matrix.name) }}
|
name: ${{ format('windows {0}', matrix.name) }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -372,7 +372,7 @@ jobs:
|
||||||
env -C build/$C/$B/upx upx_exe=./upx.exe bash "$testsuite_1"
|
env -C build/$C/$B/upx upx_exe=./upx.exe bash "$testsuite_1"
|
||||||
|
|
||||||
job-linux-zigcc: # uses cmake + make
|
job-linux-zigcc: # uses cmake + make
|
||||||
if: ${{ true }}
|
if: github.repository_owner == 'upx'
|
||||||
needs: [ job-rebuild-and-verify-stubs ]
|
needs: [ job-rebuild-and-verify-stubs ]
|
||||||
name: ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }}
|
name: ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -485,5 +485,3 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
(cd build/zig/${ZIG_TARGET}${ZIG_PIC}/release && DESTDIR=$PWD/Install-with-cmake cmake --install .)
|
(cd build/zig/${ZIG_TARGET}${ZIG_PIC}/release && DESTDIR=$PWD/Install-with-cmake cmake --install .)
|
||||||
(cd build/zig/${ZIG_TARGET}${ZIG_PIC}/release && DESTDIR=$PWD/Install-with-make make install)
|
(cd build/zig/${ZIG_TARGET}${ZIG_PIC}/release && DESTDIR=$PWD/Install-with-make make install)
|
||||||
|
|
||||||
# vim:set ts=2 sw=2 et:
|
|
||||||
|
|
|
@ -17,7 +17,8 @@ on:
|
||||||
schedule: [cron: '50 0 * * 3'] # run weekly Wednesday 00:50 UTC
|
schedule: [cron: '50 0 * * 3'] # run weekly Wednesday 00:50 UTC
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
jobs:
|
jobs:
|
||||||
close-issues:
|
job-close-inactive-issues:
|
||||||
|
if: github.repository_owner == 'upx'
|
||||||
name: 'Close inactive issues'
|
name: 'Close inactive issues'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
|
|
|
@ -4,7 +4,8 @@ on:
|
||||||
#pull_request:
|
#pull_request:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
jobs:
|
jobs:
|
||||||
close-pull-requests:
|
job-close-pull-requests:
|
||||||
|
if: github.repository_owner == 'upx'
|
||||||
name: 'Close pull requests'
|
name: 'Close pull requests'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
|
|
1
.github/workflows/misc-spell-check.yml
vendored
1
.github/workflows/misc-spell-check.yml
vendored
|
@ -9,6 +9,7 @@ env:
|
||||||
DEBIAN_FRONTEND: noninteractive
|
DEBIAN_FRONTEND: noninteractive
|
||||||
jobs:
|
jobs:
|
||||||
job-spell-check:
|
job-spell-check:
|
||||||
|
if: github.repository_owner == 'upx'
|
||||||
name: 'Spell check'
|
name: 'Spell check'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
|
@ -10,6 +10,7 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
job-analyze-clang-analyzer: # uses cmake + make
|
job-analyze-clang-analyzer: # uses cmake + make
|
||||||
|
if: github.repository_owner == 'upx'
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix: {container: ['alpine:3.16','alpine:3.17','alpine:3.18','alpine:edge','i386/alpine:edge']}
|
matrix: {container: ['alpine:3.16','alpine:3.17','alpine:3.18','alpine:edge','i386/alpine:edge']}
|
||||||
|
|
|
@ -10,9 +10,10 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
job-analyze-clang-tidy: # uses cmake + make
|
job-analyze-clang-tidy: # uses cmake + make
|
||||||
|
if: github.repository_owner == 'upx'
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix: {container: ['alpine:edge','i386/alpine:edge']}
|
matrix: {container: ['alpine:3.18','alpine:edge','i386/alpine:edge']}
|
||||||
name: ${{ format('Analyze clang-tidy {0}', matrix.container) }}
|
name: ${{ format('Analyze clang-tidy {0}', matrix.container) }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: ${{ matrix.container }}
|
container: ${{ matrix.container }}
|
||||||
|
|
1
.github/workflows/static-analyzer-codeql.yml
vendored
1
.github/workflows/static-analyzer-codeql.yml
vendored
|
@ -10,6 +10,7 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
job-analyze-codeql:
|
job-analyze-codeql:
|
||||||
|
if: github.repository_owner == 'upx'
|
||||||
name: Analyze
|
name: Analyze
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
|
|
4
.github/workflows/test-alpine-linux.yml
vendored
4
.github/workflows/test-alpine-linux.yml
vendored
|
@ -11,7 +11,7 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
job-alpine-clang: # uses cmake + make
|
job-alpine-clang: # uses cmake + make
|
||||||
if: ${{ true }}
|
if: true
|
||||||
strategy: { matrix: { container: ['alpine:edge','i386/alpine:edge'] } }
|
strategy: { matrix: { container: ['alpine:edge','i386/alpine:edge'] } }
|
||||||
name: ${{ format('clang {0}', matrix.container) }}
|
name: ${{ format('clang {0}', matrix.container) }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -38,7 +38,7 @@ jobs:
|
||||||
path: 'upx*/build/*/upx'
|
path: 'upx*/build/*/upx'
|
||||||
|
|
||||||
job-alpine-gcc: # uses cmake + make
|
job-alpine-gcc: # uses cmake + make
|
||||||
if: ${{ true }}
|
if: true
|
||||||
strategy: { matrix: { container: ['alpine:edge','i386/alpine:edge'] } }
|
strategy: { matrix: { container: ['alpine:edge','i386/alpine:edge'] } }
|
||||||
name: ${{ format('gcc {0}', matrix.container) }}
|
name: ${{ format('gcc {0}', matrix.container) }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
2
.github/workflows/test-unused.yml
vendored
2
.github/workflows/test-unused.yml
vendored
|
@ -8,7 +8,7 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
job-unused: # uses cmake + make
|
job-unused: # uses cmake + make
|
||||||
if: ${{ true }}
|
if: true
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- run: |
|
- run: |
|
||||||
|
|
2
.github/workflows/weekly-ci-bs-by-hand.yml
vendored
2
.github/workflows/weekly-ci-bs-by-hand.yml
vendored
|
@ -13,7 +13,7 @@ jobs:
|
||||||
job-alpine-by-hand: # uses a POSIX-compliant shell
|
job-alpine-by-hand: # uses a POSIX-compliant shell
|
||||||
# ...and also uses a subdirectory "upx with space" in order to detect possible quoting issues
|
# ...and also uses a subdirectory "upx with space" in order to detect possible quoting issues
|
||||||
# ...and also uses ccache as we are running the same build-script again and again
|
# ...and also uses ccache as we are running the same build-script again and again
|
||||||
if: ${{ true }}
|
if: github.repository_owner == 'upx'
|
||||||
strategy: { matrix: { container: ['alpine:3.9','alpine:edge'] } }
|
strategy: { matrix: { container: ['alpine:3.9','alpine:edge'] } }
|
||||||
name: ${{ format('gcc by-hand {0}', matrix.container) }}
|
name: ${{ format('gcc by-hand {0}', matrix.container) }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
@ -11,6 +11,7 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
job-cmake-macos-xcode: # uses cmake + xcodebuild
|
job-cmake-macos-xcode: # uses cmake + xcodebuild
|
||||||
|
if: github.repository_owner == 'upx'
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|
|
@ -13,6 +13,7 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
job-cmake-windows-nmake: # uses cmake + nmake
|
job-cmake-windows-nmake: # uses cmake + nmake
|
||||||
|
if: github.repository_owner == 'upx'
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|
|
@ -21,6 +21,7 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
job-alpine-cmake: # uses cmake + make
|
job-alpine-cmake: # uses cmake + make
|
||||||
|
if: github.repository_owner == 'upx'
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix: { container: ['alpine:3.9','alpine:3.10','alpine:3.11','alpine:3.12','alpine:3.13','alpine:3.14','alpine:3.15','alpine:3.16','alpine:3.17','alpine:3.18','alpine:edge','i386/alpine:edge'] }
|
matrix: { container: ['alpine:3.9','alpine:3.10','alpine:3.11','alpine:3.12','alpine:3.13','alpine:3.14','alpine:3.15','alpine:3.16','alpine:3.17','alpine:3.18','alpine:edge','i386/alpine:edge'] }
|
||||||
|
@ -155,5 +156,3 @@ jobs:
|
||||||
export upx_testsuite_SRCDIR="$(readlink -fn "upx-testsuite with space")"
|
export upx_testsuite_SRCDIR="$(readlink -fn "upx-testsuite with space")"
|
||||||
testsuite_1="$(readlink -fn "upx with space"/misc/testsuite/upx_testsuite_1.sh)"
|
testsuite_1="$(readlink -fn "upx with space"/misc/testsuite/upx_testsuite_1.sh)"
|
||||||
(cd "upx with space"/build/xtarget/gcc-static/release && upx_exe=./upx bash "$testsuite_1")
|
(cd "upx with space"/build/xtarget/gcc-static/release && upx_exe=./upx bash "$testsuite_1")
|
||||||
|
|
||||||
# vim:set ts=2 sw=2 et:
|
|
||||||
|
|
14
.github/workflows/weekly-ci-cc-llvm-mingw.yml
vendored
14
.github/workflows/weekly-ci-cc-llvm-mingw.yml
vendored
|
@ -13,7 +13,7 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
job-llvm-mingw: # uses cmake+make
|
job-llvm-mingw: # uses cmake+make
|
||||||
if: ${{ true }}
|
if: github.repository_owner == 'upx'
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -24,12 +24,12 @@ jobs:
|
||||||
- name: llvm-mingw-20230614-ucrt
|
- name: llvm-mingw-20230614-ucrt
|
||||||
llvm_version: 16.0.6
|
llvm_version: 16.0.6
|
||||||
url: 'https://github.com/mstorsjo/llvm-mingw/releases/download/20230614/llvm-mingw-20230614-ucrt-ubuntu-20.04-x86_64.tar.xz'
|
url: 'https://github.com/mstorsjo/llvm-mingw/releases/download/20230614/llvm-mingw-20230614-ucrt-ubuntu-20.04-x86_64.tar.xz'
|
||||||
- name: llvm-mingw-20230811-msvcrt
|
- name: llvm-mingw-20230822-msvcrt
|
||||||
llvm_version: 17.0.0rc2
|
llvm_version: 17.0.0rc3
|
||||||
url: 'https://github.com/mstorsjo/llvm-mingw/releases/download/20230811/llvm-mingw-20230811-msvcrt-ubuntu-20.04-x86_64.tar.xz'
|
url: 'https://github.com/mstorsjo/llvm-mingw/releases/download/20230822/llvm-mingw-20230822-msvcrt-ubuntu-20.04-x86_64.tar.xz'
|
||||||
- name: llvm-mingw-20230811-ucrt
|
- name: llvm-mingw-20230822-ucrt
|
||||||
llvm_version: 17.0.0rc2
|
llvm_version: 17.0.0rc3
|
||||||
url: 'https://github.com/mstorsjo/llvm-mingw/releases/download/20230811/llvm-mingw-20230811-ucrt-ubuntu-20.04-x86_64.tar.xz'
|
url: 'https://github.com/mstorsjo/llvm-mingw/releases/download/20230822/llvm-mingw-20230822-ucrt-ubuntu-20.04-x86_64.tar.xz'
|
||||||
name: ${{ format('{0} {1}', matrix.name, matrix.llvm_version) }}
|
name: ${{ format('{0} {1}', matrix.name, matrix.llvm_version) }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
7
.github/workflows/weekly-ci-cc-zigcc.yml
vendored
7
.github/workflows/weekly-ci-cc-zigcc.yml
vendored
|
@ -10,11 +10,12 @@ on:
|
||||||
env:
|
env:
|
||||||
CMAKE_REQUIRED_QUIET: OFF
|
CMAKE_REQUIRED_QUIET: OFF
|
||||||
DEBIAN_FRONTEND: noninteractive
|
DEBIAN_FRONTEND: noninteractive
|
||||||
# 2023-08-22
|
# 2023-08-26
|
||||||
ZIG_DIST_VERSION: 0.12.0-dev.157+8e96be008
|
ZIG_DIST_VERSION: 0.12.0-dev.170+750998eef
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
job-linux-zigcc: # uses cmake + make
|
job-linux-zigcc: # uses cmake + make
|
||||||
|
if: github.repository_owner == 'upx'
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -125,5 +126,3 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
(cd build/zig/${ZIG_TARGET}${ZIG_PIC}/release && DESTDIR=$PWD/Install-with-cmake cmake --install .)
|
(cd build/zig/${ZIG_TARGET}${ZIG_PIC}/release && DESTDIR=$PWD/Install-with-cmake cmake --install .)
|
||||||
(cd build/zig/${ZIG_TARGET}${ZIG_PIC}/release && DESTDIR=$PWD/Install-with-make make install)
|
(cd build/zig/${ZIG_TARGET}${ZIG_PIC}/release && DESTDIR=$PWD/Install-with-make make install)
|
||||||
|
|
||||||
# vim:set ts=2 sw=2 et:
|
|
||||||
|
|
3
.github/workflows/weekly-ci-rt-checkers.yml
vendored
3
.github/workflows/weekly-ci-rt-checkers.yml
vendored
|
@ -13,6 +13,7 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
job-runtime-checkers: # uses cmake + make
|
job-runtime-checkers: # uses cmake + make
|
||||||
|
if: github.repository_owner == 'upx'
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -93,7 +94,7 @@ jobs:
|
||||||
export upx_exe_runner="${{ matrix.qemu }}"
|
export upx_exe_runner="${{ matrix.qemu }}"
|
||||||
env -C build/xtarget/clang-static/$release "$PWD"/misc/testsuite/upx_testsuite_1.sh
|
env -C build/xtarget/clang-static/$release "$PWD"/misc/testsuite/upx_testsuite_1.sh
|
||||||
- name: 'Run testsuite clang-static - Valgrind'
|
- name: 'Run testsuite clang-static - Valgrind'
|
||||||
if: ${{ true }} # very slow
|
if: true # very slow
|
||||||
run: |
|
run: |
|
||||||
export upx_exe_runner="valgrind --error-exitcode=1 --quiet"
|
export upx_exe_runner="valgrind --error-exitcode=1 --quiet"
|
||||||
# on current GitHub CI, takes about 30 minutes for release and 80 minutes for debug builds
|
# on current GitHub CI, takes about 30 minutes for release and 80 minutes for debug builds
|
||||||
|
|
2
doc/upx.1
generated
2
doc/upx.1
generated
|
@ -133,7 +133,7 @@
|
||||||
.\" ========================================================================
|
.\" ========================================================================
|
||||||
.\"
|
.\"
|
||||||
.IX Title "UPX 1"
|
.IX Title "UPX 1"
|
||||||
.TH UPX 1 "2023-08-08" "upx 4.2.0" " "
|
.TH UPX 1 "2023-08-25" "upx 4.2.0" " "
|
||||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||||
.\" way too many mistakes in technical documents.
|
.\" way too many mistakes in technical documents.
|
||||||
.if n .ad l
|
.if n .ad l
|
||||||
|
|
|
@ -117,7 +117,7 @@ struct TestTriBool {
|
||||||
static_assert(sizeof(typename T::value_type) == sizeof(typename T::underlying_type));
|
static_assert(sizeof(typename T::value_type) == sizeof(typename T::underlying_type));
|
||||||
static_assert(alignof(typename T::value_type) == alignof(typename T::underlying_type));
|
static_assert(alignof(typename T::value_type) == alignof(typename T::underlying_type));
|
||||||
#if (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC) && defined(__MINT__)
|
#if (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC) && defined(__MINT__)
|
||||||
// broken compiler
|
// broken compiler or broken ABI
|
||||||
#else
|
#else
|
||||||
static_assert(sizeof(T) == sizeof(typename T::underlying_type));
|
static_assert(sizeof(T) == sizeof(typename T::underlying_type));
|
||||||
static_assert(alignof(T) == alignof(typename T::underlying_type));
|
static_assert(alignof(T) == alignof(typename T::underlying_type));
|
||||||
|
@ -127,6 +127,14 @@ struct TestTriBool {
|
||||||
static_assert(T(T::False) == T::False);
|
static_assert(T(T::False) == T::False);
|
||||||
static_assert(T(T::True) == T::True);
|
static_assert(T(T::True) == T::True);
|
||||||
static_assert(T(T::Third) == T::Third);
|
static_assert(T(T::Third) == T::Third);
|
||||||
|
static_assert(T(T::Third) == T(9));
|
||||||
|
static_assert(T(8) == T(9));
|
||||||
|
static_assert(!(T(0) == T(9)));
|
||||||
|
static_assert(!(T(1) == T(9)));
|
||||||
|
static_assert(T(T::Third) == 9);
|
||||||
|
static_assert(T(8) == 9);
|
||||||
|
static_assert(!(T(0) == 9));
|
||||||
|
static_assert(!(T(1) == 9));
|
||||||
constexpr T array[] = {false, true, T::Third};
|
constexpr T array[] = {false, true, T::Third};
|
||||||
static_assert(array[0].isStrictFalse());
|
static_assert(array[0].isStrictFalse());
|
||||||
static_assert(array[1].isStrictTrue());
|
static_assert(array[1].isStrictTrue());
|
||||||
|
|
|
@ -95,7 +95,7 @@ template <class T>
|
||||||
inline constexpr bool upx_is_integral_v = upx_is_integral<T>::value;
|
inline constexpr bool upx_is_integral_v = upx_is_integral<T>::value;
|
||||||
|
|
||||||
#if (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC) && defined(__MINT__)
|
#if (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC) && defined(__MINT__)
|
||||||
// horrible hack for broken compiler
|
// horrible hack for broken compiler / ABI
|
||||||
#define upx_fake_alignas_1 __attribute__((__aligned__(1),__packed__))
|
#define upx_fake_alignas_1 __attribute__((__aligned__(1),__packed__))
|
||||||
#define upx_fake_alignas_16 __attribute__((__aligned__(2))) // object file maximum 2 ???
|
#define upx_fake_alignas_16 __attribute__((__aligned__(2))) // object file maximum 2 ???
|
||||||
#define upx_fake_alignas__(x) upx_fake_alignas_ ## x
|
#define upx_fake_alignas__(x) upx_fake_alignas_ ## x
|
||||||
|
|
|
@ -104,7 +104,7 @@ struct PackerNames {
|
||||||
const Options *o;
|
const Options *o;
|
||||||
PackerNames() : names_count(0), o(nullptr) {}
|
PackerNames() : names_count(0), o(nullptr) {}
|
||||||
void add(const PackerBase *pb) {
|
void add(const PackerBase *pb) {
|
||||||
assert(names_count < 64);
|
assert_noexcept(names_count < 64);
|
||||||
names[names_count].fname = pb->getFullName(o);
|
names[names_count].fname = pb->getFullName(o);
|
||||||
names[names_count].sname = pb->getName();
|
names[names_count].sname = pb->getName();
|
||||||
names_count++;
|
names_count++;
|
||||||
|
|
10
src/packer.h
10
src/packer.h
|
@ -57,13 +57,13 @@ public:
|
||||||
virtual const int *getCompressionMethods(int method, int level) const = 0;
|
virtual const int *getCompressionMethods(int method, int level) const = 0;
|
||||||
virtual const int *getFilters() const = 0;
|
virtual const int *getFilters() const = 0;
|
||||||
|
|
||||||
// canPack() should throw a cantPackException eplaining why it cannot pack
|
// canPack() should throw a cantPackException explaining why it cannot pack
|
||||||
// a recognized format.
|
// a recognized format.
|
||||||
// canPack() can return -1 to fail early; see class PackMaster
|
// canPack() can also return -1 to fail early; see class PackMaster
|
||||||
virtual tribool canPack() = 0;
|
virtual tribool canPack() = 0;
|
||||||
// canUnpack() should throw a cantUnpackException eplaining why it cannot pack
|
// canUnpack() should throw a cantUnpackException explaining why it cannot pack
|
||||||
// a recognized format.
|
// a recognized format.
|
||||||
// canUnpack() can return -1 to fail early; see class PackMaster
|
// canUnpack() can also return -1 to fail early; see class PackMaster
|
||||||
virtual tribool canUnpack() = 0;
|
virtual tribool canUnpack() = 0;
|
||||||
|
|
||||||
// PackMaster entries
|
// PackMaster entries
|
||||||
|
@ -80,7 +80,7 @@ protected:
|
||||||
InputFile *const fi; // reference
|
InputFile *const fi; // reference
|
||||||
union { // unnamed union
|
union { // unnamed union
|
||||||
const upx_int64_t file_size; // must get set by constructor
|
const upx_int64_t file_size; // must get set by constructor
|
||||||
const upx_uint64_t file_size_u; // explicitly unsigned
|
const upx_uint64_t file_size_u; // (explicitly unsigned)
|
||||||
};
|
};
|
||||||
PackHeader ph; // must be filled by canUnpack(); also used by UiPacker
|
PackHeader ph; // must be filled by canUnpack(); also used by UiPacker
|
||||||
};
|
};
|
||||||
|
|
|
@ -65,6 +65,7 @@ PackMaster::PackMaster(InputFile *f, Options *o) noexcept : fi(f) {
|
||||||
// replace global options with local options
|
// replace global options with local options
|
||||||
if (o != nullptr) {
|
if (o != nullptr) {
|
||||||
#if WITH_THREADS
|
#if WITH_THREADS
|
||||||
|
// TODO later: check for possible "noexcept" violation here
|
||||||
std::lock_guard<std::mutex> lock(opt_lock_mutex);
|
std::lock_guard<std::mutex> lock(opt_lock_mutex);
|
||||||
#endif
|
#endif
|
||||||
saved_opt = o;
|
saved_opt = o;
|
||||||
|
@ -78,6 +79,7 @@ PackMaster::~PackMaster() noexcept {
|
||||||
// restore global options
|
// restore global options
|
||||||
if (saved_opt != nullptr) {
|
if (saved_opt != nullptr) {
|
||||||
#if WITH_THREADS
|
#if WITH_THREADS
|
||||||
|
// TODO later: check for possible "noexcept" violation here
|
||||||
std::lock_guard<std::mutex> lock(opt_lock_mutex);
|
std::lock_guard<std::mutex> lock(opt_lock_mutex);
|
||||||
#endif
|
#endif
|
||||||
opt = saved_opt;
|
opt = saved_opt;
|
||||||
|
|
|
@ -121,7 +121,9 @@ struct TriBool final {
|
||||||
// equality
|
// equality
|
||||||
constexpr bool operator==(TriBool other) const noexcept { return value == other.value; }
|
constexpr bool operator==(TriBool other) const noexcept { return value == other.value; }
|
||||||
constexpr bool operator==(value_type other) const noexcept { return value == other; }
|
constexpr bool operator==(value_type other) const noexcept { return value == other; }
|
||||||
constexpr bool operator==(promoted_type other) const noexcept { return value == other; }
|
constexpr bool operator==(promoted_type other) const noexcept {
|
||||||
|
return value == TriBool(other).value;
|
||||||
|
}
|
||||||
|
|
||||||
// "Third" can mean many things, depending on usage context, so provide some alternative names:
|
// "Third" can mean many things, depending on usage context, so provide some alternative names:
|
||||||
// constexpr bool isDefault() const noexcept { return isThird(); } // might be misleading
|
// constexpr bool isDefault() const noexcept { return isThird(); } // might be misleading
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#define UPX_VERSION_HEX 0x040200 /* 04.02.00 */
|
#define UPX_VERSION_HEX 0x040200 /* 04.02.00 */
|
||||||
#define UPX_VERSION_STRING "4.2.0"
|
#define UPX_VERSION_STRING "4.2.0"
|
||||||
#define UPX_VERSION_STRING4 "4.20"
|
#define UPX_VERSION_STRING4 "4.20"
|
||||||
#define UPX_VERSION_DATE "Aug 8th 2023"
|
#define UPX_VERSION_DATE "Aug 25th 2023"
|
||||||
#define UPX_VERSION_DATE_ISO "2023-08-08"
|
#define UPX_VERSION_DATE_ISO "2023-08-25"
|
||||||
#define UPX_VERSION_YEAR "2023"
|
#define UPX_VERSION_YEAR "2023"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user