CI updates
This commit is contained in:
+16
-16
@@ -293,8 +293,8 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- { name: windows-2019-amd64, os: windows-2019, vsversion: 2019, arch: amd64 }
|
- { name: windows-2019-amd64, os: windows-2019, vsversion: 2019, vsarch: amd64 }
|
||||||
- { name: windows-2022-amd64, os: windows-2022, vsversion: 2022, arch: amd64 }
|
- { name: windows-2022-amd64, os: windows-2022, vsversion: 2022, vsarch: amd64 }
|
||||||
steps:
|
steps:
|
||||||
- run: git config --global core.autocrlf false
|
- run: git config --global core.autocrlf false
|
||||||
- name: 'Check out code'
|
- name: 'Check out code'
|
||||||
@@ -306,7 +306,7 @@ jobs:
|
|||||||
uses: ilammy/msvc-dev-cmd@v1
|
uses: ilammy/msvc-dev-cmd@v1
|
||||||
with:
|
with:
|
||||||
vsversion: ${{ matrix.vsversion }}
|
vsversion: ${{ matrix.vsversion }}
|
||||||
arch: ${{ matrix.arch }}
|
arch: ${{ matrix.vsarch }}
|
||||||
- name: 'Build debug'
|
- name: 'Build debug'
|
||||||
run: 'make build/debug'
|
run: 'make build/debug'
|
||||||
- name: 'Build release'
|
- name: 'Build release'
|
||||||
@@ -325,12 +325,12 @@ jobs:
|
|||||||
name: ${{ env.artifact_name }}
|
name: ${{ env.artifact_name }}
|
||||||
path: tmp/artifact
|
path: tmp/artifact
|
||||||
- name: 'Run ctest tests'
|
- name: 'Run ctest tests'
|
||||||
if: ${{ matrix.arch != 'amd64_arm64' }}
|
if: ${{ matrix.vsarch != 'amd64_arm64' }}
|
||||||
run: |
|
run: |
|
||||||
ctest --test-dir build/debug -C Debug
|
ctest --test-dir build/debug -C Debug
|
||||||
ctest --test-dir build/release -C Release
|
ctest --test-dir build/release -C Release
|
||||||
- name: 'Run test suite build/release'
|
- name: 'Run test suite build/release'
|
||||||
if: ${{ matrix.arch != 'amd64_arm64' }}
|
if: ${{ matrix.vsarch != 'amd64_arm64' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)"
|
export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)"
|
||||||
@@ -348,14 +348,14 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- { name: amd64-win64-vs2019, os: windows-2019, vsversion: 2019, arch: amd64 }
|
- { name: amd64-win64-vs2019, os: windows-2019, vsversion: 2019, vsarch: amd64 }
|
||||||
- { name: amd64-win64-vs2022, os: windows-2022, vsversion: 2022, arch: amd64 }
|
- { name: amd64-win64-vs2022, os: windows-2022, vsversion: 2022, vsarch: amd64 }
|
||||||
- { name: arm64-win64-vs2019, os: windows-2019, vsversion: 2019, arch: amd64_arm64 }
|
- { name: arm64-win64-vs2019, os: windows-2019, vsversion: 2019, vsarch: amd64_arm64 }
|
||||||
- { name: arm64-win64-vs2022, os: windows-2022, vsversion: 2022, arch: amd64_arm64 }
|
- { name: arm64-win64-vs2022, os: windows-2022, vsversion: 2022, vsarch: amd64_arm64 }
|
||||||
- { name: arm64ec-win64-vs2022, os: windows-2022, vsversion: 2022, arch: amd64_arm64, cl_machine_flags: -arm64EC, link_machine_flags: '/machine:arm64ec' }
|
- { name: arm64ec-win64-vs2022, os: windows-2022, vsversion: 2022, vsarch: amd64_arm64, cl_machine_flags: -arm64EC, link_machine_flags: '/machine:arm64ec' }
|
||||||
# { name: arm64x-win64-vs2022, os: windows-2022, vsversion: 2022, arch: amd64_arm64, cl_machine_flags: -arm64EC, link_machine_flags: '/machine:arm64x' }
|
# { name: arm64x-win64-vs2022, os: windows-2022, vsversion: 2022, vsarch: amd64_arm64, cl_machine_flags: -arm64EC, link_machine_flags: '/machine:arm64x' }
|
||||||
- { name: i386-win32-vs2019, os: windows-2019, vsversion: 2019, arch: amd64_x86 }
|
- { name: i386-win32-vs2019, os: windows-2019, vsversion: 2019, vsarch: amd64_x86 }
|
||||||
- { name: i386-win32-vs2022, os: windows-2022, vsversion: 2022, arch: amd64_x86 }
|
- { name: i386-win32-vs2022, os: windows-2022, vsversion: 2022, vsarch: amd64_x86 }
|
||||||
steps:
|
steps:
|
||||||
- run: git config --global core.autocrlf false
|
- run: git config --global core.autocrlf false
|
||||||
- name: 'Check out code'
|
- name: 'Check out code'
|
||||||
@@ -372,7 +372,7 @@ jobs:
|
|||||||
uses: ilammy/msvc-dev-cmd@v1
|
uses: ilammy/msvc-dev-cmd@v1
|
||||||
with:
|
with:
|
||||||
vsversion: ${{ matrix.vsversion }}
|
vsversion: ${{ matrix.vsversion }}
|
||||||
arch: ${{ matrix.arch }}
|
arch: ${{ matrix.vsarch }}
|
||||||
- name: 'Build by hand'
|
- name: 'Build by hand'
|
||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
@@ -426,7 +426,7 @@ jobs:
|
|||||||
name: ${{ env.artifact_name }}
|
name: ${{ env.artifact_name }}
|
||||||
path: tmp/artifact
|
path: tmp/artifact
|
||||||
- name: 'Run basic tests'
|
- name: 'Run basic tests'
|
||||||
if: ${{ matrix.arch != 'amd64_arm64' }}
|
if: ${{ matrix.vsarch != 'amd64_arm64' }}
|
||||||
run: |
|
run: |
|
||||||
$ErrorActionPreference = 'stop'
|
$ErrorActionPreference = 'stop'
|
||||||
$ErrorView = 'NormalView'
|
$ErrorView = 'NormalView'
|
||||||
@@ -440,7 +440,7 @@ jobs:
|
|||||||
.\upx.exe -t upx_packed.exe
|
.\upx.exe -t upx_packed.exe
|
||||||
.\upx_packed.exe --version
|
.\upx_packed.exe --version
|
||||||
- name: 'Run test suite'
|
- name: 'Run test suite'
|
||||||
if: ${{ matrix.arch != 'amd64_arm64' }}
|
if: ${{ matrix.vsarch != 'amd64_arm64' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)"
|
export upx_testsuite_SRCDIR="$(readlink -en ../deps/upx-testsuite)"
|
||||||
|
|||||||
@@ -110,7 +110,11 @@ endfunction()
|
|||||||
function(upx_add_glob_files) # ARGV
|
function(upx_add_glob_files) # ARGV
|
||||||
set(var_name ${ARGV0})
|
set(var_name ${ARGV0})
|
||||||
list(REMOVE_AT ARGV 0)
|
list(REMOVE_AT ARGV 0)
|
||||||
file(GLOB files ${ARGV})
|
if(${CMAKE_VERSION} VERSION_LESS "3.3")
|
||||||
|
file(GLOB files ${ARGV})
|
||||||
|
else()
|
||||||
|
file(GLOB files LIST_DIRECTORIES false ${ARGV})
|
||||||
|
endif()
|
||||||
set(result "")
|
set(result "")
|
||||||
if(DEFINED ${var_name})
|
if(DEFINED ${var_name})
|
||||||
set(result "${${var_name}}")
|
set(result "${${var_name}}")
|
||||||
|
|||||||
+31
-9
@@ -370,6 +370,36 @@ static noinline double u64_f64_sub_div(upx_uint64_t a, upx_uint64_t b) {
|
|||||||
return (a - b) / 1000000.0;
|
return (a - b) / 1000000.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// extra debugging; floating point edge cases cause portability problems in practice
|
||||||
|
static noinline bool shall_test_float_division_by_zero(void) {
|
||||||
|
static bool result = false; // default is false
|
||||||
|
static upx_std_once_flag init_done;
|
||||||
|
upx_std_call_once(init_done, []() noexcept {
|
||||||
|
const char envvar[] = "UPX_DEBUG_TEST_FLOAT_DIVISION_BY_ZERO";
|
||||||
|
const char *e = getenv(envvar);
|
||||||
|
bool force = (e && e[0] && strcmp(e, "2") == 0);
|
||||||
|
if (force)
|
||||||
|
result = true;
|
||||||
|
else if (is_envvar_true(envvar)) {
|
||||||
|
#if defined(__clang__) && defined(__FAST_MATH__) && defined(__INTEL_LLVM_COMPILER)
|
||||||
|
// warning: comparison with NaN always evaluates to false in fast floating point modes
|
||||||
|
fprintf(stderr, "upx: WARNING: ignoring %s: __FAST_MATH__\n", envvar);
|
||||||
|
#elif defined(__clang__) && (__clang_major__ < 9) && defined(__SANITIZE_UNDEFINED_BEHAVIOR__)
|
||||||
|
// UBSAN problem with clang < 9
|
||||||
|
// @COMPILER_BUG @CLANG_BUG @UBSAN_BUG
|
||||||
|
fprintf(stderr, "upx: WARNING: ignoring %s: UBSAN\n", envvar);
|
||||||
|
#elif defined(__clang__) && (__clang_major__ < 8)
|
||||||
|
// NOTE: cannot reliably detect __SANITIZE_UNDEFINED_BEHAVIOR__ on older clang versions
|
||||||
|
// @COMPILER_BUG @CLANG_BUG @UBSAN_BUG
|
||||||
|
fprintf(stderr, "upx: WARNING: ignoring %s: clang %d\n", envvar, __clang_major__);
|
||||||
|
#else
|
||||||
|
result = true;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
template <class Int, class Float>
|
template <class Int, class Float>
|
||||||
struct TestFloat {
|
struct TestFloat {
|
||||||
static constexpr Int X = 1000000;
|
static constexpr Int X = 1000000;
|
||||||
@@ -385,18 +415,10 @@ struct TestFloat {
|
|||||||
assert_noexcept(sub_div(3 * X, X, Float(X)) == Float(2));
|
assert_noexcept(sub_div(3 * X, X, Float(X)) == Float(2));
|
||||||
assert_noexcept(sub_div_x(3 * X, X) == Float(2));
|
assert_noexcept(sub_div_x(3 * X, X) == Float(2));
|
||||||
// extra debugging; floating point edge cases cause portability problems in practice
|
// extra debugging; floating point edge cases cause portability problems in practice
|
||||||
if (is_envvar_true("UPX_DEBUG_TEST_FLOAT_DIVISION_BY_ZERO")) {
|
if (shall_test_float_division_by_zero()) {
|
||||||
#if defined(__clang__) && defined(__FAST_MATH__) && defined(__INTEL_LLVM_COMPILER)
|
|
||||||
// warning: comparison with NaN always evaluates to false in fast floating point modes
|
|
||||||
fprintf(stderr, "upx: WARNING: ignoring UPX_DEBUG_TEST_FLOAT_DIVISION_BY_ZERO\n");
|
|
||||||
#elif defined(__clang__) && (__clang_major__ < 9) && defined(__SANITIZE_UNDEFINED_BEHAVIOR__)
|
|
||||||
// @COMPILER_BUG @CLANG_BUG
|
|
||||||
fprintf(stderr, "upx: WARNING: ignoring UPX_DEBUG_TEST_FLOAT_DIVISION_BY_ZERO\n");
|
|
||||||
#else
|
|
||||||
assert_noexcept(std::isnan(div(0, Float(0))));
|
assert_noexcept(std::isnan(div(0, Float(0))));
|
||||||
assert_noexcept(std::isinf(div(1, Float(0))));
|
assert_noexcept(std::isinf(div(1, Float(0))));
|
||||||
assert_noexcept(std::isinf(div(Int(-1), Float(0))));
|
assert_noexcept(std::isinf(div(Int(-1), Float(0))));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
// Automatic conversion to underlying pointer; do NOT enable this config as this
|
// Automatic conversion to underlying pointer; do NOT enable this config as this
|
||||||
// defeats the main purpose of a checked pointer => use raw_bytes() as needed;
|
// defeats the main purpose of a checked pointer => use raw_bytes() as needed;
|
||||||
// and see xspan_fwd.h how to make this more convenient.
|
// and see "xspan_fwd.h" how to make this more convenient.
|
||||||
#ifndef XSPAN_CONFIG_ENABLE_IMPLICIT_CONVERSION
|
#ifndef XSPAN_CONFIG_ENABLE_IMPLICIT_CONVERSION
|
||||||
#define XSPAN_CONFIG_ENABLE_IMPLICIT_CONVERSION 0
|
#define XSPAN_CONFIG_ENABLE_IMPLICIT_CONVERSION 0
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user