aboutsummaryrefslogtreecommitdiff
path: root/depends
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2024-05-06 17:29:26 +0800
committerfanquake <fanquake@gmail.com>2024-05-22 08:51:33 +0100
commit437e908ebd1bf9473ef924de5aec57bdc26de6dd (patch)
tree42da2d2c932e3e8c9bc849bea351554715bae2be /depends
parentbab287d1bab2c02b5fab3285f2678c15316d31c2 (diff)
downloadbitcoin-437e908ebd1bf9473ef924de5aec57bdc26de6dd.tar.xz
depends: swap cctools-x for llvm-x
Only build ld64 from cctools. Disable adhoc codesigning, to avoid non-determinism.
Diffstat (limited to 'depends')
-rw-r--r--depends/hosts/darwin.mk36
-rw-r--r--depends/packages/native_cctools.mk4
-rw-r--r--depends/packages/native_llvm.mk8
-rw-r--r--depends/packages/qt.mk2
4 files changed, 33 insertions, 17 deletions
diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk
index 2c4ef0644d..a405824c26 100644
--- a/depends/hosts/darwin.mk
+++ b/depends/hosts/darwin.mk
@@ -9,7 +9,7 @@ OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-
darwin_native_binutils=native_cctools
ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),)
-# FORCE_USE_SYSTEM_CLANG is empty, so we use our depends-managed, pinned clang
+# FORCE_USE_SYSTEM_CLANG is empty, so we use our depends-managed, pinned LLVM
# from llvm.org
# Clang is a dependency of native_cctools when FORCE_USE_SYSTEM_CLANG is empty
@@ -19,7 +19,18 @@ clang_prog=$(build_prefix)/bin/clang
clangxx_prog=$(clang_prog)++
llvm_config_prog=$(build_prefix)/bin/llvm-config
-darwin_OBJDUMP=$(build_prefix)/bin/$(host)-objdump
+llvm_TOOLS=AR NM OBJDUMP RANLIB STRIP
+
+# Make-only lowercase function
+lc = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$1))))))))))))))))))))))))))
+
+# For well-known tools provided by LLVM, make sure that their well-known
+# variable is set to the full path of the tool, just like how AC_PATH_{TOO,PROG}
+# would.
+$(foreach TOOL,$(llvm_TOOLS),$(eval darwin_$(TOOL) = $$(build_prefix)/bin/llvm-$(call lc,$(TOOL))))
+
+# Clang expects dsymutil to be called dsymutil
+darwin_DSYMUTIL=$(build_prefix)/bin/dsymutil
else
# FORCE_USE_SYSTEM_CLANG is non-empty, so we use the clang from the user's
@@ -40,19 +51,14 @@ llvm_config_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-config")
llvm_lib_dir=$(shell $(llvm_config_prog) --libdir)
+darwin_AR=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-ar")
+darwin_DSYMUTIL=$(shell $(SHELL) $(.SHELLFLAGS) "command -v dsymutil")
+darwin_NM=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-nm")
darwin_OBJDUMP=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-objdump")
+darwin_RANLIB=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-ranlib")
+darwin_STRIP=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-strip")
endif
-cctools_TOOLS=AR RANLIB STRIP NM DSYMUTIL
-
-# Make-only lowercase function
-lc = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$1))))))))))))))))))))))))))
-
-# For well-known tools provided by cctools, make sure that their well-known
-# variable is set to the full path of the tool, just like how AC_PATH_{TOO,PROG}
-# would.
-$(foreach TOOL,$(cctools_TOOLS),$(eval darwin_$(TOOL) = $$(build_prefix)/bin/$$(host)-$(call lc,$(TOOL))))
-
# Flag explanations:
#
# -mlinker-version
@@ -79,6 +85,11 @@ $(foreach TOOL,$(cctools_TOOLS),$(eval darwin_$(TOOL) = $$(build_prefix)/bin/$$(
#
# Indicate to the linker the platform, the oldest supported version,
# and the SDK used.
+#
+# -no_adhoc_codesign
+#
+# Disable adhoc codesigning (for now) when using LLVM tooling, to avoid
+# non-determinism issues with the Identifier field.
darwin_CC=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
-u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \
@@ -104,6 +115,7 @@ darwin_LDFLAGS=-Wl,-platform_version,macos,$(OSX_MIN_VERSION),$(OSX_SDK_VERSION)
ifneq ($(build_os),darwin)
darwin_CFLAGS += -mlinker-version=$(LD64_VERSION)
darwin_CXXFLAGS += -mlinker-version=$(LD64_VERSION)
+darwin_LDFLAGS += -Wl,-no_adhoc_codesign
endif
darwin_release_CFLAGS=-O2
diff --git a/depends/packages/native_cctools.mk b/depends/packages/native_cctools.mk
index 3148e51048..c9100eaf59 100644
--- a/depends/packages/native_cctools.mk
+++ b/depends/packages/native_cctools.mk
@@ -27,11 +27,11 @@ define $(package)_config_cmds
endef
define $(package)_build_cmds
- $(MAKE)
+ $(MAKE) -C ld64
endef
define $(package)_stage_cmds
- $(MAKE) DESTDIR=$($(package)_staging_dir) install
+ $(MAKE) DESTDIR=$($(package)_staging_dir) install -C ld64/src/ld
endef
define $(package)_postprocess_cmds
diff --git a/depends/packages/native_llvm.mk b/depends/packages/native_llvm.mk
index 1953c91bf4..98c205fca7 100644
--- a/depends/packages/native_llvm.mk
+++ b/depends/packages/native_llvm.mk
@@ -16,9 +16,13 @@ define $(package)_stage_cmds
mkdir -p $($(package)_staging_prefix_dir)/include/llvm-c && \
cp bin/clang $($(package)_staging_prefix_dir)/bin/ && \
cp -P bin/clang++ $($(package)_staging_prefix_dir)/bin/ && \
- cp bin/dsymutil $($(package)_staging_prefix_dir)/bin/$(host)-dsymutil && \
+ cp bin/dsymutil $($(package)_staging_prefix_dir)/bin/dsymutil && \
+ cp bin/llvm-ar $($(package)_staging_prefix_dir)/bin/llvm-ar && \
cp bin/llvm-config $($(package)_staging_prefix_dir)/bin/ && \
- cp bin/llvm-objdump $($(package)_staging_prefix_dir)/bin/$(host)-objdump && \
+ cp bin/llvm-nm $($(package)_staging_prefix_dir)/bin/llvm-nm && \
+ cp bin/llvm-objdump $($(package)_staging_prefix_dir)/bin/llvm-objdump && \
+ cp bin/llvm-ranlib $($(package)_staging_prefix_dir)/bin/llvm-ranlib && \
+ cp bin/llvm-strip $($(package)_staging_prefix_dir)/bin/llvm-strip && \
cp include/llvm-c/ExternC.h $($(package)_staging_prefix_dir)/include/llvm-c && \
cp include/llvm-c/lto.h $($(package)_staging_prefix_dir)/include/llvm-c && \
cp lib/libLTO.so $($(package)_staging_prefix_dir)/lib/ && \
diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk
index e8ee35e516..0bf0c0036a 100644
--- a/depends/packages/qt.mk
+++ b/depends/packages/qt.mk
@@ -139,7 +139,7 @@ ifneq ($(build_os),darwin)
$(package)_config_opts_darwin += -xplatform macx-clang-linux
$(package)_config_opts_darwin += -device-option MAC_SDK_PATH=$(OSX_SDK)
$(package)_config_opts_darwin += -device-option MAC_SDK_VERSION=$(OSX_SDK_VERSION)
-$(package)_config_opts_darwin += -device-option CROSS_COMPILE="$(host)-"
+$(package)_config_opts_darwin += -device-option CROSS_COMPILE="llvm-"
$(package)_config_opts_darwin += -device-option MAC_TARGET=$(host)
$(package)_config_opts_darwin += -device-option XCODE_VERSION=$(XCODE_VERSION)
endif