From 91aa5b55ab9ced7f521cb4b56d92cdef5ecbffeb Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Mon, 12 Dec 2022 19:25:28 +0100 Subject: [PATCH] all: upgrade to upx-stubtools v20221212 --- .clang-format | 3 +-- .github/travis_build.sh | 2 +- .github/workflows/ci.yml | 9 ++++----- .../10-create-image.sh | 4 ++-- .../20-image-run-shell.sh | 2 +- misc/cross-compile-upx-with-podman/Dockerfile | 6 +++--- .../10-create-image.sh | 2 +- .../20-image-run-shell.sh | 6 +++--- misc/rebuild-stubs-with-podman/Dockerfile | 20 +++++++++---------- misc/scripts/upx-clang-format | 10 +++++----- src/stub/Makefile | 2 +- src/stub/tools/armpe/Makefile | 20 +------------------ 12 files changed, 32 insertions(+), 54 deletions(-) diff --git a/.clang-format b/.clang-format index 18b559ad..dd060d5a 100644 --- a/.clang-format +++ b/.clang-format @@ -1,10 +1,9 @@ # "Gofmt's style is nobody's favourite, but gofmt is everybody's favourite." --Rob Pike # -# for clang-format-10.0.1 from https://github.com/upx/upx-stubtools/releases +# for clang-format-15.0.6 from https://github.com/upx/upx-stubtools/releases --- BasedOnStyle: LLVM AccessModifierOffset: -4 -#AlignConsecutiveAssignments: true AlwaysBreakTemplateDeclarations: true ColumnLimit: 100 IndentWidth: 4 diff --git a/.github/travis_build.sh b/.github/travis_build.sh index a783d061..6f5260dd 100644 --- a/.github/travis_build.sh +++ b/.github/travis_build.sh @@ -45,7 +45,7 @@ if [[ $BM_X =~ (^|\+)rebuild-stubs($|\+) ]]; then elif [[ -f "$HOME/.local/bin/bin-upx/upx-stubtools-check-version" ]]; then bin_upx=$(readlink -en -- "$HOME/.local/bin/bin-upx") else - bin_upx=$(readlink -en -- "$upx_SRCDIR/../deps/bin-upx-20210104") + bin_upx=$(readlink -en -- "$upx_SRCDIR/../deps/bin-upx-20221212") fi cd / && cd "$upx_SRCDIR" || exit 1 extra_subdirs=() diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f1ad46a..9059eaed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,12 +32,11 @@ jobs: ##export DEBIAN_FRONTEND=noninteractive ##sudo apt-get install -y --no-install-recommends python2-minimal # manually install compat libs from Ubuntu 16.04 - wget -q 'http://mirror.enzu.com/ubuntu/pool/main/g/gmp/libgmp10_6.1.0+dfsg-2_amd64.deb' - wget -q 'http://mirror.enzu.com/ubuntu/pool/main/m/mpfr4/libmpfr4_3.1.4-1_amd64.deb' - for f in *.deb; do dpkg -x $f ./packages; done + wget -q 'http://archive.kernel.org/ubuntu-archive/ubuntu/pool/main/m/mpfr4/libmpfr4_3.1.6-1_amd64.deb' + for f in ./*.deb; do dpkg -x $f ./packages; done sudo mv -v -n ./packages/usr/lib/x86_64-linux-gnu/lib* /usr/lib/x86_64-linux-gnu/ sudo ldconfig - wget -q -O - https://github.com/upx/upx-stubtools/releases/download/v20210104/bin-upx-20210104.tar.xz | tar -xJ + wget -q -O - https://github.com/upx/upx-stubtools/releases/download/v20221212/bin-upx-20221212.tar.xz | tar -xJ - name: 'Check out code' uses: actions/checkout@v3 with: { submodules: true } @@ -47,7 +46,7 @@ jobs: - name: 'Check source code formatting' run: | bash ./misc/scripts/check_whitespace_git.sh - env UPX_CLANG_FORMAT="$PWD/../deps/bin-upx-20210104/clang-format-10.0.1" make -C src clang-format + env UPX_CLANG_FORMAT="$PWD/../deps/bin-upx-20221212/clang-format-15.0.6" make -C src clang-format if ! git diff --quiet; then git diff; exit 1; fi job-linux-cmake: diff --git a/misc/cross-compile-upx-with-podman/10-create-image.sh b/misc/cross-compile-upx-with-podman/10-create-image.sh index b12ff991..0e70a203 100755 --- a/misc/cross-compile-upx-with-podman/10-create-image.sh +++ b/misc/cross-compile-upx-with-podman/10-create-image.sh @@ -6,10 +6,10 @@ argv0=$0; argv0abs="$(readlink -fn "$argv0")"; argv0dir="$(dirname "$argv0abs")" # create the image from Dockerfile # using a rootless Podman container -# NOTE: this image is based on rebuild-stubs-with-upx/upx-stubtools-20210104-v10, +# NOTE: this image is based on rebuild-stubs-with-upx/upx-stubtools-20221212-v1, # so you have to create that image first # WARNING: we install many packages, so the resulting image needs A LOT of disk space! -image=upx-cross-compile-20221108-v10 +image=upx-cross-compile-20221212-v1 podman build -t "$image" -f "$argv0dir/Dockerfile" "$argv0dir" diff --git a/misc/cross-compile-upx-with-podman/20-image-run-shell.sh b/misc/cross-compile-upx-with-podman/20-image-run-shell.sh index 3e807210..7c9e7e22 100755 --- a/misc/cross-compile-upx-with-podman/20-image-run-shell.sh +++ b/misc/cross-compile-upx-with-podman/20-image-run-shell.sh @@ -6,7 +6,7 @@ argv0=$0; argv0abs="$(readlink -fn "$argv0")"; argv0dir="$(dirname "$argv0abs")" # run an interactive shell in the image # using a rootless Podman container -image=upx-cross-compile-20221108-v10 +image=upx-cross-compile-20221212-v1 flags=( -ti --read-only --rm ) flags+=( --cap-drop=all ) # drop all capabilities diff --git a/misc/cross-compile-upx-with-podman/Dockerfile b/misc/cross-compile-upx-with-podman/Dockerfile index 7ed818c9..c66d71dd 100644 --- a/misc/cross-compile-upx-with-podman/Dockerfile +++ b/misc/cross-compile-upx-with-podman/Dockerfile @@ -1,8 +1,8 @@ -# NOTE: this image is based on rebuild-stubs-with-upx/upx-stubtools-20210104-v10, +# NOTE: this image is based on rebuild-stubs-with-upx/upx-stubtools-20221212-v1, # so you have to create that image first # WARNING: we install many packages, so the resulting image needs A LOT of disk space! -FROM localhost/upx-stubtools-20210104-v10 -ENV UPX_CONTAINER_IMAGE_NAME=upx-cross-compile-20221108-v10 +FROM localhost/upx-stubtools-20221212-v1 +ENV UPX_CONTAINER_IMAGE_NAME=upx-cross-compile-20221212-v1 ARG DEBIAN_FRONTEND=noninteractive USER root diff --git a/misc/rebuild-stubs-with-podman/10-create-image.sh b/misc/rebuild-stubs-with-podman/10-create-image.sh index 8627c2a3..b25bd932 100755 --- a/misc/rebuild-stubs-with-podman/10-create-image.sh +++ b/misc/rebuild-stubs-with-podman/10-create-image.sh @@ -6,7 +6,7 @@ argv0=$0; argv0abs="$(readlink -fn "$argv0")"; argv0dir="$(dirname "$argv0abs")" # create the image from Dockerfile # using a rootless Podman container -image=upx-stubtools-20210104-v10 +image=upx-stubtools-20221212-v1 podman build -t "$image" -f "$argv0dir/Dockerfile" "$argv0dir" diff --git a/misc/rebuild-stubs-with-podman/20-image-run-shell.sh b/misc/rebuild-stubs-with-podman/20-image-run-shell.sh index 62e74ae9..5c5962f9 100755 --- a/misc/rebuild-stubs-with-podman/20-image-run-shell.sh +++ b/misc/rebuild-stubs-with-podman/20-image-run-shell.sh @@ -6,7 +6,7 @@ argv0=$0; argv0abs="$(readlink -fn "$argv0")"; argv0dir="$(dirname "$argv0abs")" # run an interactive shell in the image # using a rootless Podman container -image=upx-stubtools-20210104-v10 +image=upx-stubtools-20221212-v1 flags=( -ti --read-only --rm ) flags+=( --cap-drop=all ) # drop all capabilities @@ -37,10 +37,10 @@ podman run "${flags[@]}" "$image" bash -l # # make sure that git is clean: # git status . # # remove stub files and make sure that they got deleted: -# make maintainer-clean +# make maintainer-clean extra-clean # git status . # # rebuild -# make all +# make extra-all all # # make sure that the stub files did rebuild correctly: # git status . # git diff . diff --git a/misc/rebuild-stubs-with-podman/Dockerfile b/misc/rebuild-stubs-with-podman/Dockerfile index fbf5db71..398b9bce 100644 --- a/misc/rebuild-stubs-with-podman/Dockerfile +++ b/misc/rebuild-stubs-with-podman/Dockerfile @@ -1,5 +1,5 @@ FROM docker.io/library/ubuntu:22.04 -ENV UPX_CONTAINER_IMAGE_NAME=upx-stubtools-20210104-v10 +ENV UPX_CONTAINER_IMAGE_NAME=upx-stubtools-20221212-v1 ARG DEBIAN_FRONTEND=noninteractive ENV LANG=C.UTF-8 @@ -19,10 +19,8 @@ RUN dpkg --add-architecture i386 \ # manually install compat libs from Ubuntu 16.04; REQUIRED RUN cd /root \ - && aria2c --checksum=sha-256=2605f43f8047fc972855bb909f1dd7af761bbfd35ae559ad689b0d55a4236d69 \ - 'http://mirror.enzu.com/ubuntu/pool/main/g/gmp/libgmp10_6.1.0+dfsg-2_amd64.deb' \ - && aria2c --checksum=sha-256=3973a97387bbe0e8a775995c22861d8478edee2a594e8117970f635de25b2c8a \ - 'http://mirror.enzu.com/ubuntu/pool/main/m/mpfr4/libmpfr4_3.1.4-1_amd64.deb' \ + && aria2c --checksum=sha-256=de22baf3dd851a10e16fbf66a243e70149ca46e06b2939fdc79429196cefc090 \ + 'http://archive.kernel.org/ubuntu-archive/ubuntu/pool/main/m/mpfr4/libmpfr4_3.1.6-1_amd64.deb' \ && mkdir packages \ && for f in ./*.deb; do dpkg -x $f ./packages; done \ && mv -v -n ./packages/usr/lib/x86_64-linux-gnu/lib* /usr/lib/x86_64-linux-gnu/ \ @@ -30,13 +28,13 @@ RUN cd /root \ && ldconfig \ && true -# install upx-stubtools into /usr/local/bin/bin-upx-20210104; REQUIRED +# install upx-stubtools into /usr/local/bin/bin-upx-20221212; REQUIRED RUN cd /root \ - && aria2c --checksum=sha-256=abcd8337cc656fe68d7bbb2ffe0f1e5ddce618688aa0e18c1ebcc40072843884 \ - 'https://github.com/upx/upx-stubtools/releases/download/v20210104/bin-upx-20210104.tar.xz' \ + && aria2c --checksum=sha-256=509e06639118a79d8e79489a400e134c6d3ca36bad2c6ec29648d7c1e5b81afa \ + 'https://github.com/upx/upx-stubtools/releases/download/v20221212/bin-upx-20221212.tar.xz' \ && cd /usr/local/bin \ - && tar -xoaf /root/bin-upx-20210104.tar.xz \ - && rm /root/bin-upx-20210104.tar.xz \ + && tar -xoaf /root/bin-upx-20221212.tar.xz \ + && rm /root/bin-upx-20221212.tar.xz \ && true # install pre-built binary UPX versions into /usr/local/bin; not required but convenient for testing @@ -51,7 +49,7 @@ RUN cd /root \ # create default user upx 2000:2000 RUN useradd upx -U --uid 2000 --shell /bin/bash -m \ && mkdir -p /home/upx/.local/bin /home/upx/src/upx \ - && ln -s /usr/local/bin/bin-upx-20210104 /home/upx/.local/bin/bin-upx \ + && ln -s /usr/local/bin/bin-upx-20221212 /home/upx/.local/bin/bin-upx \ && chown -R upx:upx /home/upx \ && true USER upx diff --git a/misc/scripts/upx-clang-format b/misc/scripts/upx-clang-format index c1b83454..fe34d1c1 100755 --- a/misc/scripts/upx-clang-format +++ b/misc/scripts/upx-clang-format @@ -4,22 +4,22 @@ set -e; set -o pipefail # "Gofmt's style is nobody's favourite, but gofmt is everybody's favourite." --Rob Pike -# NOTE: we are using clang-format-10.0.1 from upx-stubtools +# NOTE: we are using clang-format-15.0.6 from upx-stubtools # see https://github.com/upx/upx-stubtools/releases # NOTE: we use .clang-format config from upx.git/.clang-format if [[ ! -f $UPX_CLANG_FORMAT ]]; then -UPX_CLANG_FORMAT="$HOME/local/bin/bin-upx/clang-format-10.0.1" +UPX_CLANG_FORMAT="$HOME/local/bin/bin-upx/clang-format-15.0.6" fi if [[ ! -f $UPX_CLANG_FORMAT ]]; then -UPX_CLANG_FORMAT="$HOME/.local/bin/bin-upx/clang-format-10.0.1" +UPX_CLANG_FORMAT="$HOME/.local/bin/bin-upx/clang-format-15.0.6" fi if [[ ! -f $UPX_CLANG_FORMAT ]]; then -UPX_CLANG_FORMAT="$HOME/bin/bin-upx/clang-format-10.0.1" +UPX_CLANG_FORMAT="$HOME/bin/bin-upx/clang-format-15.0.6" fi if [[ ! -f $UPX_CLANG_FORMAT ]]; then - echo "ERROR: $0: cannot find clang-format-10.0.1" + echo "ERROR: $0: cannot find clang-format-15.0.6" echo "ERROR: $0: please visit https://github.com/upx/upx-stubtools" exit 1 fi diff --git a/src/stub/Makefile b/src/stub/Makefile index f3229c19..336defca 100644 --- a/src/stub/Makefile +++ b/src/stub/Makefile @@ -160,7 +160,7 @@ endif all.targets ?= .upx-stubtools-stamp tmp/.tmp-stamp .all-stamp all: $$(all.targets) .upx-stubtools-stamp: $(MAKEFILE_LIST) - upx-stubtools-check-version 20210104 + upx-stubtools-check-version 20221212 @echo "timestamp" > $@ .DELETE_ON_ERROR: .upx-stubtools-stamp %/.tmp-stamp: diff --git a/src/stub/tools/armpe/Makefile b/src/stub/tools/armpe/Makefile index 56cbfc33..4fe77673 100644 --- a/src/stub/tools/armpe/Makefile +++ b/src/stub/tools/armpe/Makefile @@ -1,23 +1,6 @@ # Makefile for armpe_tester -MAKEFLAGS += -rR -.SUFFIXES: -.SECONDEXPANSION: -.NOTPARALLEL: -export LC_ALL = C -export SHELL = /bin/sh - -# update $PATH for our special stub build tools -ifneq ($(wildcard $(HOME)/local/bin/bin-upx/upx-stubtools-check-version),) -export PATH := $(HOME)/local/bin/bin-upx:$(PATH) -else ifneq ($(wildcard $(HOME)/.local/bin/bin-upx/upx-stubtools-check-version),) -export PATH := $(HOME)/.local/bin/bin-upx:$(PATH) -else ifneq ($(wildcard $(HOME)/bin/bin-upx/upx-stubtools-check-version),) -export PATH := $(HOME)/bin/bin-upx:$(PATH) -endif - -CFLAGS_W = -Wall -W -Wcast-align -Wcast-qual -Wwrite-strings - +CFLAGS_W = -Wall -Wextra -Wcast-align -Wcast-qual -Wwrite-strings all: armpe_tester.out #all: armpe_tester.exe @@ -33,4 +16,3 @@ mostlyclean clean distclean maintainer-clean: rm -f armpe_tester.exe armpe_tester.out .PHONY: all mostlyclean clean distclean maintainer-clean -