CI updates and minor cleanups

This commit is contained in:
Markus F.X.J. Oberhumer 2023-10-30 14:15:35 +01:00
parent 19bf9f59e9
commit f62576a2be
9 changed files with 50 additions and 25 deletions

View File

@ -13,8 +13,8 @@ env:
CTEST_OUTPUT_ON_FAILURE: "ON" CTEST_OUTPUT_ON_FAILURE: "ON"
DEBIAN_FRONTEND: noninteractive DEBIAN_FRONTEND: noninteractive
UPX_CMAKE_BUILD_FLAGS: --verbose UPX_CMAKE_BUILD_FLAGS: --verbose
# 2023-10-29 # 2023-10-30
ZIG_DIST_VERSION: 0.12.0-dev.1327+256ab68a9 ZIG_DIST_VERSION: 0.12.0-dev.1349+fa022d1ec
jobs: jobs:
job-rebuild-and-verify-stubs: job-rebuild-and-verify-stubs:

View File

@ -11,8 +11,8 @@ env:
CMAKE_REQUIRED_QUIET: "OFF" CMAKE_REQUIRED_QUIET: "OFF"
CTEST_OUTPUT_ON_FAILURE: "ON" CTEST_OUTPUT_ON_FAILURE: "ON"
DEBIAN_FRONTEND: noninteractive DEBIAN_FRONTEND: noninteractive
# 2023-10-29 # 2023-10-30
ZIG_DIST_VERSION: 0.12.0-dev.1327+256ab68a9 ZIG_DIST_VERSION: 0.12.0-dev.1349+fa022d1ec
jobs: jobs:
job-linux-zigcc: # uses cmake + make job-linux-zigcc: # uses cmake + make

4
NEWS
View File

@ -3,7 +3,7 @@ User visible changes for UPX
================================================================== ==================================================================
Changes in 4.2.1 (XX XXX XXXX): Changes in 4.2.1 (XX XXX XXXX):
* windows: use SetFileTime to preserve sub-second timestamps * windows: use SetFileTime to preserve sub-second file timestamps
* official Windows builds: revert activeCodePage change introduced in 4.2.0 * official Windows builds: revert activeCodePage change introduced in 4.2.0
* bug fixes - see https://github.com/upx/upx/milestone/14 * bug fixes - see https://github.com/upx/upx/milestone/14
@ -12,8 +12,8 @@ Changes in 4.2.0 (26 Oct 2023):
* unix: use utimensat to preserve sub-second file timestamps * unix: use utimensat to preserve sub-second file timestamps
* new option '--link' to preserve hard-links (Unix only; use with care) * new option '--link' to preserve hard-links (Unix only; use with care)
* add support for NO_COLOR env var; see https://no-color.org/ * add support for NO_COLOR env var; see https://no-color.org/
* official Windows builds: set activeCodePage to UTF-8
* disable macOS support until we fix compatibility with macOS 13+ * disable macOS support until we fix compatibility with macOS 13+
* official Windows builds: set activeCodePage to UTF-8
* bug fixes - see https://github.com/upx/upx/milestone/13 * bug fixes - see https://github.com/upx/upx/milestone/13
Changes in 4.1.0 (08 Aug 2023): Changes in 4.1.0 (08 Aug 2023):

View File

