diff options
author | fanquake <fanquake@gmail.com> | 2023-06-29 11:54:31 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-06-29 11:55:40 +0100 |
commit | 3dca683cb738fccd2dcd6f85033d92979a072284 (patch) | |
tree | 37cbaa1da1dcb9a44b603db06dd9488838e602a8 | |
parent | d4018f0b6cbff43a1b8d2d57c5df2286f4d6e9d5 (diff) | |
download | bitcoin-3dca683cb738fccd2dcd6f85033d92979a072284.tar.xz |
build: support -no_fixup_chains in ld64
Patch in suport for using -no_fixup_chains, with ld64. This option just
seems to be missing from our version, as it exists in later releases.
This is needed so we can disable fixup_chains in our security checks.
-rw-r--r-- | depends/packages/native_cctools.mk | 7 | ||||
-rw-r--r-- | depends/patches/native_cctools/no_fixup_chains.patch | 23 |
2 files changed, 28 insertions, 2 deletions
diff --git a/depends/packages/native_cctools.mk b/depends/packages/native_cctools.mk index 03e9002ecd..4860934a8e 100644 --- a/depends/packages/native_cctools.mk +++ b/depends/packages/native_cctools.mk @@ -5,6 +5,7 @@ $(package)_file_name=$($(package)_version).tar.gz $(package)_sha256_hash=6b73269efdf5c58a070e7357b66ee760501388549d6a12b423723f45888b074b $(package)_build_subdir=cctools $(package)_dependencies=native_libtapi +$(package)_patches=no_fixup_chains.patch define $(package)_set_vars $(package)_config_opts=--target=$(host) --enable-lto-support @@ -18,11 +19,13 @@ ifneq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) define $(package)_preprocess_cmds mkdir -p $($(package)_staging_prefix_dir)/lib && \ cp $(llvm_lib_dir)/libLTO.so $($(package)_staging_prefix_dir)/lib/ && \ - cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub cctools + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub cctools && \ + patch -p1 < $($(package)_patch_dir)/no_fixup_chains.patch endef else define $(package)_preprocess_cmds - cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub cctools + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub cctools && \ + patch -p1 < $($(package)_patch_dir)/no_fixup_chains.patch endef endif diff --git a/depends/patches/native_cctools/no_fixup_chains.patch b/depends/patches/native_cctools/no_fixup_chains.patch new file mode 100644 index 0000000000..2516ea8200 --- /dev/null +++ b/depends/patches/native_cctools/no_fixup_chains.patch @@ -0,0 +1,23 @@ +commit 5860b35ff6c7241d1c35a1b3197b45e5c9ff86cf +Author: fanquake <fanquake@gmail.com> +Date: Thu Jun 29 11:52:43 2023 +0100 + + ld64: add support for -no_fixup_chains + + This is added in later versions, and is required if we want to be able + to disable fixup_chains, for use in security tests. + +diff --git a/cctools/ld64/src/ld/Options.cpp b/cctools/ld64/src/ld/Options.cpp +index 15e8e88..b6580af 100644 +--- a/cctools/ld64/src/ld/Options.cpp ++++ b/cctools/ld64/src/ld/Options.cpp +@@ -4128,6 +4128,9 @@ void Options::parse(int argc, const char* argv[]) + else if ( strcmp(arg, "-fixup_chains") == 0 ) { + fMakeChainedFixups = true; + } ++ else if ( strcmp(arg, "-no_fixup_chains") == 0 ) { ++ fMakeChainedFixups = false; ++ } + else if (strcmp(arg, "-debug_variant") == 0) { + fDebugVariant = true; + } |