CI updates
This commit is contained in:
@@ -110,6 +110,8 @@ jobs:
|
|||||||
with: { submodules: true }
|
with: { submodules: true }
|
||||||
- name: Check out test suite
|
- name: Check out test suite
|
||||||
run: git clone --depth=1 https://github.com/upx/upx-testsuite ../deps/upx-testsuite
|
run: git clone --depth=1 https://github.com/upx/upx-testsuite ../deps/upx-testsuite
|
||||||
|
- run: set -x; clang --version; clang++ --version
|
||||||
|
- run: set -x; gcc --version; g++ --version
|
||||||
- run: clang -E -x c -dM /dev/null # list predefined macros for C
|
- run: clang -E -x c -dM /dev/null # list predefined macros for C
|
||||||
- run: clang++ -E -x c++ -dM /dev/null # list predefined macros for C++
|
- run: clang++ -E -x c++ -dM /dev/null # list predefined macros for C++
|
||||||
- run: gcc -E -x c -dM /dev/null # list predefined macros for C
|
- run: gcc -E -x c -dM /dev/null # list predefined macros for C
|
||||||
@@ -235,8 +237,11 @@ jobs:
|
|||||||
- name: Check out test suite
|
- name: Check out test suite
|
||||||
if: ${{ matrix.testsuite }}
|
if: ${{ matrix.testsuite }}
|
||||||
run: git clone --depth=1 https://github.com/upx/upx-testsuite ../deps/upx-testsuite
|
run: git clone --depth=1 https://github.com/upx/upx-testsuite ../deps/upx-testsuite
|
||||||
|
- run: set -x; clang --version; clang++ --version
|
||||||
- run: clang -E -x c -dM /dev/null # list predefined macros for C
|
- run: clang -E -x c -dM /dev/null # list predefined macros for C
|
||||||
- run: clang++ -E -x c++ -dM /dev/null # list predefined macros for C++
|
- run: clang++ -E -x c++ -dM /dev/null # list predefined macros for C++
|
||||||
|
- run: set -x; ${{ matrix.gcc }} --version; ${{ matrix.gxx }} --version
|
||||||
|
if: ${{ matrix.gcc }}
|
||||||
- run: ${{ matrix.gcc }} -E -x c -dM /dev/null # list predefined macros for C
|
- run: ${{ matrix.gcc }} -E -x c -dM /dev/null # list predefined macros for C
|
||||||
if: ${{ matrix.gcc }}
|
if: ${{ matrix.gcc }}
|
||||||
- run: ${{ matrix.gxx }} -E -x c++ -dM /dev/null # list predefined macros for C++
|
- run: ${{ matrix.gxx }} -E -x c++ -dM /dev/null # list predefined macros for C++
|
||||||
@@ -546,6 +551,7 @@ jobs:
|
|||||||
if test "X$ZIG_PIC" = "X-fPIE"; then true;
|
if test "X$ZIG_PIC" = "X-fPIE"; then true;
|
||||||
echo "ZIG_FLAGS=$ZIG_FLAGS --start-no-unused-arguments -pie --end-no-unused-arguments" >> $GITHUB_ENV
|
echo "ZIG_FLAGS=$ZIG_FLAGS --start-no-unused-arguments -pie --end-no-unused-arguments" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
|
- run: set -x; zig version; zig-cc --version; zig-cxx --version
|
||||||
- run: zig-cc -E -x c -dM /dev/null # list predefined macros for C
|
- run: zig-cc -E -x c -dM /dev/null # list predefined macros for C
|
||||||
- run: zig-cxx -E -x c++ -dM /dev/null # list predefined macros for C++
|
- run: zig-cxx -E -x c++ -dM /dev/null # list predefined macros for C++
|
||||||
- name: ${{ format('Build Release with zig-cc -target {0} {1}', env.ZIG_TARGET, env.ZIG_PIC) }}
|
- name: ${{ format('Build Release with zig-cc -target {0} {1}', env.ZIG_TARGET, env.ZIG_PIC) }}
|
||||||
|
|||||||
@@ -491,7 +491,7 @@ struct CheckSignedness {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class A, class B>
|
template <class A, class B>
|
||||||
struct TestNoAliasingStruct {
|
struct TestNoAliasingStruct { // check working -fno-strict-aliasing
|
||||||
static noinline bool test(A *a, B *b) noexcept {
|
static noinline bool test(A *a, B *b) noexcept {
|
||||||
*a = 0;
|
*a = 0;
|
||||||
*b = 0;
|
*b = 0;
|
||||||
@@ -504,10 +504,10 @@ static forceinline bool testNoAliasing(A *a, B *b) noexcept {
|
|||||||
return TestNoAliasingStruct<A, B>::test(a, b);
|
return TestNoAliasingStruct<A, B>::test(a, b);
|
||||||
}
|
}
|
||||||
template <class T>
|
template <class T>
|
||||||
struct TestIntegerWrap {
|
struct TestIntegerWrap { // check working -fno-strict-overflow
|
||||||
static inline bool inc_gt(const T x) noexcept { return x + 1 > x; }
|
static inline bool inc_gt(const T x) noexcept { return x + 1 > x; }
|
||||||
static inline bool dec_lt(const T x) noexcept { return x - 1 < x; }
|
static inline bool dec_lt(const T x) noexcept { return x - 1 < x; }
|
||||||
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(T(0) - x) == x; }
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -618,6 +618,16 @@ void show_sysinfo(const char *options_var) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// misc compilation options
|
// misc compilation options
|
||||||
|
#if defined(__PIC__)
|
||||||
|
cf_print("__PIC__", "%lld", __PIC__ + 0, 3);
|
||||||
|
#elif defined(__pic__)
|
||||||
|
cf_print("__pic__", "%lld", __pic__ + 0, 3);
|
||||||
|
#endif
|
||||||
|
#if defined(__PIE__)
|
||||||
|
cf_print("__PIE__", "%lld", __PIE__ + 0, 3);
|
||||||
|
#elif defined(__pie__)
|
||||||
|
cf_print("__pie__", "%lld", __pie__ + 0, 3);
|
||||||
|
#endif
|
||||||
#if defined(UPX_CONFIG_DISABLE_WSTRICT)
|
#if defined(UPX_CONFIG_DISABLE_WSTRICT)
|
||||||
cf_print("UPX_CONFIG_DISABLE_WSTRICT", "%lld", UPX_CONFIG_DISABLE_WSTRICT + 0, 3);
|
cf_print("UPX_CONFIG_DISABLE_WSTRICT", "%lld", UPX_CONFIG_DISABLE_WSTRICT + 0, 3);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "system_defs.h"
|
#include "system_defs.h"
|
||||||
|
#include "system_features.h"
|
||||||
|
|
||||||
#if !(__cplusplus + 0 >= 201703L)
|
#if !(__cplusplus + 0 >= 201703L)
|
||||||
#error "FATAL ERROR: C++17 is required"
|
#error "FATAL ERROR: C++17 is required"
|
||||||
@@ -40,7 +41,7 @@
|
|||||||
#error "missing __CYGWIN__"
|
#error "missing __CYGWIN__"
|
||||||
#endif
|
#endif
|
||||||
#if defined(__clang__) || defined(__GNUC__)
|
#if defined(__clang__) || defined(__GNUC__)
|
||||||
// these are pre-defined since gcc-4.6 (2011) and clang-3.2 (2012)
|
// byte order - these are pre-defined since gcc-4.6 (2011) and clang-3.2 (2012)
|
||||||
#if !defined(__ORDER_BIG_ENDIAN__) || (__ORDER_BIG_ENDIAN__ + 0 == 0)
|
#if !defined(__ORDER_BIG_ENDIAN__) || (__ORDER_BIG_ENDIAN__ + 0 == 0)
|
||||||
#error "missing __ORDER_BIG_ENDIAN__"
|
#error "missing __ORDER_BIG_ENDIAN__"
|
||||||
#endif
|
#endif
|
||||||
@@ -60,6 +61,25 @@
|
|||||||
#error "unexpected __BYTE_ORDER__"
|
#error "unexpected __BYTE_ORDER__"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
// pic and pie
|
||||||
|
#if defined(__PIC__) && defined(__pic__)
|
||||||
|
static_assert((__PIC__) == (__pic__));
|
||||||
|
#endif
|
||||||
|
#if defined(__PIC__)
|
||||||
|
static_assert(__PIC__ == 1 || __PIC__ == 2);
|
||||||
|
#endif
|
||||||
|
#if defined(__pic__)
|
||||||
|
static_assert(__pic__ == 1 || __pic__ == 2);
|
||||||
|
#endif
|
||||||
|
#if defined(__PIE__) && defined(__pie__)
|
||||||
|
static_assert((__PIE__) == (__pie__));
|
||||||
|
#endif
|
||||||
|
#if defined(__PIE__)
|
||||||
|
static_assert(__PIE__ == 1 || __PIE__ == 2);
|
||||||
|
#endif
|
||||||
|
#if defined(__pie__)
|
||||||
|
static_assert(__pie__ == 1 || __pie__ == 2);
|
||||||
|
#endif
|
||||||
|
|
||||||
// sanity checks
|
// sanity checks
|
||||||
#if defined(_ILP32) || defined(__ILP32) || defined(__ILP32__)
|
#if defined(_ILP32) || defined(__ILP32) || defined(__ILP32__)
|
||||||
|
|||||||
Reference in New Issue
Block a user