CI updates
This commit is contained in:
parent
d6a29e582f
commit
ada9081ea2
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@ -207,10 +207,11 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
# NOTE: Xcode updates regularly tend to break Homebrew clang/gcc; often some ld64 issue; use "xcode_version" as needed; or try "-Wl,-ld_classic"
|
||||||
# NOTE: macos does not have "env -C"; only with brew coreutils
|
# NOTE: macos does not have "env -C"; only with brew coreutils
|
||||||
# NOTE: macos-11 does not have "readlink -f"; only on macos >= 12 or with brew coreutils
|
# NOTE: macos-11 does not have "readlink -f"; only on macos >= 12 or with brew coreutils
|
||||||
# { os: macos-11, gcc: gcc-10, gxx: g++-10, testsuite: true } # macos-11 is EOL; scheduled for removal from GitHub actions
|
# { os: macos-11, gcc: gcc-10, gxx: g++-10, testsuite: true } # macos-11 is EOL; scheduled for removal from GitHub actions
|
||||||
- { os: macos-12, gcc: gcc-11, gxx: g++-11, testsuite: true }
|
- { os: macos-12, gcc: gcc-12, gxx: g++-12, testsuite: true }
|
||||||
- { os: macos-13, testsuite: true } # use default Xcode-15; NOTE: gcc-12 on macos-13 does not work with Xcode-15
|
- { os: macos-13, testsuite: true } # use default Xcode-15; NOTE: gcc-12 on macos-13 does not work with Xcode-15
|
||||||
- { os: macos-13, gcc: gcc-12, gxx: g++-12, testsuite: true, xcode_version: 14.3.1 }
|
- { os: macos-13, gcc: gcc-12, gxx: g++-12, testsuite: true, xcode_version: 14.3.1 }
|
||||||
# { os: macos-14, gcc: gcc-13, gxx: g++-13, testsuite: true } # gcc-13: INTERNAL ERROR in ld64
|
# { os: macos-14, gcc: gcc-13, gxx: g++-13, testsuite: true } # gcc-13: INTERNAL ERROR in ld64
|
||||||
|
|||||||
@ -136,6 +136,10 @@ upx_set_default_build_type(Release) # default is CMAKE_BUILD_TYPE=Release
|
|||||||
project(upx VERSION "${UPX_VERSION_STRING}" LANGUAGES C CXX)
|
project(upx VERSION "${UPX_VERSION_STRING}" LANGUAGES C CXX)
|
||||||
upx_apply_build_type()
|
upx_apply_build_type()
|
||||||
|
|
||||||
|
if(DEFINED UPX_CONFIG_CMAKE_EXECUTABLE_SUFFIX)
|
||||||
|
set(CMAKE_EXECUTABLE_SUFFIX "${UPX_CONFIG_CMAKE_EXECUTABLE_SUFFIX}")
|
||||||
|
endif()
|
||||||
|
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
# common compilation flags
|
# common compilation flags
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
|
|||||||
@ -365,15 +365,14 @@ endfunction()
|
|||||||
|
|
||||||
# sanitize a target; note that this may require special run-time support libs from your toolchain
|
# sanitize a target; note that this may require special run-time support libs from your toolchain
|
||||||
function(upx_sanitize_target) # ARGV
|
function(upx_sanitize_target) # ARGV
|
||||||
# default sanitizer for Debug builds
|
if(NOT DEFINED UPX_CONFIG_SANITIZE_FLAGS_DEBUG)
|
||||||
if(NOT DEFINED upx_sanitize_flags_debug)
|
# default sanitizer for Debug builds
|
||||||
set(upx_sanitize_flags_debug -fsanitize=undefined -fsanitize-undefined-trap-on-error -fstack-protector-all)
|
set(UPX_CONFIG_SANITIZE_FLAGS_DEBUG -fsanitize=undefined -fsanitize-undefined-trap-on-error -fstack-protector-all)
|
||||||
endif()
|
endif()
|
||||||
# default sanitizer for Release builds
|
if(NOT DEFINED UPX_CONFIG_SANITIZE_FLAGS_RELEASE)
|
||||||
if(NOT DEFINED upx_sanitize_flags_release)
|
# default sanitizer for Release builds
|
||||||
set(upx_sanitize_flags_release -fstack-protector)
|
set(UPX_CONFIG_SANITIZE_FLAGS_RELEASE -fstack-protector)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
foreach(t ${ARGV})
|
foreach(t ${ARGV})
|
||||||
if(UPX_CONFIG_DISABLE_SANITIZE)
|
if(UPX_CONFIG_DISABLE_SANITIZE)
|
||||||
# no-op
|
# no-op
|
||||||
@ -391,10 +390,10 @@ function(upx_sanitize_target) # ARGV
|
|||||||
# unsupported compiler; unreliable/broken sanitize implementation before gcc-8 (May 2018)
|
# unsupported compiler; unreliable/broken sanitize implementation before gcc-8 (May 2018)
|
||||||
message(WARNING "WARNING: ignoring SANITIZE for target '${t}'")
|
message(WARNING "WARNING: ignoring SANITIZE for target '${t}'")
|
||||||
else()
|
else()
|
||||||
target_compile_options(${t} PRIVATE $<$<CONFIG:Debug>:${upx_sanitize_flags_debug}>)
|
target_compile_options(${t} PRIVATE $<$<CONFIG:Debug>:${UPX_CONFIG_SANITIZE_FLAGS_DEBUG}>)
|
||||||
target_compile_options(${t} PRIVATE $<$<CONFIG:MinSizeRel>:${upx_sanitize_flags_release}>)
|
target_compile_options(${t} PRIVATE $<$<CONFIG:MinSizeRel>:${UPX_CONFIG_SANITIZE_FLAGS_RELEASE}>)
|
||||||
target_compile_options(${t} PRIVATE $<$<CONFIG:Release>:${upx_sanitize_flags_release}>)
|
target_compile_options(${t} PRIVATE $<$<CONFIG:Release>:${UPX_CONFIG_SANITIZE_FLAGS_RELEASE}>)
|
||||||
target_compile_options(${t} PRIVATE $<$<CONFIG:RelWithDebInfo>:${upx_sanitize_flags_release}>)
|
target_compile_options(${t} PRIVATE $<$<CONFIG:RelWithDebInfo>:${UPX_CONFIG_SANITIZE_FLAGS_RELEASE}>)
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|||||||
@ -31,13 +31,15 @@ function(upx_print_info) # ARGV
|
|||||||
upx_print_var(CMAKE_SIZEOF_VOID_P)
|
upx_print_var(CMAKE_SIZEOF_VOID_P)
|
||||||
|
|
||||||
# binutils
|
# binutils
|
||||||
upx_print_var(CMAKE_EXECUTABLE_FORMAT CMAKE_AR CMAKE_RANLIB)
|
upx_print_var(CMAKE_EXECUTABLE_FORMAT CMAKE_EXECUTABLE_SUFFIX UPX_CONFIG_CMAKE_EXECUTABLE_SUFFIX)
|
||||||
|
upx_print_var(CMAKE_AR CMAKE_RANLIB)
|
||||||
|
|
||||||
# compilers
|
# compilers
|
||||||
foreach(lang IN ITEMS ASM C CXX)
|
foreach(lang IN ITEMS ASM C CXX)
|
||||||
upx_print_var(CMAKE_${lang}_COMPILER_LAUNCHER)
|
upx_print_var(CMAKE_${lang}_COMPILER_LAUNCHER)
|
||||||
upx_print_var(CMAKE_${lang}_COMPILER)
|
upx_print_var(CMAKE_${lang}_COMPILER)
|
||||||
upx_print_var(CMAKE_${lang}_COMPILER_ID)
|
upx_print_var(CMAKE_${lang}_COMPILER_ID)
|
||||||
|
upx_print_var(CMAKE_${lang}_SIMULATE_ID)
|
||||||
upx_print_var(CMAKE_${lang}_COMPILER_VERSION)
|
upx_print_var(CMAKE_${lang}_COMPILER_VERSION)
|
||||||
upx_print_var(CMAKE_${lang}_COMPILER_FRONTEND_VARIANT )
|
upx_print_var(CMAKE_${lang}_COMPILER_FRONTEND_VARIANT )
|
||||||
upx_print_var(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID)
|
upx_print_var(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID)
|
||||||
@ -50,6 +52,7 @@ function(upx_print_info) # ARGV
|
|||||||
upx_print_var(CMAKE_BUILD_WITH_INSTALL_RPATH)
|
upx_print_var(CMAKE_BUILD_WITH_INSTALL_RPATH)
|
||||||
upx_print_var(CMAKE_INTERPROCEDURAL_OPTIMIZATION CMAKE_POSITION_INDEPENDENT_CODE)
|
upx_print_var(CMAKE_INTERPROCEDURAL_OPTIMIZATION CMAKE_POSITION_INDEPENDENT_CODE)
|
||||||
upx_print_var(PROPERTY_TARGET_SUPPORTS_SHARED_LIBS)
|
upx_print_var(PROPERTY_TARGET_SUPPORTS_SHARED_LIBS)
|
||||||
|
upx_print_var(UPX_CONFIG_SANITIZE_FLAGS_DEBUG UPX_CONFIG_SANITIZE_FLAGS_RELEASE)
|
||||||
|
|
||||||
# shortcuts
|
# shortcuts
|
||||||
upx_print_var(APPLE CLANG CYGWIN GNU_FRONTEND GNUC MINGW MSVC MSVC_FRONTEND MSVC_IDE MSVC_TOOLSET_VERSION MSVC_VERSION MSYS UNIX WIN32 WIN64)
|
upx_print_var(APPLE CLANG CYGWIN GNU_FRONTEND GNUC MINGW MSVC MSVC_FRONTEND MSVC_IDE MSVC_TOOLSET_VERSION MSVC_VERSION MSYS UNIX WIN32 WIN64)
|
||||||
|
|||||||
@ -20,7 +20,7 @@ override ne = $(if $(subst x$1,,x$2)$(subst x$2,,x$1),1,)
|
|||||||
override tolower = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$1))))))))))))))))))))))))))
|
override tolower = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$1))))))))))))))))))))))))))
|
||||||
override toupper = $(subst a,A,$(subst b,B,$(subst c,C,$(subst d,D,$(subst e,E,$(subst f,F,$(subst g,G,$(subst h,H,$(subst i,I,$(subst j,J,$(subst k,K,$(subst l,L,$(subst m,M,$(subst n,N,$(subst o,O,$(subst p,P,$(subst q,Q,$(subst r,R,$(subst s,S,$(subst t,T,$(subst u,U,$(subst v,V,$(subst w,W,$(subst x,X,$(subst y,Y,$(subst z,Z,$1))))))))))))))))))))))))))
|
override toupper = $(subst a,A,$(subst b,B,$(subst c,C,$(subst d,D,$(subst e,E,$(subst f,F,$(subst g,G,$(subst h,H,$(subst i,I,$(subst j,J,$(subst k,K,$(subst l,L,$(subst m,M,$(subst n,N,$(subst o,O,$(subst p,P,$(subst q,Q,$(subst r,R,$(subst s,S,$(subst t,T,$(subst u,U,$(subst v,V,$(subst w,W,$(subst x,X,$(subst y,Y,$(subst z,Z,$1))))))))))))))))))))))))))
|
||||||
|
|
||||||
# canonicalize case of CMAKE_BUILD_TYPE to "Debug" and "Release"
|
# canonicalize the case of CMAKE_BUILD_TYPE to "Debug" and "Release"
|
||||||
override cm_build_type = $(if $(call eq,$1,),$(error EMPTY-build-type),$(if $(call eq,$(call tolower,$1),debug),Debug,$(if $(call eq,$(call tolower,$1),release),Release,$(if $(call eq,$(call tolower,$1),none),None,$1))))
|
override cm_build_type = $(if $(call eq,$1,),$(error EMPTY-build-type),$(if $(call eq,$(call tolower,$1),debug),Debug,$(if $(call eq,$(call tolower,$1),release),Release,$(if $(call eq,$(call tolower,$1),none),None,$1))))
|
||||||
|
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
|
|||||||
@ -231,7 +231,7 @@ forceinline constexpr upx_uint64_t bswap64(upx_uint64_t v) noexcept { return std
|
|||||||
|
|
||||||
#elif (ACC_CC_MSC)
|
#elif (ACC_CC_MSC)
|
||||||
|
|
||||||
ACC_COMPILE_TIME_ASSERT_HEADER(sizeof(long) == 4)
|
static_assert(sizeof(long) == 4);
|
||||||
|
|
||||||
// _byteswap_XXX is unfortunately *not* constexpr with current MSVC
|
// _byteswap_XXX is unfortunately *not* constexpr with current MSVC
|
||||||
forceinline bele_constexpr unsigned bswap16(unsigned v) noexcept {
|
forceinline bele_constexpr unsigned bswap16(unsigned v) noexcept {
|
||||||
|
|||||||
@ -210,6 +210,8 @@ typedef __PTRADDR_TYPE__ expected_ptraddr_t;
|
|||||||
static_assert(std::is_integral<B>::value, ""); \
|
static_assert(std::is_integral<B>::value, ""); \
|
||||||
static_assert(std::is_signed<A>::value == std::is_signed<B>::value, ""); \
|
static_assert(std::is_signed<A>::value == std::is_signed<B>::value, ""); \
|
||||||
static_assert(std::is_unsigned<A>::value == std::is_unsigned<B>::value, ""); \
|
static_assert(std::is_unsigned<A>::value == std::is_unsigned<B>::value, ""); \
|
||||||
|
static_assert(std::is_signed<A>::value == !std::is_unsigned<A>::value, ""); \
|
||||||
|
static_assert(std::is_signed<B>::value == !std::is_unsigned<B>::value, ""); \
|
||||||
static_assert(sizeof(A) == sizeof(B), ""); \
|
static_assert(sizeof(A) == sizeof(B), ""); \
|
||||||
static_assert(alignof(A) == alignof(B), "")
|
static_assert(alignof(A) == alignof(B), "")
|
||||||
|
|
||||||
@ -226,6 +228,10 @@ ASSERT_SAME_TYPE(uintptr_t, std::uintptr_t);
|
|||||||
// true types
|
// true types
|
||||||
ASSERT_SAME_TYPE(ptrdiff_t, true_ptrdiff_t);
|
ASSERT_SAME_TYPE(ptrdiff_t, true_ptrdiff_t);
|
||||||
ASSERT_SAME_TYPE(size_t, true_size_t);
|
ASSERT_SAME_TYPE(size_t, true_size_t);
|
||||||
|
#if __cplusplus >= 201103L
|
||||||
|
typedef decltype(nullptr) true_nullptr_t;
|
||||||
|
static_assert(std::is_same<std::nullptr_t, true_nullptr_t>::value, "");
|
||||||
|
#endif
|
||||||
|
|
||||||
// expected types
|
// expected types
|
||||||
#if defined(__PTRDIFF_TYPE__)
|
#if defined(__PTRDIFF_TYPE__)
|
||||||
@ -880,6 +886,18 @@ void upx_compiler_sanity_check(void) noexcept {
|
|||||||
static_assert(sizeof(upx_off_t) >= 8);
|
static_assert(sizeof(upx_off_t) >= 8);
|
||||||
static_assert(sizeof(upx_off_t) >= sizeof(long long));
|
static_assert(sizeof(upx_off_t) >= sizeof(long long));
|
||||||
|
|
||||||
|
// __int64
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
{
|
||||||
|
ASSERT_SAME_TYPE(long long, __int64);
|
||||||
|
ASSERT_SAME_TYPE(unsigned long long, unsigned __int64);
|
||||||
|
typedef __int64 my_int64;
|
||||||
|
typedef unsigned __int64 my_uint64;
|
||||||
|
ASSERT_SAME_TYPE(long long, my_int64);
|
||||||
|
ASSERT_SAME_TYPE(unsigned long long, my_uint64);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static_assert(sizeof(BE16) == 2);
|
static_assert(sizeof(BE16) == 2);
|
||||||
static_assert(sizeof(BE32) == 4);
|
static_assert(sizeof(BE32) == 4);
|
||||||
static_assert(sizeof(BE64) == 8);
|
static_assert(sizeof(BE64) == 8);
|
||||||
|
|||||||
@ -126,8 +126,8 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
// unpacker tests - these may throw exceptions
|
// unpacker tests - these may throw exceptions
|
||||||
virtual bool testUnpackVersion(int version) const;
|
virtual bool testUnpackVersion(int version) const may_throw;
|
||||||
virtual bool testUnpackFormat(int format) const;
|
virtual bool testUnpackFormat(int format) const may_throw;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// implementation
|
// implementation
|
||||||
|
|||||||
@ -773,8 +773,12 @@ inline void owner_free(OwningPointer(T)(&object)) noexcept {
|
|||||||
#if defined(__clang__) || __GNUC__ != 7
|
#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;
|
||||||
|
template <class T>
|
||||||
|
inline void owner_free(T (&array)[]) noexcept DELETED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
template <class T, std::size_t N>
|
template <class T, std::size_t N>
|
||||||
inline void owner_delete(T (&array)[N]) noexcept DELETED_FUNCTION;
|
inline void owner_delete(T (&array)[N]) noexcept DELETED_FUNCTION;
|
||||||
|
template <class T, std::size_t N>
|
||||||
|
inline void owner_free(T (&array)[N]) noexcept DELETED_FUNCTION;
|
||||||
|
|
||||||
} // namespace upx
|
} // namespace upx
|
||||||
|
|||||||
@ -60,7 +60,7 @@
|
|||||||
|
|
||||||
#if defined(__CYGWIN__) && defined(_WIN32)
|
#if defined(__CYGWIN__) && defined(_WIN32)
|
||||||
#error "unexpected _WIN32"
|
#error "unexpected _WIN32"
|
||||||
#undef _WIN32
|
// #undef _WIN32
|
||||||
#endif
|
#endif
|
||||||
#if defined(__CYGWIN__) && defined(_WIN64)
|
#if defined(__CYGWIN__) && defined(_WIN64)
|
||||||
// #error "unexpected _WIN64"
|
// #error "unexpected _WIN64"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user