diff --git a/.appveyor.yml b/.appveyor.yml index 7735f800..1d201971 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -4,7 +4,7 @@ os: Visual Studio 2015 environment: - global: { TRAVIS_OS_NAME: windows, CROSS: "", C: "", B: release, T: "" } + global: { TRAVIS_OS_NAME: windows, CROSS: "", C: "", B: release, T: "", X: "" } matrix: - { C: msvc-10.0-x86, CL_VERSION: 16.00, VS_VERSION: 2010 } ### - { C: msvc-10.0-x64, CL_VERSION: 16.00, VS_VERSION: 2010 } # AppVeyor: x64 compiler is not installed diff --git a/.circle.yml b/.circle.yml index 5c0d0b57..afa3ca20 100644 --- a/.circle.yml +++ b/.circle.yml @@ -13,6 +13,7 @@ machine: C: gcc-4.8-m64 B: release T: + X: checkout: post: diff --git a/.github/travis_build.sh b/.github/travis_build.sh index 9d207fa6..5dc6cce4 100644 --- a/.github/travis_build.sh +++ b/.github/travis_build.sh @@ -34,6 +34,33 @@ fi # linux set -x +# +# rebuild UPX stubs (needs upx-stubtools) +# + +if [[ $BM_X =~ (^|\+)rebuild-stubs($|\+) ]]; then + bin_upx=$(readlink -en -- "$upx_SRCDIR/../deps/bin-upx-20160918") + cd / && cd $upx_SRCDIR || exit 1 + make -C src/stub maintainer-clean + failed=0 + PATH="$bin_upx:$PATH" make -C src/stub all || failed=1 + if [[ $failed != 0 ]]; then + echo "UPX-ERROR: FATAL: rebuild-stubs failed" + exit 1 + fi + if ! git diff --quiet; then + git status || true + git diff || true + echo "UPX-ERROR: FATAL: rebuild-stubs git status mismatch. See log file." + exit 1 + fi + if [[ $BM_X == rebuild-stubs ]]; then + echo "X=rebuild-stubs done. Exiting." + exit 0 + fi + unset bin_upx failed +fi + # # build UCL # diff --git a/.github/travis_init.sh b/.github/travis_init.sh index d5038892..f423c992 100644 --- a/.github/travis_init.sh +++ b/.github/travis_init.sh @@ -5,13 +5,15 @@ #set -x # debug umask 022 +export GIT_PAGER= # rename short variables to more readable Build-Matrix BM_ names # C is COMPILER # B is BUILD_OPTIONS # T is TESTSUITE_OPTIONS -BM_CROSS=$CROSS; BM_C=$C; BM_B=$B; BM_T=$T -unset CROSS C B T +# X is EXTRA_OPTIONS +BM_CROSS=$CROSS; BM_C=$C; BM_B=$B; BM_T=$T; BM_X=$X +unset CROSS C B T X [[ -z $BM_C ]] && BM_C=gcc [[ -z $BM_B ]] && BM_B=release diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3c93e9f4..a3b5ff21 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,6 +10,8 @@ glibc-devel.i686 libasan.i686 libstdc++-devel.i686 libubsan.i686 zlib-devel.i686 before_script: + - export TRAVIS_OS_NAME=linux + - unset CROSS C B T X - uname -a; pwd; id; umask; env - time rpm -qa | LC_ALL=C sort - *fedora_install_compilers @@ -19,7 +21,6 @@ before_script: - cd ../deps && time wget -q -O - https://github.com/upx/upx/releases/download/v3.00/zlib-1.2.8.tar.xz | tar -xJ - cd ../deps && time git clone https://github.com/upx/upx-testsuite - cd $CI_PROJECT_DIR - - export TRAVIS_OS_NAME=linux Fedora23-clang+gcc-m32+m64: image: fedora:23 diff --git a/.travis.yml b/.travis.yml index fde476dc..53a88824 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,7 @@ branches: env: global: - - CROSS= C= B= T= + - CROSS= C= B= T= X= matrix: - TRAVIS_EMPTY_JOB_WORKAROUND=true @@ -31,6 +31,12 @@ matrix: exclude: - env: TRAVIS_EMPTY_JOB_WORKAROUND=true include: + - os: linux + sudo: required + dist: trusty + compiler: gcc + env: X=rebuild-stubs + addons: { apt: { packages: [ "g++-multilib", "lib32z1" ] } } - os: linux compiler: gcc env: C=gcc-4.4-m32 @@ -185,6 +191,7 @@ install: - cd ../deps && travis_retry wget -q -O - https://github.com/upx/upx/releases/download/v3.00/ucl-1.03.tar.xz | tar -xJ - cd ../deps && travis_retry wget -q -O - https://github.com/upx/upx/releases/download/v3.00/zlib-1.2.8.tar.xz | tar -xJ - cd ../deps && travis_retry git clone https://github.com/upx/upx-testsuite + - if [[ $X =~ (^|\+)rebuild-stubs($|\+) ]]; then cd ../deps && travis_retry wget -q -O - https://github.com/upx/upx-stubtools/releases/download/v20160918/bin-upx-20160918.tar.xz | tar -xJ; fi - | cd / if [[ $TRAVIS_OS_NAME == linux ]]; then diff --git a/src/Makefile b/src/Makefile index e1db6ad0..29b92e36 100644 --- a/src/Makefile +++ b/src/Makefile @@ -98,7 +98,7 @@ ifeq ($(BUILD_USE_DEPEND),1) ./.depend: $(sort $(wildcard $(srcdir)/*.cpp $(srcdir)/*.h)) $(MAKEFILE_LIST) @rm -f $@ @echo "Updating $@" - @$(strip $(CXX) $(call ee,CPPFLAGS) -MM) $(filter %.cpp,$^) > $@ + @$(strip $(CXX) $(call ee,CPPFLAGS) $(call ee,CXXFLAGS) -MM) $(filter %.cpp,$^) > $@ else ./.depend: .PHONY: ./.depend @@ -115,7 +115,7 @@ endif .PHONY: check-whitespace mostlyclean clean distclean maintainer-clean: - rm -f *.d *.map *.o *.obj *.res ./.depend upx.exe upx.out upx.ttp upx$(exeext) + rm -f *.d *.ii *.map *.o *.obj *.res ./.depend upx.exe upx.out upx.ttp upx$(exeext) ./.depend compress_lzma$(objext) : INCLUDES += -I$(UPX_LZMADIR) diff --git a/src/stub/scripts/check_whitespace.sh b/src/stub/scripts/check_whitespace.sh index 996116e4..c50fcf91 100755 --- a/src/stub/scripts/check_whitespace.sh +++ b/src/stub/scripts/check_whitespace.sh @@ -30,7 +30,7 @@ LC_ALL=C sort -z | xargs -0r perl -n -e ' if ($ARGV =~ m,(^|/)\.gitmodules$,) { } elsif ($ARGV =~ m,(^|/)(gnu|m)?make(file|vars),i) { } elsif ($ARGV =~ m,/tmp/.*\.(disasm|dump)$,) { } - elsif ($ARGV =~ m,/src/stub/src/arch/.*/lzma.*\.S$,) { } + elsif ($ARGV =~ m,/src/stub/src/arch/.*/lzma\w+\.S$,) { } else { print "ERROR: hard TAB detected $ARGV: $_"; exit(1); } } ' || exit 1 diff --git a/src/stub/scripts/check_whitespace_git.sh b/src/stub/scripts/check_whitespace_git.sh index 69765e50..a25bbd2c 100755 --- a/src/stub/scripts/check_whitespace_git.sh +++ b/src/stub/scripts/check_whitespace_git.sh @@ -27,7 +27,7 @@ git ls-files --full-name -z | perl -0 -n -e ' if ($ARGV =~ m,(^|/)\.gitmodules$,) { } elsif ($ARGV =~ m,(^|/)(gnu|m)?make(file|vars),i) { } elsif ($ARGV =~ m,/tmp/.*\.(disasm|dump)$,) { } - elsif ($ARGV =~ m,/src/stub/src/arch/.*/lzma.*\.S$,) { } + elsif ($ARGV =~ m,/src/stub/src/arch/.*/lzma\w+\.S$,) { } else { print "ERROR: hard TAB detected $ARGV: $_"; exit(1); } } ' || exit 1