@ -96,7 +96,7 @@ ifeq ($(shell uname),Linux)
CLANG_FORMAT_EXCLUDE_FILES += miniacc.h stub/%.h CLANG_FORMAT_EXCLUDE_FILES += miniacc.h stub/%.h
CLANG_FORMAT_EXCLUDE_FILES += p_elf.h p_elf_enum.h p_lx_% p_mach% p_unix% p_vmlin% CLANG_FORMAT_EXCLUDE_FILES += p_elf.h p_elf_enum.h p_lx_% p_mach% p_unix% p_vmlin%
CLANG_FORMAT_FILES := $(sort $(wildcard *.[ch]* ../maint/src/*.[ch]* */*.[ch]*)) CLANG_FORMAT_FILES := $(sort $(wildcard *.[ch]* ../maint/src/*.[ch]* */*.[ch]*))
CLANG_FORMAT_FILES += stub/tools/armpe/armpe_tester.c CLANG_FORMAT_FILES += $(sort $(wildcard stub/tools/*/*.[ch]*))
CLANG_FORMAT_FILES := $(filter-out $(CLANG_FORMAT_EXCLUDE_FILES),$(CLANG_FORMAT_FILES)) CLANG_FORMAT_FILES := $(filter-out $(CLANG_FORMAT_EXCLUDE_FILES),$(CLANG_FORMAT_FILES))
clang-format: PHONY $(CLANG_FORMAT_FILES) clang-format: PHONY $(CLANG_FORMAT_FILES)
@echo "running upx-clang-format" @echo "running upx-clang-format"

View File

@ -94,21 +94,40 @@ ACC_COMPILE_TIME_ASSERT_HEADER(compile_time::string_le("abc", "abz"))
TEST_CASE("ptr_reinterpret_cast") { TEST_CASE("ptr_reinterpret_cast") {
// check that we don't trigger any -Wcast-align warnings // check that we don't trigger any -Wcast-align warnings
using upx::ptr_reinterpret_cast; using upx::ptr_reinterpret_cast;
byte *an = nullptr; void *vp = nullptr;
int *in = nullptr; byte *bp = nullptr;
CHECK((an == ptr_reinterpret_cast<byte *>(an))); int *ip = nullptr;
CHECK((an == ptr_reinterpret_cast<byte *>(in))); double *dp = nullptr;
CHECK((in == ptr_reinterpret_cast<int *>(an)));
CHECK((in == ptr_reinterpret_cast<int *>(in))); CHECK((vp == ptr_reinterpret_cast<void *>(vp)));
const byte *ac = nullptr; CHECK((vp == ptr_reinterpret_cast<void *>(bp)));
CHECK((vp == ptr_reinterpret_cast<void *>(ip)));
CHECK((vp == ptr_reinterpret_cast<void *>(dp)));
CHECK((bp == ptr_reinterpret_cast<byte *>(vp)));
CHECK((bp == ptr_reinterpret_cast<byte *>(bp)));
CHECK((bp == ptr_reinterpret_cast<byte *>(ip)));
CHECK((bp == ptr_reinterpret_cast<byte *>(dp)));
CHECK((ip == ptr_reinterpret_cast<int *>(vp)));
CHECK((ip == ptr_reinterpret_cast<int *>(bp)));
CHECK((ip == ptr_reinterpret_cast<int *>(ip)));
CHECK((ip == ptr_reinterpret_cast<int *>(dp)));
CHECK((dp == ptr_reinterpret_cast<double *>(vp)));
CHECK((dp == ptr_reinterpret_cast<double *>(bp)));
CHECK((dp == ptr_reinterpret_cast<double *>(ip)));
CHECK((dp == ptr_reinterpret_cast<double *>(dp)));
const byte *bc = nullptr;
const int *ic = nullptr; const int *ic = nullptr;
CHECK((ac == ptr_reinterpret_cast<byte *>(an))); CHECK((bc == ptr_reinterpret_cast<byte *>(bp)));
CHECK((ac == ptr_reinterpret_cast<const byte *>(ac))); CHECK((bc == ptr_reinterpret_cast<const byte *>(bc)));
CHECK((ac == ptr_reinterpret_cast<byte *>(in))); CHECK((bc == ptr_reinterpret_cast<byte *>(ip)));
CHECK((ac == ptr_reinterpret_cast<const byte *>(ic))); CHECK((bc == ptr_reinterpret_cast<const byte *>(ic)));
CHECK((ic == ptr_reinterpret_cast<int *>(an))); CHECK((ic == ptr_reinterpret_cast<int *>(bp)));
CHECK((ic == ptr_reinterpret_cast<const int *>(ac))); CHECK((ic == ptr_reinterpret_cast<const int *>(bc)));
CHECK((ic == ptr_reinterpret_cast<int *>(in))); CHECK((ic == ptr_reinterpret_cast<int *>(ip)));
CHECK((ic == ptr_reinterpret_cast<const int *>(ic))); CHECK((ic == ptr_reinterpret_cast<const int *>(ic)));
} }

View File

@ -25,6 +25,8 @@
http://www.oberhumer.com/ http://www.oberhumer.com/
*/ */
/* clang-format off */
#ifndef __ACC_H_INCLUDED #ifndef __ACC_H_INCLUDED
#define __ACC_H_INCLUDED 1 #define __ACC_H_INCLUDED 1
#define ACC_VERSION 20230625L #define ACC_VERSION 20230625L

View File

@ -356,7 +356,7 @@ protected:
RT_LAST RT_LAST
}; };
class Interval : private noncopyable { class Interval final : private noncopyable {
unsigned capacity = 0; unsigned capacity = 0;
void *base = nullptr; void *base = nullptr;
public: public:
@ -382,7 +382,7 @@ protected:
static int __acc_cdecl_qsort compare(const void *p1, const void *p2); static int __acc_cdecl_qsort compare(const void *p1, const void *p2);
}; };
class Reloc : private noncopyable { class Reloc final : private noncopyable {
// these are set in constructor // these are set in constructor
byte *start = nullptr; byte *start = nullptr;
unsigned start_size_in_bytes = 0; unsigned start_size_in_bytes = 0;
@ -418,7 +418,7 @@ protected:
void finish(byte *(&result_ptr), unsigned &result_size); // => transfer ownership void finish(byte *(&result_ptr), unsigned &result_size); // => transfer ownership
}; };
class Resource : private noncopyable { class Resource final : private noncopyable {
struct res_dir_entry; struct res_dir_entry;
struct res_dir; struct res_dir;
struct res_data; struct res_data;
@ -474,7 +474,7 @@ protected:
*/ */
}; };
class Export : private noncopyable { class Export final : private noncopyable {
struct alignas(1) export_dir_t { struct alignas(1) export_dir_t {
byte _[12]; // flags, timedate, version byte _[12]; // flags, timedate, version
LE32 name; LE32 name;

View File

@ -1,6 +1,8 @@
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
// Copyright 2022 BitWagon Software LLC. All rights reserved. // Copyright 2022 BitWagon Software LLC. All rights reserved.
/* clang-format off */
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -1,5 +1,7 @@
/* http://www.muppetlabs.com/~breadbox/software/elfkickers.html */ /* http://www.muppetlabs.com/~breadbox/software/elfkickers.html */
/* clang-format off */
/* sstrip: Copyright (C) 1999-2001 by Brian Raiter, under the GNU /* sstrip: Copyright (C) 1999-2001 by Brian Raiter, under the GNU
* General Public License. No warranty. See COPYING for details. * General Public License. No warranty. See COPYING for details.
* *