mirror of https://github.com/upx/upx.git
CI updates
This commit is contained in:
parent
5e85c1a11b
commit
fc6e3840b7
|
@ -404,7 +404,7 @@ jobs:
|
|||
needs: [ job-rebuild-and-verify-stubs ]
|
||||
name: ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }}
|
||||
runs-on: ubuntu-latest
|
||||
container: 'alpine:3.18' # older versions such as alpine:3.12 also work; no-container also works
|
||||
container: 'alpine:3.19' # older versions such as alpine:3.12 also work; no-container also works
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
|
|
@ -20,8 +20,10 @@ jobs:
|
|||
- container: 'alpine:3.16'
|
||||
- container: 'alpine:3.17'
|
||||
- container: 'alpine:3.18'
|
||||
- container: 'alpine:3.19'
|
||||
- container: 'alpine:edge'
|
||||
- container: 'i386/alpine:3.18'
|
||||
- container: 'i386/alpine:3.19'
|
||||
- container: 'i386/alpine:edge'
|
||||
name: ${{ format('Analyze clang-analyzer {0}', matrix.container) }}
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
@ -18,8 +18,10 @@ jobs:
|
|||
matrix:
|
||||
include:
|
||||
- container: 'alpine:3.18'
|
||||
- container: 'alpine:3.19'
|
||||
- container: 'alpine:edge'
|
||||
- container: 'i386/alpine:3.18'
|
||||
- container: 'i386/alpine:3.19'
|
||||
- container: 'i386/alpine:edge'
|
||||
name: ${{ format('Analyze clang-tidy {0}', matrix.container) }}
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
@ -18,6 +18,7 @@ jobs:
|
|||
- container: 'alpine:3.16'
|
||||
- container: 'alpine:3.17'
|
||||
- container: 'alpine:3.18'
|
||||
- container: 'alpine:3.19'
|
||||
- container: 'alpine:edge'
|
||||
name: ${{ format('{0}', matrix.container) }}
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
@ -17,7 +17,8 @@ jobs:
|
|||
# ...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
|
||||
if: github.repository_owner == 'upx'
|
||||
strategy: { matrix: { container: ['alpine:3.9','alpine:3.18','alpine:edge','i386/alpine:edge'] } }
|
||||
# Alpine 3.9 + latest Alpine release + edge
|
||||
strategy: { matrix: { container: ['alpine:3.9','alpine:3.19','alpine:edge','i386/alpine:edge'] } }
|
||||
name: ${{ format('by-hand gcc {0}', matrix.container) }}
|
||||
runs-on: ubuntu-latest
|
||||
container: ${{ matrix.container }}
|
||||
|
@ -27,7 +28,7 @@ jobs:
|
|||
# install ccache, g++, git and various POSIX shells
|
||||
shells="bash dash loksh mksh zsh"
|
||||
case ${{ matrix.container }} in
|
||||
*:3.18 | *:edge) shells="$shells oksh yash" ;;
|
||||
*:3.19 | *:edge) shells="$shells oksh yash" ;;
|
||||
esac
|
||||
echo "installing shells: $shells"
|
||||
apk update && apk upgrade && apk add ccache g++ git $shells
|
||||
|
@ -67,16 +68,16 @@ jobs:
|
|||
- name: 'Build by-hand with mksh -o sh'
|
||||
run: 'mksh -o sh "./upx with space/misc/scripts/build_upx_by_hand.sh"'
|
||||
- name: 'Build by-hand with oksh'
|
||||
if: endsWith(matrix.container, ':3.18') || endsWith(matrix.container, ':edge')
|
||||
if: endsWith(matrix.container, ':3.19') || endsWith(matrix.container, ':edge')
|
||||
run: 'oksh "./upx with space/misc/scripts/build_upx_by_hand.sh"'
|
||||
- name: 'Build by-hand with oksh -o posix'
|
||||
if: endsWith(matrix.container, ':3.18') || endsWith(matrix.container, ':edge')
|
||||
if: endsWith(matrix.container, ':3.19') || endsWith(matrix.container, ':edge')
|
||||
run: 'oksh -o posix "./upx with space/misc/scripts/build_upx_by_hand.sh"'
|
||||
- name: 'Build by-hand with oksh -o sh'
|
||||
if: endsWith(matrix.container, ':3.18') || endsWith(matrix.container, ':edge')
|
||||
if: endsWith(matrix.container, ':3.19') || endsWith(matrix.container, ':edge')
|
||||
run: 'oksh -o sh "./upx with space/misc/scripts/build_upx_by_hand.sh"'
|
||||
- name: 'Build by-hand with yash'
|
||||
if: endsWith(matrix.container, ':3.18') || endsWith(matrix.container, ':edge')
|
||||
if: endsWith(matrix.container, ':3.19') || endsWith(matrix.container, ':edge')
|
||||
run: 'yash "./upx with space/misc/scripts/build_upx_by_hand.sh"'
|
||||
- name: 'Build by-hand with zsh'
|
||||
run: 'zsh "./upx with space/misc/scripts/build_upx_by_hand.sh"'
|
||||
|
|
|
@ -38,6 +38,7 @@ jobs:
|
|||
- { container: 'alpine:3.16', use_cxx20: 1, use_cxx2b: 1, use_lto: 1 } # May 2022: C++2b; clang-13 & gcc-11
|
||||
- { container: 'alpine:3.17', use_cxx20: 1, use_cxx2b: 1, use_lto: 1 }
|
||||
- { container: 'alpine:3.18', use_cxx20: 1, use_cxx2b: 1, use_lto: 1 }
|
||||
- { container: 'alpine:3.19', use_cxx20: 1, use_cxx2b: 1, use_lto: 1 }
|
||||
- { container: 'alpine:edge', use_cxx20: 1, use_cxx2b: 1, use_lto: 1 }
|
||||
- { container: 'i386/alpine:edge', use_cxx20: 1, use_cxx2b: 1, use_lto: 1 }
|
||||
# more 32-bit i386 versions, just for testing
|
||||
|
@ -51,6 +52,7 @@ jobs:
|
|||
- { container: 'i386/alpine:3.16' } # clang-13, gcc-11
|
||||
- { container: 'i386/alpine:3.17' } # clang-15, gcc-12
|
||||
- { container: 'i386/alpine:3.18' } # clang-16, gcc-12
|
||||
- { container: 'i386/alpine:3.19' } # clang-17, gcc-13
|
||||
name: ${{ format('container {0}', matrix.container) }}
|
||||
runs-on: ubuntu-latest
|
||||
container: ${{ matrix.container }}
|
||||
|
|
|
@ -28,7 +28,8 @@ jobs:
|
|||
- { container: 'alpine:3.17', wine: true, i686_mingw: false } # wine-7.21
|
||||
# Wine >= 8.0 can run i686 32-bit programs in WOW64 mode on pure 64-bit systems
|
||||
- { container: 'alpine:3.18', wine: true, i686_mingw: true } # wine-8.13
|
||||
- { container: 'alpine:edge', wine: true, i686_mingw: true } # wine-8.19
|
||||
- { container: 'alpine:3.19', wine: true, i686_mingw: true } # wine-8.21
|
||||
- { container: 'alpine:edge', wine: true, i686_mingw: true } # wine-8.21
|
||||
name: ${{ format('container {0}', matrix.container) }}
|
||||
runs-on: ubuntu-latest
|
||||
container: ${{ matrix.container }}
|
||||
|
|
|
@ -49,7 +49,7 @@ jobs:
|
|||
- { zig_target: x86_64-windows-gnu }
|
||||
name: ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }}
|
||||
runs-on: ubuntu-latest
|
||||
container: 'alpine:3.18' # older versions such as alpine:3.12 also work; no-container also works
|
||||
container: 'alpine:3.19' # older versions such as alpine:3.12 also work; no-container also works
|
||||
env:
|
||||
# for zig-cc wrapper scripts (see below):
|
||||
ZIG_CPPFLAGS: -DUPX_DOCTEST_CONFIG_MULTITHREADING
|
||||
|
|
|
@ -20,8 +20,9 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- { container: 'alpine:3.18', release: debug, qemu: 'qemu-x86_64 -cpu Nehalem' }
|
||||
- { container: 'alpine:3.18', release: release, qemu: 'qemu-x86_64 -cpu Nehalem' }
|
||||
# latest Alpine release + edge
|
||||
- { container: 'alpine:3.19', release: debug, qemu: 'qemu-x86_64 -cpu Nehalem' }
|
||||
- { container: 'alpine:3.19', release: release, qemu: 'qemu-x86_64 -cpu Nehalem' }
|
||||
- { container: 'alpine:edge', release: release, qemu: 'qemu-x86_64 -cpu Nehalem' }
|
||||
- { container: 'i386/alpine:edge', release: release, qemu: 'qemu-i386' }
|
||||
name: ${{ format('{0} {1}', matrix.container, matrix.release) }}
|
||||
|
|
|
@ -379,7 +379,7 @@ function(upx_compile_source_debug_with_O2)
|
|||
endforeach()
|
||||
endfunction()
|
||||
|
||||
# sanitize a target
|
||||
# sanitize a target: this needs proper support from your compiler AND toolchain
|
||||
function(upx_sanitize_target)
|
||||
foreach(t ${ARGV})
|
||||
if(UPX_CONFIG_DISABLE_SANITIZE)
|
||||
|
@ -389,6 +389,8 @@ function(upx_sanitize_target)
|
|||
elseif(MINGW OR CYGWIN)
|
||||
# avoid link errors with current MinGW-w64 versions
|
||||
# see https://www.mingw-w64.org/contribute/#sanitizers-asan-tsan-usan
|
||||
elseif(CMAKE_C_COMPILER_ID MATCHES "^GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "8.0")
|
||||
# unsupported compiler; unreliable/broken sanitize implementation
|
||||
else()
|
||||
# default sanitizer for Debug builds
|
||||
target_compile_options(${t} PRIVATE $<$<CONFIG:Debug>:-fsanitize=undefined -fsanitize-undefined-trap-on-error -fstack-protector-all>)
|
||||
|
@ -418,7 +420,7 @@ if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.git")
|
|||
if(WIN32 OR MINGW OR CYGWIN)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "(Clang|GNU)")
|
||||
# runtime library: msvcrt vs ucrt vs cygwin
|
||||
print_have_symbol(__CRTDLL__ __CYGWIN__ __CYGWIN32__ __MINGW32__ __MINGW64_VERSION_MAJOR __MSVCRT__ _UCRT)
|
||||
print_have_symbol(__CRTDLL__ __CYGWIN__ __CYGWIN32__ __CYGWIN64__ __MINGW32__ __MINGW64__ __MINGW64_VERSION_MAJOR __MSVCRT__ _UCRT _WIN32 _WIN64)
|
||||
# exception handing: SJLJ (setjmp/longjmp) vs DWARF vs SEH
|
||||
print_have_symbol(__GCC_HAVE_DWARF2_CFI_ASM __SEH__ __USING_SJLJ_EXCEPTIONS__)
|
||||
# threads: win32 vs posix/pthread/winpthreads vs mcfgthread
|
||||
|
@ -449,7 +451,7 @@ if(Threads_FOUND)
|
|||
"${CMAKE_CURRENT_SOURCE_DIR}/misc/cmake/try_compile/${f}"
|
||||
OUTPUT_VARIABLE output)
|
||||
if(NOT result)
|
||||
# failed; under MinGW be sure the use the posix-threads and NOT the win32-threads version
|
||||
# failed; under MinGW be sure to use the posix-threads and NOT the win32-threads version
|
||||
#message(STATUS "${output}") # debug output from try_compile
|
||||
set(Threads_FOUND OFF)
|
||||
break()
|
||||
|
@ -659,6 +661,7 @@ endif()
|
|||
if(CMAKE_INSTALL_PREFIX)
|
||||
include(GNUInstallDirs)
|
||||
endif()
|
||||
# install files
|
||||
if(CMAKE_INSTALL_PREFIX AND DEFINED CMAKE_INSTALL_FULL_BINDIR)
|
||||
install(TARGETS upx DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}")
|
||||
install(FILES
|
||||
|
|
6
Makefile
6
Makefile
|
@ -24,14 +24,14 @@ endif
|
|||
# default
|
||||
#***********************************************************************
|
||||
|
||||
.DEFAULT_GOAL = build/release
|
||||
|
||||
run_cmake_config = $(CMAKE) -S . -B $1 $(UPX_CMAKE_CONFIG_FLAGS) -DCMAKE_BUILD_TYPE=$2
|
||||
run_cmake_build = $(CMAKE) --build $1 $(UPX_CMAKE_BUILD_FLAGS) --config $2
|
||||
# avoid re-running run_cmake_config if .upx_cmake_config_done.txt already exists
|
||||
run_config = $(if $(wildcard $1/CMakeFiles/.upx_cmake_config_done.txt),,$(call run_cmake_config,$1,$2))
|
||||
run_build = $(call run_cmake_build,$1,$2)
|
||||
|
||||
.DEFAULT_GOAL = build/release
|
||||
|
||||
build/debug: PHONY
|
||||
$(call run_config,$@,Debug)
|
||||
$(call run_build,$@,Debug)
|
||||
|
@ -64,7 +64,7 @@ endif
|
|||
|
||||
# developer convenience
|
||||
CTEST = ctest
|
||||
test: $(.DEFAULT_GOAL)
|
||||
test:: $(.DEFAULT_GOAL) PHONY
|
||||
cd $(.DEFAULT_GOAL) && $(CTEST)
|
||||
ifneq ($(wildcard /usr/bin/env),) # needs bash, perl, xargs, etc.
|
||||
check-whitespace clang-format run-testsuite run-testsuite-debug run-testsuite-release: src/Makefile PHONY
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
|
||||
ifeq ($(UPX_MAKEFILE_EXTRA_MK_INCLUDED),)
|
||||
UPX_MAKEFILE_EXTRA_MK_INCLUDED := 1
|
||||
override UPX_MAKEFILE_EXTRA_MK_INCLUDED := 1
|
||||
|
||||
override check_defined = $(foreach 1,$1,$(if $(filter undefined,$(origin $1)),$(error ERROR: variable '$1' is not defined),))
|
||||
override check_undefined = $(foreach 1,$1,$(if $(filter undefined,$(origin $1)),,$(error ERROR: variable '$1' is already defined)))
|
||||
|
|
|
@ -53,12 +53,22 @@ ACC_COMPILE_TIME_ASSERT_HEADER(usizeof(int) == sizeof(int))
|
|||
ACC_COMPILE_TIME_ASSERT_HEADER(usizeof('a') == sizeof(char))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(usizeof("") == 1)
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(usizeof("a") == 2)
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(usizeof("ab") == 3)
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(usizeof(L'a') == sizeof(wchar_t))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(usizeof(L"") == 1 * sizeof(wchar_t))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(usizeof(L"a") == 2 * sizeof(wchar_t))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(usizeof(L"ab") == 3 * sizeof(wchar_t))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(usizeof(0) == sizeof(int))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(usizeof(0L) == sizeof(long))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(usizeof(0LL) == sizeof(long long))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(usizeof(nullptr) == sizeof(void *))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(usizeof(sizeof(0)) == sizeof(size_t))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(usizeof(usizeof(0)) == sizeof(unsigned))
|
||||
#if 0
|
||||
// works, but may trigger clang/gcc warnings "-Wunused-value"
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(usizeof((1LL, 1)) == sizeof(int))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(usizeof((1, 1LL)) == sizeof(long long))
|
||||
#endif
|
||||
|
||||
namespace compile_time = upx::compile_time;
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(compile_time::string_len("") == 0)
|
||||
|
|
Loading…
Reference in New Issue