Always use the system Clang when compiling for macOS. Removes the native_llvm package. Simplifies #21778 (which should also fix the RISC-V macOS cross build).
depends: remove `FORCE_USE_SYSTEM_CLANG` & native_llvm #29188
pull fanquake wants to merge 2 commits into bitcoin:master from fanquake:depends_use_system_clang changing 14 files +26 −77-
fanquake commented at 4:21 PM on January 5, 2024: member
-
DrahtBot commented at 4:21 PM on January 5, 2024: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
Code Coverage
For detailed information about the code coverage, see the test coverage report.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #25573 ([POC] guix: produce a fully
-static-piebitcoind by fanquake) - #25391 (guix: Use LTO to build releases by fanquake)
- #21778 (build: LLD based macOS toolchain by fanquake)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
- #25573 ([POC] guix: produce a fully
- DrahtBot added the label Build system on Jan 5, 2024
- fanquake added the label DrahtBot Guix build requested on Jan 5, 2024
-
hebasto commented at 4:23 PM on January 5, 2024: member
Concept ACK.
- fanquake force-pushed on Jan 5, 2024
-
maflcko commented at 4:38 PM on January 5, 2024: member
which should also fix the RISC-V macOS cross build
I think that is currently failing due to a bug in the llvm upstream build system (https://github.com/bitcoin/bitcoin/pull/28880#issuecomment-1846869958)
Other than that:
Nice!
-
fanquake commented at 4:42 PM on January 5, 2024: member
I think that is currently failing due to a bug in the llvm upstream build system (https://github.com/bitcoin/bitcoin/pull/28880#issuecomment-1846869958)
Right, I was referring to this failure, #29078 (comment), where we can't compile cctools on RISC-V, because it just isn't supported.
-
hebasto commented at 5:01 PM on January 5, 2024: member
Expecting that macOS cross-compiling CI job will fail and we need to reapply https://github.com/bitcoin/bitcoin/commit/05aca093819be276ac7d648472c6ed5c7d235cc5.
-
hebasto commented at 5:05 PM on January 5, 2024: member
It seems the
*__native_toolchainvariables are no longer needed:diff --git a/depends/Makefile b/depends/Makefile index 319c3498df..8f33b7defa 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -186,7 +186,6 @@ all_packages = $(packages) $(native_packages) meta_depends = Makefile funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk $(host_arch)_$(host_os)_native_binutils?=$($(host_os)_native_binutils) -$(host_arch)_$(host_os)_native_toolchain?=$($(host_os)_native_toolchain) include funcs.mk diff --git a/depends/builders/darwin.mk b/depends/builders/darwin.mk index 8ed82b276d..7663a25ac3 100644 --- a/depends/builders/darwin.mk +++ b/depends/builders/darwin.mk @@ -22,7 +22,6 @@ darwin_NM:=$(shell xcrun -f nm) darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool) darwin_DSYMUTIL:=$(shell xcrun -f dsymutil) darwin_native_binutils= -darwin_native_toolchain= x86_64_darwin_CFLAGS += -arch x86_64 x86_64_darwin_CXXFLAGS += -arch x86_64 diff --git a/depends/funcs.mk b/depends/funcs.mk index 987be4e611..d1db87305f 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -47,7 +47,7 @@ endef define int_get_build_id $(eval $(1)_dependencies += $($(1)_$(host_arch)_$(host_os)_dependencies) $($(1)_$(host_os)_dependencies)) -$(eval $(1)_all_dependencies:=$(call int_get_all_dependencies,$(1),$($($(1)_type)_native_toolchain) $($($(1)_type)_native_binutils) $($(1)_dependencies))) +$(eval $(1)_all_dependencies:=$(call int_get_all_dependencies,$(1),$($($(1)_type)_native_binutils) $($(1)_dependencies))) $(foreach dep,$($(1)_all_dependencies),$(eval $(1)_build_id_deps+=$(dep)-$($(dep)_version)-$($(dep)_recipe_hash))) $(eval $(1)_build_id_long:=$(1)-$($(1)_version)-$($(1)_recipe_hash)-$(release_type) $($(1)_build_id_deps) $($($(1)_type)_id)) $(eval $(1)_build_id:=$(shell echo -n "$($(1)_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH))) @@ -288,5 +288,5 @@ $(foreach package,$(all_packages),$(eval $(call int_config_attach_build_config,$ #create build targets $(foreach package,$(all_packages),$(eval $(call int_add_cmds,$(package)))) -#special exception: if a toolchain package exists, all non-native packages depend on it -$(foreach package,$(packages),$(eval $($(package)_extracted): |$($($(host_arch)_$(host_os)_native_toolchain)_cached) $($($(host_arch)_$(host_os)_native_binutils)_cached) )) +#special exception: if a native binutils package exists, all non-native packages depend on it +$(foreach package,$(packages),$(eval $($(package)_extracted): |$($($(host_arch)_$(host_os)_native_binutils)_cached) )) diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index baaeadf49f..667793d7f6 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -7,7 +7,6 @@ LD64_VERSION=711 OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-libcxx-headers darwin_native_binutils=native_cctools -darwin_native_toolchain= # We can't just use $(shell command -v clang) because GNU Make handles builtins # in a special way and doesn't know that `command` is a POSIX-standard builtin -
dongcarl commented at 5:26 PM on January 5, 2024: contributor
Concept ACK
- DrahtBot added the label CI failed on Jan 5, 2024
-
DrahtBot commented at 2:32 AM on January 6, 2024: contributor
<!--9cd9c72976c961c55c7acef8f6ba82cd-->
Guix builds (on x86_64)
- DrahtBot removed the label DrahtBot Guix build requested on Jan 6, 2024
-
8a645617d4
build: Patch Qt to handle minimum macOS version properly
This change is required to support Clang < 17.
-
569c9d4018
depends: remove FORCE_USE_SYSTEM_CLANG
Always use the system Clang when compiling for macOS.
- fanquake force-pushed on Jan 9, 2024
-
fanquake commented at 11:06 AM on January 9, 2024: member
Pulled back in the commit to fix Qt for Clang < 17.
- fanquake closed this on Jan 9, 2024
- fanquake deleted the branch on Jan 9, 2024
- bitcoin locked this on Jan 8, 2025