From 416e1545989a514fd657cf51d362c01b9478e725 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Fri, 15 Apr 2022 16:22:01 +0200 Subject: [PATCH 01/15] merge bitcoin#24866: No longer need to hack the PATH variable in `config.site` includes: - f3af4f7a182f81269c193d5d1fd0effb9161f7c6 - efa3a807a677659b0b74cdeda944e7c8ce0157fb continuation of 9e0b9356 from dash#6384 --- depends/Makefile | 1 + depends/builders/darwin.mk | 2 ++ depends/builders/default.mk | 2 +- depends/config.site.in | 6 +++++- depends/hosts/darwin.mk | 2 +- depends/hosts/default.mk | 2 +- 6 files changed, 11 insertions(+), 4 deletions(-) diff --git a/depends/Makefile b/depends/Makefile index b13e07b6f8b56..cc9a249b9e896 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -227,6 +227,7 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_ -e 's|@NM@|$(host_NM)|' \ -e 's|@STRIP@|$(host_STRIP)|' \ -e 's|@OBJDUMP@|$(host_OBJDUMP)|' \ + -e 's|@DSYMUTIL@|$(host_DSYMUTIL)|' \ -e 's|@build_os@|$(build_os)|' \ -e 's|@host_os@|$(host_os)|' \ -e 's|@CFLAGS@|$(strip $(host_CFLAGS) $(host_$(release_type)_CFLAGS))|' \ diff --git a/depends/builders/darwin.mk b/depends/builders/darwin.mk index 3aea314ad87c3..be04e1d8f3fc8 100644 --- a/depends/builders/darwin.mk +++ b/depends/builders/darwin.mk @@ -5,6 +5,7 @@ build_darwin_RANLIB:=$(shell xcrun -f ranlib) build_darwin_STRIP:=$(shell xcrun -f strip) build_darwin_OBJDUMP:=$(shell xcrun -f objdump) build_darwin_NM:=$(shell xcrun -f nm) +build_darwin_DSYMUTIL:=$(shell xcrun -f dsymutil) build_darwin_SHA256SUM=shasum -a 256 build_darwin_DOWNLOAD=curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o @@ -16,6 +17,7 @@ darwin_RANLIB:=$(shell xcrun -f ranlib) darwin_STRIP:=$(shell xcrun -f strip) darwin_OBJDUMP:=$(shell xcrun -f objdump) darwin_NM:=$(shell xcrun -f nm) +darwin_DSYMUTIL:=$(shell xcrun -f dsymutil) darwin_native_binutils= darwin_native_toolchain= diff --git a/depends/builders/default.mk b/depends/builders/default.mk index fa7dfbb005303..2a1709d98ad21 100644 --- a/depends/builders/default.mk +++ b/depends/builders/default.mk @@ -13,7 +13,7 @@ build_$(build_os)_$1 ?= $$(default_build_$1) build_$(build_arch)_$(build_os)_$1 ?= $$(build_$(build_os)_$1) build_$1=$$(build_$(build_arch)_$(build_os)_$1) endef -$(foreach var,CC CXX AR TAR RANLIB NM STRIP SHA256SUM DOWNLOAD OBJDUMP TOUCH,$(eval $(call add_build_tool_func,$(var)))) +$(foreach var,CC CXX AR TAR RANLIB NM STRIP SHA256SUM DOWNLOAD OBJDUMP DSYMUTIL TOUCH,$(eval $(call add_build_tool_func,$(var)))) define add_build_flags_func build_$(build_arch)_$(build_os)_$1 += $(build_$(build_os)_$1) build_$1=$$(build_$(build_arch)_$(build_os)_$1) diff --git a/depends/config.site.in b/depends/config.site.in index 1df388666ee25..9fb9da29851cd 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -78,7 +78,6 @@ if test "@host_os@" = darwin; then BREW=no fi -PATH="${depends_prefix}/native/bin:${PATH}" PKG_CONFIG="$(which pkg-config) --static" # These two need to remain exported because pkg-config does not see them @@ -125,6 +124,11 @@ if test "@host_os@" = darwin; then OBJDUMP="@OBJDUMP@" ac_cv_path_ac_pt_OBJDUMP="${OBJDUMP}" fi + + if test -n "@DSYMUTIL@"; then + DSYMUTIL="@DSYMUTIL@" + ac_cv_path_ac_pt_DSYMUTIL="${DSYMUTIL}" + fi fi if test -n "@debug@"; then diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index a683a9bc34163..2c4ef0644d2c5 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -43,7 +43,7 @@ llvm_lib_dir=$(shell $(llvm_config_prog) --libdir) darwin_OBJDUMP=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-objdump") endif -cctools_TOOLS=AR RANLIB STRIP NM +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)))))))))))))))))))))))))) diff --git a/depends/hosts/default.mk b/depends/hosts/default.mk index c9ee7cc950127..d82c33f29ce06 100644 --- a/depends/hosts/default.mk +++ b/depends/hosts/default.mk @@ -38,5 +38,5 @@ host_$1 = $$($(host_arch)_$(host_os)_$1) host_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1) endef -$(foreach tool,CC CXX AR RANLIB STRIP NM OBJCOPY OBJDUMP,$(eval $(call add_host_tool_func,$(tool)))) +$(foreach tool,CC CXX AR RANLIB STRIP NM OBJCOPY OBJDUMP DSYMUTIL,$(eval $(call add_host_tool_func,$(tool)))) $(foreach flags,CFLAGS CXXFLAGS CPPFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags)))) From f0a0040ed1d2f189058c899b7245822d6ea87188 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Mon, 30 Dec 2024 11:55:53 +0000 Subject: [PATCH 02/15] fix: ensure that `dsymutil` available even when `FORCE_USE_SYSTEM_CLANG=1` `dsymutil` is defined as only available in `cctools` but Guix builds with `FORCE_USE_SYSTEM_CLANG`, which omits `cctools` (and therefore, `dsymutil`) but we use `dsymutil` to generate debug symbols, so we need to make sure that we get `dsymutil` one way or another. --- depends/hosts/darwin.mk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index 2c4ef0644d2c5..7f717d1eacdef 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -8,6 +8,8 @@ OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with- darwin_native_binutils=native_cctools +cctools_TOOLS=AR RANLIB STRIP NM + ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) # FORCE_USE_SYSTEM_CLANG is empty, so we use our depends-managed, pinned clang # from llvm.org @@ -15,6 +17,8 @@ ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) # Clang is a dependency of native_cctools when FORCE_USE_SYSTEM_CLANG is empty darwin_native_toolchain=native_cctools +cctools_TOOLS+=" DSYMUTIL" + clang_prog=$(build_prefix)/bin/clang clangxx_prog=$(clang_prog)++ llvm_config_prog=$(build_prefix)/bin/llvm-config @@ -40,11 +44,10 @@ llvm_config_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-config") llvm_lib_dir=$(shell $(llvm_config_prog) --libdir) +darwin_DSYMUTIL=$(shell $(SHELL) $(.SHELLFLAGS) "command -v dsymutil") darwin_OBJDUMP=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-objdump") 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)))))))))))))))))))))))))) From 407deabd75aedd5f2583f8f51222870cf60cebb5 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Mon, 18 Jul 2022 15:58:02 +0100 Subject: [PATCH 03/15] merge bitcoin#25612: default to using GCC tool wrappers for LTO (with GCC) includes: - 6fdc13c61f0e5ef6be0c03fa475741ab2cd57672 continuation of 019c9dd7 from dash#6384 --- configure.ac | 1 + depends/config.site.in | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index af682ac9c17c9..b536f7706eeeb 100644 --- a/configure.ac +++ b/configure.ac @@ -2014,5 +2014,6 @@ echo " CPPFLAGS = $DEBUG_CPPFLAGS $HARDENED_CPPFLAGS $CORE_CPPFLAGS echo " CXX = $CXX" echo " CXXFLAGS = $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $GPROF_CXXFLAGS $CORE_CXXFLAGS $CXXFLAGS" echo " LDFLAGS = $PTHREAD_LIBS $HARDENED_LDFLAGS $GPROF_LDFLAGS $CORE_LDFLAGS $LDFLAGS" +echo " AR = $AR" echo " ARFLAGS = $ARFLAGS" echo diff --git a/depends/config.site.in b/depends/config.site.in index 9fb9da29851cd..2721a25171955 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -101,7 +101,7 @@ PYTHONPATH="${depends_prefix}/native/lib/python3/dist-packages${PYTHONPATH:+${PA if test -n "@AR@"; then AR="@AR@" - ac_cv_path_ac_pt_AR="${AR}" + ac_cv_path_AR="${AR}" fi if test -n "@RANLIB@"; then @@ -122,12 +122,12 @@ fi if test "@host_os@" = darwin; then if test -n "@OBJDUMP@"; then OBJDUMP="@OBJDUMP@" - ac_cv_path_ac_pt_OBJDUMP="${OBJDUMP}" + ac_cv_path_OBJDUMP="${OBJDUMP}" fi if test -n "@DSYMUTIL@"; then DSYMUTIL="@DSYMUTIL@" - ac_cv_path_ac_pt_DSYMUTIL="${DSYMUTIL}" + ac_cv_path_DSYMUTIL="${DSYMUTIL}" fi fi From 122a61fbbe7652c7b13e3c767ab56697af2eead7 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Fri, 3 Jan 2025 08:00:53 +0000 Subject: [PATCH 04/15] merge bitcoin#28432: Produce a `.zip` for macOS distribution --- .gitignore | 2 +- Makefile.am | 17 +++-- ci/test/00_setup_env_mac.sh | 2 +- configure.ac | 3 +- contrib/containers/ci/Dockerfile | 2 +- contrib/guix/libexec/build.sh | 2 +- contrib/guix/libexec/codesign.sh | 7 +- contrib/guix/manifest.scm | 3 +- contrib/macdeploy/README.md | 19 ++--- contrib/macdeploy/background.tiff | Bin 18464 -> 0 bytes contrib/macdeploy/macdeployqtplus | 105 ++------------------------- depends/README.md | 2 +- depends/packages/native_ds_store.mk | 15 ---- depends/packages/native_mac_alias.mk | 15 ---- depends/packages/packages.mk | 2 +- doc/build-osx.md | 12 +-- doc/release-notes-6516.md | 5 ++ doc/release-process.md | 2 +- 18 files changed, 42 insertions(+), 173 deletions(-) delete mode 100644 contrib/macdeploy/background.tiff delete mode 100644 depends/packages/native_ds_store.mk delete mode 100644 depends/packages/native_mac_alias.mk create mode 100644 doc/release-notes-6516.md diff --git a/.gitignore b/.gitignore index 9a73e23bdbbf1..99a841eb69f9b 100644 --- a/.gitignore +++ b/.gitignore @@ -75,7 +75,7 @@ libconftest.dylib* *.log *.trs -*.dmg +*.zip *.json.h *.raw.h diff --git a/Makefile.am b/Makefile.am index 0794ac8c02d11..9ce6f2ccd0262 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,7 +36,7 @@ space := $(empty) $(empty) OSX_APP=Dash-Qt.app OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME)) -OSX_DMG = $(OSX_VOLNAME).dmg +OSX_ZIP = $(OSX_VOLNAME).zip OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/dash.icns OSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed @@ -119,15 +119,16 @@ OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lp $(OSX_APP)/Contents/MacOS/Dash-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings if BUILD_DARWIN -$(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) - $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) $(OSX_VOLNAME) -translations-dir=$(QT_TRANSLATION_DIR) -dmg +$(OSX_ZIP): $(OSX_APP_BUILT) $(OSX_PACKAGING) + $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) $(OSX_VOLNAME) -translations-dir=$(QT_TRANSLATION_DIR) -zip -deploydir: $(OSX_DMG) +deploydir: $(OSX_ZIP) else !BUILD_DARWIN APP_DIST_DIR=$(top_builddir)/dist -$(OSX_DMG): deploydir - $(XORRISOFS) -D -l -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -o $@ $(APP_DIST_DIR) -- $(if $(SOURCE_DATE_EPOCH),-volume_date all_file_dates =$(SOURCE_DATE_EPOCH)) +$(OSX_ZIP): deploydir + if [ -n "$(SOURCE_DATE_EPOCH)" ]; then find $(APP_DIST_DIR) -exec touch -d @$(SOURCE_DATE_EPOCH) {} +; fi + cd $(APP_DIST_DIR) && find . | sort | $(ZIP) -X@ $@ $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Dash-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING) OBJDUMP=$(OBJDUMP) $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) $(OSX_VOLNAME) -translations-dir=$(QT_TRANSLATION_DIR) @@ -135,7 +136,7 @@ $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Dash-Qt: $(OSX_APP_BUILT) $(OSX_PACKAG deploydir: $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Dash-Qt endif !BUILD_DARWIN -deploy: $(OSX_DMG) +deploy: $(OSX_ZIP) endif $(BITCOIN_QT_BIN): FORCE @@ -294,7 +295,7 @@ EXTRA_DIST += \ test/util/data/txcreatesignv2.hex \ test/util/rpcauth-test.py -CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER) +CLEANFILES = $(OSX_ZIP) $(BITCOIN_WIN_INSTALLER) DISTCHECK_CONFIGURE_FLAGS = --enable-man diff --git a/ci/test/00_setup_env_mac.sh b/ci/test/00_setup_env_mac.sh index 6270df634aeca..c6f44d8cd8e3b 100755 --- a/ci/test/00_setup_env_mac.sh +++ b/ci/test/00_setup_env_mac.sh @@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_macos_cross export HOST=x86_64-apple-darwin -export PACKAGES="cmake libz-dev python3-setuptools xorriso" +export PACKAGES="cmake libz-dev python3-setuptools zip" export XCODE_VERSION=15.0 export XCODE_BUILD_ID=15A240d export RUN_UNIT_TESTS=false diff --git a/configure.ac b/configure.ac index b536f7706eeeb..ec5241933cd55 100644 --- a/configure.ac +++ b/configure.ac @@ -843,7 +843,7 @@ case $host in ;; *) AC_PATH_TOOL([DSYMUTIL], [dsymutil], dsymutil) - AC_PATH_PROGS([XORRISOFS], [xorrisofs], xorrisofs) + AC_PATH_PROG([ZIP], [zip], [zip]) dnl libtool will try to strip the static lib, which is a problem for dnl cross-builds because strip attempts to call a hard-coded ld, @@ -1934,7 +1934,6 @@ AC_CONFIG_LINKS([contrib/devtools/test-security-check.py:contrib/devtools/test-s AC_CONFIG_LINKS([contrib/devtools/symbol-check.py:contrib/devtools/symbol-check.py]) AC_CONFIG_LINKS([contrib/devtools/test-symbol-check.py:contrib/devtools/test-symbol-check.py]) AC_CONFIG_LINKS([contrib/filter-lcov.py:contrib/filter-lcov.py]) -AC_CONFIG_LINKS([contrib/macdeploy/background.tiff:contrib/macdeploy/background.tiff]) AC_CONFIG_LINKS([test/functional/test_runner.py:test/functional/test_runner.py]) AC_CONFIG_LINKS([test/fuzz/test_runner.py:test/fuzz/test_runner.py]) AC_CONFIG_LINKS([test/util/test_runner.py:test/util/test_runner.py]) diff --git a/contrib/containers/ci/Dockerfile b/contrib/containers/ci/Dockerfile index 85df2c31054f8..c8e905fa6c114 100644 --- a/contrib/containers/ci/Dockerfile +++ b/contrib/containers/ci/Dockerfile @@ -159,7 +159,7 @@ RUN apt-get update && apt-get install $APT_ARGS \ valgrind \ wine-stable \ wine64 \ - xorriso \ + zip \ && rm -rf /var/lib/apt/lists/* # This is a hack. It is needed because gcc-multilib and g++-multilib are conflicting with g++-arm-linux-gnueabihf. This is diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh index 4c4f8d09b6b04..4138a08a47785 100755 --- a/contrib/guix/libexec/build.sh +++ b/contrib/guix/libexec/build.sh @@ -326,7 +326,7 @@ mkdir -p "$DISTSRC" | gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.tar.gz" \ || ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.tar.gz" && exit 1 ) ) - make deploy ${V:+V=1} OSX_DMG="${OUTDIR}/${DISTNAME}-${HOST}-unsigned.dmg" + make deploy ${V:+V=1} OSX_ZIP="${OUTDIR}/${DISTNAME}-${HOST}-unsigned.zip" ;; esac ( diff --git a/contrib/guix/libexec/codesign.sh b/contrib/guix/libexec/codesign.sh index c0976286908ac..867d9b6e807fc 100755 --- a/contrib/guix/libexec/codesign.sh +++ b/contrib/guix/libexec/codesign.sh @@ -78,11 +78,8 @@ mkdir -p "$DISTSRC" # Apply detached codesignatures to dist/ (in-place) signapple apply dist/Dash-Qt.app codesignatures/osx/dist - # Make a DMG from dist/ - xorrisofs -D -l -V "$(< osx_volname)" -no-pad -r -dir-mode 0755 \ - -o "${OUTDIR}/${DISTNAME}-${HOST}.dmg" \ - dist \ - -- -volume_date all_file_dates ="$SOURCE_DATE_EPOCH" + # Make a .zip from dist/ + zip "${OUTDIR}/${DISTNAME}-${HOST}.zip" dist/* ;; *) exit 1 diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm index 8b632c0b4fa6a..f761bdbabb5d7 100644 --- a/contrib/guix/manifest.scm +++ b/contrib/guix/manifest.scm @@ -3,7 +3,6 @@ ((gnu packages bash) #:select (bash-minimal)) (gnu packages bison) ((gnu packages certs) #:select (nss-certs)) - ((gnu packages cdrom) #:select (xorriso)) ((gnu packages cmake) #:select (cmake-minimal)) (gnu packages commencement) (gnu packages compression) @@ -611,5 +610,5 @@ inspecting signatures in Mach-O binaries.") binutils clang-toolchain-17 python-signapple - xorriso)) + zip)) (else '()))))) diff --git a/contrib/macdeploy/README.md b/contrib/macdeploy/README.md index 7d8f0958e2af6..b9a2a6b0240e2 100644 --- a/contrib/macdeploy/README.md +++ b/contrib/macdeploy/README.md @@ -6,7 +6,7 @@ The `macdeployqtplus` script should not be run manually. Instead, after building make deploy ``` -When complete, it will have produced `Dash-Qt.dmg`. +When complete, it will have produced `Dash-Core.zip`. ## SDK Extraction @@ -54,10 +54,10 @@ path to `Xcode.app` (extracted in the previous stage) as the first argument. The generated archive should be: `Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz`. The `sha256sum` should be `c0c2e7bb92c1fee0c4e9f3a485e4530786732d6c6dd9e9f418c282aa6892f55d`. -## Deterministic macOS DMG Notes +## Deterministic macOS App Notes -Working macOS DMGs are created in Linux by combining a recent `clang`, the Apple -`binutils` (`ld`, `ar`, etc) and DMG authoring tools. +macOS Applications are created in Linux by combining a recent `clang` and the Apple +`binutils` (`ld`, `ar`, etc). Apple uses `clang` extensively for development and has upstreamed the necessary functionality so that a vanilla clang can take advantage. It supports the use of `-F`, @@ -86,21 +86,16 @@ created using these tools. The build process has been designed to avoid includin SDK's files in Guix's outputs. All interim tarballs are fully deterministic and may be freely redistributed. -[`xorrisofs`](https://www.gnu.org/software/xorriso/) is used to create the DMG. - -A background image is added to DMG files by inserting a `.DS_Store` during creation. - As of OS X 10.9 Mavericks, using an Apple-blessed key to sign binaries is a requirement in order to satisfy the new Gatekeeper requirements. Because this private key cannot be shared, we'll have to be a bit creative in order for the build process to remain somewhat deterministic. Here's how it works: -- Builders use Guix to create an unsigned release. This outputs an unsigned DMG which +- Builders use Guix to create an unsigned release. This outputs an unsigned ZIP which users may choose to bless and run. It also outputs an unsigned app structure in the form - of a tarball, which also contains all of the tools that have been previously (deterministically) - built in order to create a final DMG. + of a tarball. - The Apple keyholder uses this unsigned app to create a detached signature, using the script that is also included there. Detached signatures are available from this [repository](https://github.com/dashpay/dash-detached-sigs). - Builders feed the unsigned app + detached signature back into Guix. It uses the - pre-built tools to recombine the pieces into a deterministic DMG. + pre-built tools to recombine the pieces into a deterministic ZIP. diff --git a/contrib/macdeploy/background.tiff b/contrib/macdeploy/background.tiff deleted file mode 100644 index 1fb088c8374ac3acd5c4f4eb6ea6b5869723fd2f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18464 zcmeHtc|4Tg`}d3)OV&_Cwvs)vWEs22l08M1LQG8d8Pv#9DJ_a*9mW!(5=xdVQA#p2 zM1@G}%v82AA^UUgTYW!$zMt>&{Fdk6c#Zoy*SXI7dSA;qbJy!wSt%mcaUu{$UybK> zC#LTed;CW2fvl}M=Nkasjk(NKXM?5+jZUu0F8O3r#LZt=@%D&HseG>t8+Uipo& zN}Uz}FMAN4(iuFL&_T1q%f^#a$;NUI-@HDY%Uvs>qaN|`WWYmJ;w!1SCYQh%l#{4z zru#BjDKYmq15ePl70p`Qsh#C)%n*F-Vz{1&@yqS!>NPNB@1mp$=H!~NB?TU6+DQ$g zw{ur6w^Tr0FFBk1LiMPx!Y1}&V?ae#RxR$4D^EYES4@h%IMt3V{Gu)HGnnkOW4mN) zckr2X`^yM>T(AxGm1SM(yEiu3dA++eF;cnV>c<0p1gz1RvMbFg7!6E-^i{irH?g>Y zUDiV%kK5F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3)U=2eAKjv(^U4zi!s<0rLO$X6-4k7W#p% zH6nj|)`1w`f{z0Tst8=(&;*|fF$4lDg+T1wf@y8@J$I Date: Mon, 30 Oct 2023 14:27:37 -0400 Subject: [PATCH 05/15] merge bitcoin#28757: Zip needs to include all files and set time to SOURCE_DATE_EPOCH --- contrib/guix/libexec/codesign.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/guix/libexec/codesign.sh b/contrib/guix/libexec/codesign.sh index 867d9b6e807fc..12482a6e46242 100755 --- a/contrib/guix/libexec/codesign.sh +++ b/contrib/guix/libexec/codesign.sh @@ -79,7 +79,11 @@ mkdir -p "$DISTSRC" signapple apply dist/Dash-Qt.app codesignatures/osx/dist # Make a .zip from dist/ - zip "${OUTDIR}/${DISTNAME}-${HOST}.zip" dist/* + cd dist/ + find . -print0 \ + | xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}" + find . | sort \ + | zip -X@ "${OUTDIR}/${DISTNAME}-${HOST}.zip" ;; *) exit 1 From 5bef1e505da7d61e1d46b28167fb9e2407fb9cc4 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Fri, 10 Nov 2023 13:58:46 +0000 Subject: [PATCH 06/15] merge bitcoin#28845: remove `PYTHONPATH` from config.site --- Makefile.am | 2 -- configure.ac | 2 -- depends/config.site.in | 1 - 3 files changed, 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index 9ce6f2ccd0262..b059d0c6f7d43 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,8 +15,6 @@ endif .PHONY: deploy FORCE .INTERMEDIATE: $(COVERAGE_INFO) -export PYTHONPATH - if BUILD_BITCOIN_LIBS pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libdashconsensus.pc diff --git a/configure.ac b/configure.ac index ec5241933cd55..915dc8d49d720 100644 --- a/configure.ac +++ b/configure.ac @@ -127,8 +127,6 @@ AC_PATH_TOOL(DSYMUTIL, dsymutil) AC_PATH_PROG(DOXYGEN, doxygen) AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"]) -AC_ARG_VAR(PYTHONPATH, Augments the default search path for python module files) - AC_ARG_ENABLE([wallet], [AS_HELP_STRING([--disable-wallet], [disable wallet (enabled by default)])], diff --git a/depends/config.site.in b/depends/config.site.in index 2721a25171955..26d5bcfcc2a44 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -97,7 +97,6 @@ fi if test -n "@CXX@" -a -z "${CXX}"; then CXX="@CXX@" fi -PYTHONPATH="${depends_prefix}/native/lib/python3/dist-packages${PYTHONPATH:+${PATH_SEPARATOR}}${PYTHONPATH}" if test -n "@AR@"; then AR="@AR@" From 62e671dfc2173aee6aedde125138434b44f7f590 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Wed, 15 Nov 2023 17:05:05 +0000 Subject: [PATCH 07/15] merge bitcoin#28932: remove `python3-setuptools` from macOS build deps --- ci/test/00_setup_env_mac.sh | 2 +- depends/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/test/00_setup_env_mac.sh b/ci/test/00_setup_env_mac.sh index c6f44d8cd8e3b..cf37d6c1b54d2 100755 --- a/ci/test/00_setup_env_mac.sh +++ b/ci/test/00_setup_env_mac.sh @@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_macos_cross export HOST=x86_64-apple-darwin -export PACKAGES="cmake libz-dev python3-setuptools zip" +export PACKAGES="cmake libz-dev zip" export XCODE_VERSION=15.0 export XCODE_BUILD_ID=15A240d export RUN_UNIT_TESTS=false diff --git a/depends/README.md b/depends/README.md index 44888ebd0f521..ee6e48758a74d 100644 --- a/depends/README.md +++ b/depends/README.md @@ -47,7 +47,7 @@ The paths are automatically configured and no other options are needed unless ta #### For macOS cross compilation - sudo apt-get install curl bsdmainutils cmake libz-dev python3-setuptools zip + sudo apt-get install curl bsdmainutils cmake libz-dev zip Note: You must obtain the macOS SDK before proceeding with a cross-compile. Under the depends directory, create a subdirectory named `SDKs`. From c2fe7c60b4cb3496f8b1b33ec74f0273a7f29191 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Wed, 1 Jan 2025 09:07:55 +0000 Subject: [PATCH 08/15] merge bitcoin#28973: remove `libz-dev` from macOS build deps --- ci/test/00_setup_env_mac.sh | 2 +- depends/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/test/00_setup_env_mac.sh b/ci/test/00_setup_env_mac.sh index cf37d6c1b54d2..654a67e45e870 100755 --- a/ci/test/00_setup_env_mac.sh +++ b/ci/test/00_setup_env_mac.sh @@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_macos_cross export HOST=x86_64-apple-darwin -export PACKAGES="cmake libz-dev zip" +export PACKAGES="cmake zip" export XCODE_VERSION=15.0 export XCODE_BUILD_ID=15A240d export RUN_UNIT_TESTS=false diff --git a/depends/README.md b/depends/README.md index ee6e48758a74d..57d82518a08de 100644 --- a/depends/README.md +++ b/depends/README.md @@ -47,7 +47,7 @@ The paths are automatically configured and no other options are needed unless ta #### For macOS cross compilation - sudo apt-get install curl bsdmainutils cmake libz-dev zip + sudo apt-get install curl bsdmainutils cmake zip Note: You must obtain the macOS SDK before proceeding with a cross-compile. Under the depends directory, create a subdirectory named `SDKs`. From ea891d48ea3128e8bc6df85c369d9df3f5aa031b Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Tue, 31 Dec 2024 14:06:06 +0000 Subject: [PATCH 09/15] fix: use `LDFLAGS` when compiling `gmp`'s `configure` test programs Needed to ensure macOS cross-compilation doesn't break when moving to an LLD based toolchain, which will happen in the next commit. --- depends/packages/gmp.mk | 5 + .../gmp/include_ldflags_in_configure.patch | 621 ++++++++++++++++++ 2 files changed, 626 insertions(+) create mode 100644 depends/patches/gmp/include_ldflags_in_configure.patch diff --git a/depends/packages/gmp.mk b/depends/packages/gmp.mk index ff0dda5835615..3d645cd02a695 100644 --- a/depends/packages/gmp.mk +++ b/depends/packages/gmp.mk @@ -3,6 +3,7 @@ $(package)_version=6.3.0 $(package)_download_path=https://ftp.gnu.org/gnu/gmp $(package)_file_name=gmp-$($(package)_version).tar.bz2 $(package)_sha256_hash=ac28211a7cfb609bae2e2c8d6058d66c8fe96434f740cf6fe2e47b000d1c20cb +$(package)_patches=include_ldflags_in_configure.patch define $(package)_set_vars $(package)_config_opts += --disable-shared --enable-cxx --enable-fat @@ -11,6 +12,10 @@ $(package)_cflags_armv7l += -march=armv7-a $(package)_cflags_x86_64 += -march=x86-64 endef +define $(package)_preprocess_cmds + patch -p1 < $($(package)_patch_dir)/include_ldflags_in_configure.patch +endef + define $(package)_config_cmds $($(package)_autoconf) endef diff --git a/depends/patches/gmp/include_ldflags_in_configure.patch b/depends/patches/gmp/include_ldflags_in_configure.patch new file mode 100644 index 0000000000000..8ddc304da0eca --- /dev/null +++ b/depends/patches/gmp/include_ldflags_in_configure.patch @@ -0,0 +1,621 @@ +Use LDFLAGS when configure is compiling test programs. + +Needed for macOS cross-compilation support using lld (ld64.lld) as +a linker, done by including '-fuse-ld=lld' in LDFLAGS. Defining it +in CC or CXX will result in unused argument warnings if the compiler +isn't expected to link files. + +diff --git a/acinclude.m4 b/acinclude.m4 +index 9cf9483..99edd43 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -1752,7 +1752,7 @@ AC_CACHE_CHECK([if globals are prefixed by underscore], + cat >conftest.c <conftest.out + if grep "[[ ]]_gurkmacka" conftest.out >/dev/null; then +@@ -1984,7 +1984,7 @@ const int foo[[]] = {1,2,3}; + EOF + echo "Test program:" >&AC_FD_CC + cat conftest.c >&AC_FD_CC +-gmp_compile="$CC $CFLAGS $CPPFLAGS -S conftest.c >&AC_FD_CC" ++gmp_compile="$CC $CFLAGS $CPPFLAGS $LDFLAGS -S conftest.c >&AC_FD_CC" + if AC_TRY_EVAL(gmp_compile); then + echo "Compiler output:" >&AC_FD_CC + cat conftest.s >&AC_FD_CC +@@ -2382,7 +2382,7 @@ for tmp_underscore in "" "_"; do + ${tmp_gsym_prefix}main$gmp_cv_asm_label_suffix + addl $ ${tmp_underscore}_GLOBAL_OFFSET_TABLE_, %ebx + EOF +- gmp_compile="$CCAS $CFLAGS $CPPFLAGS $lt_prog_compiler_pic conftest.s >&AC_FD_CC && $CC $CFLAGS $CPPFLAGS $lt_prog_compiler_pic conftest.$OBJEXT >&AC_FD_CC" ++ gmp_compile="$CCAS $CFLAGS $CPPFLAGS $LDFLAGS $lt_prog_compiler_pic conftest.s >&AC_FD_CC && $CC $CFLAGS $CPPFLAGS $LDFLAGS $lt_prog_compiler_pic conftest.$OBJEXT >&AC_FD_CC" + if AC_TRY_EVAL(gmp_compile); then + if test "$tmp_underscore" = "_"; then + gmp_cv_asm_x86_got_underscore=yes +@@ -3019,7 +3019,7 @@ int *bar() { return &foo; } + EOF + echo "Test program:" >&AC_FD_CC + cat conftest.c >&AC_FD_CC +-gmp_compile="$CC $CFLAGS $CPPFLAGS -S conftest.c >&AC_FD_CC" ++gmp_compile="$CC $CFLAGS $CPPFLAGS $LDFLAGS -S conftest.c >&AC_FD_CC" + if AC_TRY_EVAL(gmp_compile); then + echo "Compiler output:" >&AC_FD_CC + cat conftest.s >&AC_FD_CC +@@ -3164,7 +3164,7 @@ AC_DEFUN([GMP_C_ATTRIBUTE_MALLOC], + [cat >conftest.c </dev/null; then + gmp_cv_c_attribute_malloc=no +@@ -3279,7 +3279,7 @@ int main(){ + return 0; + }] + EOF +-gmp_compile="$CC $CFLAGS $CPPFLAGS conftest.c -o conftest$EXEEXT >&AC_FD_CC 2>&1" ++gmp_compile="$CC $CFLAGS $CPPFLAGS $LDFLAGS conftest.c -o conftest$EXEEXT >&AC_FD_CC 2>&1" + if AC_TRY_EVAL(gmp_compile); then + cat >conftest.awk <<\EOF + [ +diff --git a/configure b/configure +index 7910aa0..15121e2 100755 +--- a/configure ++++ b/configure +@@ -5885,7 +5885,7 @@ for abi in $abilist; do + choke me + #endif + EOF +-gmp_compile="$cc -c conftest.c >&5" ++gmp_compile="$cc $LDFLAGS -c conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -5978,7 +5978,7 @@ if test "$gmp_prog_cc_works" = yes; then + int main () { return 0; } + EOF + echo "Test compile: " >&5 +- gmp_compile="$cc $cflags $cppflags conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -6032,7 +6032,7 @@ void *f() { return g(); } + int main () { return 0; } + EOF + echo "Test compile: function pointer return" >&5 +- gmp_compile="$cc $cflags $cppflags conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -6088,7 +6088,7 @@ int cmov () { return (n >= 0 ? n : 0); } + int main () { return 0; } + EOF + echo "Test compile: cmov instruction" >&5 +- gmp_compile="$cc $cflags $cppflags conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -6145,7 +6145,7 @@ unsigned long gcc303 () { return (unsigned long) d; } + int main () { return 0; } + EOF + echo "Test compile: double -> ulong conversion" >&5 +- gmp_compile="$cc $cflags $cppflags conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -6200,7 +6200,7 @@ unsigned long fneg () { return -fneg_data; } + int main () { return 0; } + EOF + echo "Test compile: double negation" >&5 +- gmp_compile="$cc $cflags $cppflags conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -6256,7 +6256,7 @@ float ftod () { return (float) ftod_data; } + int main () { return 0; } + EOF + echo "Test compile: double -> float conversion" >&5 +- gmp_compile="$cc $cflags $cppflags conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -6341,7 +6341,7 @@ param_init () + int main () { return 0; } + EOF + echo "Test compile: gnupro alpha ev6 char spilling" >&5 +- gmp_compile="$cc $cflags $cppflags conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -6392,7 +6392,7 @@ if test "$gmp_prog_cc_works" = yes; then + int k; int foo () { __builtin_alloca (k); } + EOF + echo "Test compile: __builtin_alloca availability" >&5 +- gmp_compile="$cc $cflags $cppflags conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -6438,7 +6438,7 @@ int foo () + int main () { return 0; } + EOF + echo "Test compile: alloca array" >&5 +- gmp_compile="$cc $cflags $cppflags conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -6516,7 +6516,7 @@ int f () + int main () { return 0; } + EOF + echo "Test compile: abs int -> double conversion" >&5 +- gmp_compile="$cc $cflags $cppflags conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -6581,7 +6581,7 @@ int dummy; + int main () { return 0; } + EOF + echo "Test compile: long long reliability test 1" >&5 +- gmp_compile="$cc $cflags $cppflags conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -6642,7 +6642,7 @@ int dummy; + int main () { return 0; } + EOF + echo "Test compile: long long reliability test 2" >&5 +- gmp_compile="$cc $cflags $cppflags conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -6703,7 +6703,7 @@ int dummy; + int main () { return 0; } + EOF + echo "Test compile: freebsd hacked gcc" >&5 +- gmp_compile="$cc $cflags $cppflags conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -6802,7 +6802,7 @@ main () + + EOF + echo "Test compile: mpn_lshift_com optimization" >&5 +- gmp_compile="$cc $cflags $cppflags conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -6911,7 +6911,7 @@ main () + + EOF + echo "Test compile: mpn_lshift_com optimization 2" >&5 +- gmp_compile="$cc $cflags $cppflags conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -6970,7 +6970,7 @@ int foo; + int bar () { return foo; } + EOF + tmp_got_emitted=no +-gmp_compile="$cc $cflags $cppflags -fPIC -S conftest.c >&5 2>&1" ++gmp_compile="$cc $cflags $cppflags $LDFLAGS -fPIC -S conftest.c >&5 2>&1" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -7044,7 +7044,7 @@ cat >conftest.s <<\EOF + .byte 254, 220, 186, 152, 118, 84, 50, 16 + EOF + tmp_got_good=yes +-gmp_compile="$cc $cflags $cppflags -fPIC -o conftest.o -c conftest.s >&5 2>&1" ++gmp_compile="$cc $cflags $cppflags $LDFLAGS -fPIC -o conftest.o -c conftest.s >&5 2>&1" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -7094,7 +7094,7 @@ long long bar () { return foo; } + int main () { return 0; } + EOF + gmp_prog_cc_works=no +-gmp_compile="$cc $cflags $cppflags -c conftest.c >&5" ++gmp_compile="$cc $cflags $cppflags $LDFLAGS -c conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -7221,7 +7221,7 @@ result=no + cat >conftest.s <&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -7256,7 +7256,7 @@ main () + } + EOF + gmp_c_testlist_sizeof=no +-gmp_compile="$cc $cflags -c conftest.c >&5" ++gmp_compile="$cc $cflags $LDFLAGS -c conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -7424,7 +7424,7 @@ _main: + xorl %eax, %eax + ret + EOF +- gmp_compile="$cc $cflags $cppflags conftest.s -o conftest >&5" ++ gmp_compile="$cc $cflags $cppflags $LDFLAGS conftest.s -o conftest >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -7489,7 +7489,7 @@ $as_echo_n "checking compiler $cc $cflags -no-cpp-precomp... " >&6; } + cat >conftest.c <&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -7522,7 +7522,7 @@ result=no + cat >conftest.c <&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -7553,7 +7553,7 @@ result=no + cat >conftest.c <&5 +-gmp_compile="$cc $cflags $cppflags -c conftest.c >&5 2>&1" ++gmp_compile="$cc $cflags $cppflags $LDFLAGS -c conftest.c >&5 2>&1" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -7561,7 +7561,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + test $ac_status = 0; }; then : ; + else + # empty fails +- gmp_compile="$cc $cflags $cppflags -Wa,-oldas -c conftest.c >&5 2>&1" ++ gmp_compile="$cc $cflags $cppflags $LDFLAGS -Wa,-oldas -c conftest.c >&5 2>&1" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -7597,7 +7597,7 @@ if test "$gmp_prog_cc_works" = yes; then + int main () { return 0; } + EOF + echo "Test compile: " >&5 +- gmp_compile="$cc $cflags $cppflags $flag conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $flag $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -7651,7 +7651,7 @@ void *f() { return g(); } + int main () { return 0; } + EOF + echo "Test compile: function pointer return" >&5 +- gmp_compile="$cc $cflags $cppflags $flag conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $flag $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -7707,7 +7707,7 @@ int cmov () { return (n >= 0 ? n : 0); } + int main () { return 0; } + EOF + echo "Test compile: cmov instruction" >&5 +- gmp_compile="$cc $cflags $cppflags $flag conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $flag $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -7764,7 +7764,7 @@ unsigned long gcc303 () { return (unsigned long) d; } + int main () { return 0; } + EOF + echo "Test compile: double -> ulong conversion" >&5 +- gmp_compile="$cc $cflags $cppflags $flag conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $flag $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -7819,7 +7819,7 @@ unsigned long fneg () { return -fneg_data; } + int main () { return 0; } + EOF + echo "Test compile: double negation" >&5 +- gmp_compile="$cc $cflags $cppflags $flag conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $flag $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -7875,7 +7875,7 @@ float ftod () { return (float) ftod_data; } + int main () { return 0; } + EOF + echo "Test compile: double -> float conversion" >&5 +- gmp_compile="$cc $cflags $cppflags $flag conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $flag $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -7960,7 +7960,7 @@ param_init () + int main () { return 0; } + EOF + echo "Test compile: gnupro alpha ev6 char spilling" >&5 +- gmp_compile="$cc $cflags $cppflags $flag conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $flag $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -8011,7 +8011,7 @@ if test "$gmp_prog_cc_works" = yes; then + int k; int foo () { __builtin_alloca (k); } + EOF + echo "Test compile: __builtin_alloca availability" >&5 +- gmp_compile="$cc $cflags $cppflags $flag conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $flag $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -8057,7 +8057,7 @@ int foo () + int main () { return 0; } + EOF + echo "Test compile: alloca array" >&5 +- gmp_compile="$cc $cflags $cppflags $flag conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $flag $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -8135,7 +8135,7 @@ int f () + int main () { return 0; } + EOF + echo "Test compile: abs int -> double conversion" >&5 +- gmp_compile="$cc $cflags $cppflags $flag conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $flag $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -8200,7 +8200,7 @@ int dummy; + int main () { return 0; } + EOF + echo "Test compile: long long reliability test 1" >&5 +- gmp_compile="$cc $cflags $cppflags $flag conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $flag $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -8261,7 +8261,7 @@ int dummy; + int main () { return 0; } + EOF + echo "Test compile: long long reliability test 2" >&5 +- gmp_compile="$cc $cflags $cppflags $flag conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $flag $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -8322,7 +8322,7 @@ int dummy; + int main () { return 0; } + EOF + echo "Test compile: freebsd hacked gcc" >&5 +- gmp_compile="$cc $cflags $cppflags $flag conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $flag $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -8421,7 +8421,7 @@ main () + + EOF + echo "Test compile: mpn_lshift_com optimization" >&5 +- gmp_compile="$cc $cflags $cppflags $flag conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $flag $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -8530,7 +8530,7 @@ main () + + EOF + echo "Test compile: mpn_lshift_com optimization 2" >&5 +- gmp_compile="$cc $cflags $cppflags $flag conftest.c >&5" ++ gmp_compile="$cc $cflags $cppflags $flag $LDFLAGS conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -8589,7 +8589,7 @@ int foo; + int bar () { return foo; } + EOF + tmp_got_emitted=no +-gmp_compile="$cc $cflags $cppflags $flag -fPIC -S conftest.c >&5 2>&1" ++gmp_compile="$cc $cflags $cppflags $flag $LDFLAGS -fPIC -S conftest.c >&5 2>&1" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -8663,7 +8663,7 @@ cat >conftest.s <<\EOF + .byte 254, 220, 186, 152, 118, 84, 50, 16 + EOF + tmp_got_good=yes +-gmp_compile="$cc $cflags $cppflags $flag -fPIC -o conftest.o -c conftest.s >&5 2>&1" ++gmp_compile="$cc $cflags $cppflags $flag $LDFLAGS -fPIC -o conftest.o -c conftest.s >&5 2>&1" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -9974,7 +9974,7 @@ main () + return 0; + } + EOF +-gmp_compile="$HOST_CC conftest.c" ++gmp_compile="$HOST_CC $LDFLAGS conftest.c" + cc_for_build_works=no + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 +@@ -10027,7 +10027,7 @@ else + fi + + else +- for i in "$CC" "$CC $CFLAGS $CPPFLAGS" cc gcc c89 c99; do ++ for i in "$CC" "$CC $CFLAGS $CPPFLAGS $LDFLAGS" cc gcc c89 c99; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system compiler $i" >&5 + $as_echo_n "checking build system compiler $i... " >&6; } + # remove anything that might look like compiler output to our "||" expression +@@ -10080,7 +10080,7 @@ else + #define FOO BAR + EOF + echo "Test compile: " >&5 +- gmp_cxxcompile="$CXX $CPPFLAGS $CXXFLAGS conftest.cc >&5" ++ gmp_cxxcompile="$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS conftest.cc >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_cxxcompile\""; } >&5 + (eval $gmp_cxxcompile) 2>&5 + ac_status=$? +@@ -10570,7 +10570,7 @@ using namespace foo; + int main (void) { return 0; } + EOF + echo "Test compile: namespace" >&5 +- gmp_cxxcompile="$CXX $CPPFLAGS $CXXFLAGS conftest.cc >&5" ++ gmp_cxxcompile="$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS conftest.cc >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_cxxcompile\""; } >&5 + (eval $gmp_cxxcompile) 2>&5 + ac_status=$? +@@ -10616,7 +10616,7 @@ void someoutput (void) { std::cout << 123; } + int main (void) { return 0; } + EOF + echo "Test compile: std iostream" >&5 +- gmp_cxxcompile="$CXX $CPPFLAGS $CXXFLAGS conftest.cc >&5" ++ gmp_cxxcompile="$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS conftest.cc >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_cxxcompile\""; } >&5 + (eval $gmp_cxxcompile) 2>&5 + ac_status=$? +@@ -23651,7 +23651,7 @@ else + cat >conftest.c <&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -24421,7 +24421,7 @@ int main(){ + return 0; + } + EOF +-gmp_compile="$CC $CFLAGS $CPPFLAGS conftest.c -o conftest$EXEEXT >&5 2>&1" ++gmp_compile="$CC $CFLAGS $CPPFLAGS $LDFLAGS conftest.c -o conftest$EXEEXT >&5 2>&1" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -25833,7 +25833,7 @@ else + cat >conftest.c <&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -25914,7 +25914,7 @@ const int foo[] = {1,2,3}; + EOF + echo "Test program:" >&5 + cat conftest.c >&5 +-gmp_compile="$CC $CFLAGS $CPPFLAGS -S conftest.c >&5" ++gmp_compile="$CC $CFLAGS $CPPFLAGS $LDFLAGS -S conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -26580,7 +26580,7 @@ int *bar() { return &foo; } + EOF + echo "Test program:" >&5 + cat conftest.c >&5 +-gmp_compile="$CC $CFLAGS $CPPFLAGS -S conftest.c >&5" ++gmp_compile="$CC $CFLAGS $CPPFLAGS $LDFLAGS -S conftest.c >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +@@ -27031,7 +27031,7 @@ for tmp_underscore in "" "_"; do + ${tmp_gsym_prefix}main$gmp_cv_asm_label_suffix + addl $ ${tmp_underscore}_GLOBAL_OFFSET_TABLE_, %ebx + EOF +- gmp_compile="$CCAS $CFLAGS $CPPFLAGS $lt_prog_compiler_pic conftest.s >&5 && $CC $CFLAGS $CPPFLAGS $lt_prog_compiler_pic conftest.$OBJEXT >&5" ++ gmp_compile="$CCAS $CFLAGS $CPPFLAGS $LDFLAGS $lt_prog_compiler_pic conftest.s >&5 && $CC $CFLAGS $CPPFLAGS $LDFLAGS $lt_prog_compiler_pic conftest.$OBJEXT >&5" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5 + (eval $gmp_compile) 2>&5 + ac_status=$? +diff --git a/configure.ac b/configure.ac +index 082077b..f43e1c1 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2272,14 +2272,14 @@ for abi in $abilist; do + instrument) cflags="$cflags -finstrument-functions" ;; + esac + +- GMP_PROG_CC_WORKS($cc $cflags $cppflags,,continue) ++ GMP_PROG_CC_WORKS($cc $cflags $cppflags $LDFLAGS,,continue) + + # If we're supposed to be using a "long long" for a limb, check that + # it works. + eval limb_chosen=\"\$limb$abi1\" + test -n "$limb_chosen" || eval limb_chosen=\"\$limb$abi2\" + if test "$limb_chosen" = longlong; then +- GMP_PROG_CC_WORKS_LONGLONG($cc $cflags $cppflags,,continue) ++ GMP_PROG_CC_WORKS_LONGLONG($cc $cflags $cppflags $LDFLAGS,,continue) + fi + + # The tests to perform on this $cc, if any +@@ -2294,8 +2294,8 @@ for abi in $abilist; do + hpc-hppa-2-0) GMP_HPC_HPPA_2_0($cc,,testlist_pass=no) ;; + gcc-arm-umodsi) GMP_GCC_ARM_UMODSI($cc,,testlist_pass=no) ;; + gcc-mips-o32) GMP_GCC_MIPS_O32($cc,,testlist_pass=no) ;; +- hppa-level-2.0) GMP_HPPA_LEVEL_20($cc $cflags,,testlist_pass=no) ;; +- sizeof*) GMP_C_TEST_SIZEOF($cc $cflags,$tst,,testlist_pass=no) ;; ++ hppa-level-2.0) GMP_HPPA_LEVEL_20($cc $cflags $LDFLAGS,,testlist_pass=no) ;; ++ sizeof*) GMP_C_TEST_SIZEOF($cc $cflags $LDFLAGS,$tst,,testlist_pass=no) ;; + esac + if test $testlist_pass = no; then break; fi + done +@@ -2415,8 +2415,8 @@ if test $found_compiler = yes; then + # pentium4 case. + # + if test "$abi" = 32; then +- GMP_GCC_PENTIUM4_SSE2($cc $cflags $cppflags,, continue) +- GMP_OS_X86_XMM($cc $cflags $cppflags,, continue) ++ GMP_GCC_PENTIUM4_SSE2($cc $cflags $cppflags $LDFLAGS,, continue) ++ GMP_OS_X86_XMM($cc $cflags $cppflags $LDFLAGS,, continue) + fi + ;; + -no-cpp-precomp) +@@ -2429,19 +2429,19 @@ if test $found_compiler = yes; then + -Wa,-m*) + case $host in + alpha*-*-*) +- GMP_GCC_WA_MCPU($cc $cflags, $flag, , [continue]) ++ GMP_GCC_WA_MCPU($cc $cflags $LDFLAGS, $flag, , [continue]) + ;; + esac + ;; + -Wa,-oldas) +- GMP_GCC_WA_OLDAS($cc $cflags $cppflags, ++ GMP_GCC_WA_OLDAS($cc $cflags $cppflags $LDFLAGS, + [cflags="$cflags $flag" + break], + [continue]) + ;; + esac + +- GMP_PROG_CC_WORKS($cc $cflags $cppflags $flag, ++ GMP_PROG_CC_WORKS($cc $cflags $cppflags $flag $LDFLAGS, + [cflags="$cflags $flag" + break]) + done From 061a60814a5a98b8bfa644a2c284d4333affc73c Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Fri, 3 Jan 2025 08:01:47 +0000 Subject: [PATCH 10/15] merge bitcoin#21778: LLD based macOS toolchain --- contrib/containers/ci/Dockerfile | 10 +++-- contrib/devtools/symbol-check.py | 2 +- contrib/devtools/test-security-check.py | 24 ++++------ contrib/guix/libexec/build.sh | 23 +--------- contrib/guix/manifest.scm | 3 +- contrib/macdeploy/README.md | 17 +------ depends/Makefile | 6 +-- depends/builders/darwin.mk | 1 - depends/funcs.mk | 4 +- depends/gen_id | 1 - depends/hosts/darwin.mk | 44 +++++++++++-------- depends/packages/native_cctools.mk | 39 ---------------- depends/packages/native_libtapi.mk | 22 ---------- depends/packages/native_llvm.mk | 9 +++- depends/packages/packages.mk | 1 - depends/packages/qt.mk | 4 +- .../patches/native_libtapi/disable_zlib.patch | 17 ------- depends/patches/qt/mac-qmake.conf | 1 + .../patches/qt/no_warnings_for_symbols.patch | 11 +++++ 19 files changed, 72 insertions(+), 167 deletions(-) delete mode 100644 depends/packages/native_cctools.mk delete mode 100644 depends/packages/native_libtapi.mk delete mode 100644 depends/patches/native_libtapi/disable_zlib.patch create mode 100644 depends/patches/qt/no_warnings_for_symbols.patch diff --git a/contrib/containers/ci/Dockerfile b/contrib/containers/ci/Dockerfile index c8e905fa6c114..a62a6f4d39f19 100644 --- a/contrib/containers/ci/Dockerfile +++ b/contrib/containers/ci/Dockerfile @@ -58,20 +58,24 @@ RUN set -ex; \ ARG LLVM_VERSION=16 RUN set -ex; \ echo "Installing LLVM and Clang ${LLVM_VERSION}..."; \ - curl -sL https://apt.llvm.org/llvm.sh | bash -s "${LLVM_VERSION}"; \ + curl -sL https://apt.llvm.org/llvm.sh | bash -s -- "${LLVM_VERSION}"; \ echo "Installing additional packages..."; \ apt-get update && apt-get install $APT_ARGS \ "clang-format-${LLVM_VERSION}" \ "clang-tidy-${LLVM_VERSION}" \ "libc++-${LLVM_VERSION}-dev" \ "libc++abi-${LLVM_VERSION}-dev" \ - "libclang-rt-${LLVM_VERSION}-dev"; \ + "libclang-rt-${LLVM_VERSION}-dev" \ + "lld-${LLVM_VERSION}"; \ rm -rf /var/lib/apt/lists/*; \ echo "Setting defaults..."; \ lldbUpdAltArgs="update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-${LLVM_VERSION} 100"; \ - for binName in clang clang++ clang-format clang-tidy clangd ld.lld lldb lldb-server; do \ + for binName in clang clang++ clang-format clang-tidy clangd dsymutil lld lldb lldb-server llvm-ar llvm-cov llvm-nm llvm-objdump llvm-ranlib llvm-strip; do \ lldbUpdAltArgs="${lldbUpdAltArgs} --slave /usr/bin/${binName} ${binName} /usr/bin/${binName}-${LLVM_VERSION}"; \ done; \ + for binName in ld64.lld ld.lld lld-link wasm-ld; do \ + lldbUpdAltArgs="${lldbUpdAltArgs} --slave /usr/bin/${binName} ${binName} /usr/bin/lld-${LLVM_VERSION}"; \ + done; \ sh -c "${lldbUpdAltArgs}"; # LD_LIBRARY_PATH is empty by default, this is the first entry ENV LD_LIBRARY_PATH="/usr/lib/llvm-${LLVM_VERSION}/lib" diff --git a/contrib/devtools/symbol-check.py b/contrib/devtools/symbol-check.py index 7c34f59369729..5ac1131684ace 100755 --- a/contrib/devtools/symbol-check.py +++ b/contrib/devtools/symbol-check.py @@ -252,7 +252,7 @@ def check_MACHO_sdk(binary) -> bool: return False def check_MACHO_ld64(binary) -> bool: - if binary.build_version.tools[0].version == [711, 0, 0]: + if binary.build_version.tools[0].version == [17, 0, 6]: return True return False diff --git a/contrib/devtools/test-security-check.py b/contrib/devtools/test-security-check.py index 5b0c606f04d59..ae6dc51b60d87 100755 --- a/contrib/devtools/test-security-check.py +++ b/contrib/devtools/test-security-check.py @@ -121,21 +121,15 @@ def test_MACHO(self): arch = get_arch(cc, source, executable) if arch == lief.ARCHITECTURES.X86: - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-Wl,-allow_stack_execute','-fno-stack-protector', '-Wl,-no_fixup_chains']), - (1, executable+': failed NOUNDEFS Canary FIXUP_CHAINS PIE NX CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-Wl,-allow_stack_execute','-fno-stack-protector', '-Wl,-fixup_chains']), - (1, executable+': failed NOUNDEFS Canary PIE NX CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-Wl,-allow_stack_execute','-fstack-protector-all', '-Wl,-fixup_chains']), - (1, executable+': failed NOUNDEFS PIE NX CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-fstack-protector-all', '-Wl,-fixup_chains']), - (1, executable+': failed NOUNDEFS PIE CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-fstack-protector-all', '-Wl,-fixup_chains']), - (1, executable+': failed PIE CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-fstack-protector-all', '-Wl,-fixup_chains']), - (1, executable+': failed PIE CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-fstack-protector-all', '-fcf-protection=full', '-Wl,-fixup_chains']), - (1, executable+': failed PIE')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-pie','-fstack-protector-all', '-fcf-protection=full', '-Wl,-fixup_chains']), + self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-fno-stack-protector', '-Wl,-no_fixup_chains']), + (1, executable+': failed NOUNDEFS Canary FIXUP_CHAINS PIE CONTROL_FLOW')) + self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-flat_namespace','-fno-stack-protector', '-Wl,-fixup_chains']), + (1, executable+': failed NOUNDEFS Canary CONTROL_FLOW')) + self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-flat_namespace','-fstack-protector-all', '-Wl,-fixup_chains']), + (1, executable+': failed NOUNDEFS CONTROL_FLOW')) + self.assertEqual(call_security_check(cc, source, executable, ['-fstack-protector-all', '-Wl,-fixup_chains']), + (1, executable+': failed CONTROL_FLOW')) + self.assertEqual(call_security_check(cc, source, executable, ['-fstack-protector-all', '-fcf-protection=full', '-Wl,-fixup_chains']), (0, '')) else: # arm64 darwin doesn't support non-PIE binaries, control flow or executable stacks diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh index 4138a08a47785..a63c6b3aea9b8 100755 --- a/contrib/guix/libexec/build.sh +++ b/contrib/guix/libexec/build.sh @@ -135,18 +135,7 @@ for p in "${PATHS[@]}"; do done # Disable Guix ld auto-rpath behavior -case "$HOST" in - *darwin*) - # The auto-rpath behavior is necessary for darwin builds as some native - # tools built by depends refer to and depend on Guix-built native - # libraries - # - # After the native packages in depends are built, the ld wrapper should - # no longer affect our build, as clang would instead reach for - # x86_64-apple-darwin-ld from cctools - ;; - *) export GUIX_LD_WRAPPER_DISABLE_RPATH=yes ;; -esac +export GUIX_LD_WRAPPER_DISABLE_RPATH=yes # Make /usr/bin if it doesn't exist [ -e /usr/bin ] || mkdir -p /usr/bin @@ -175,16 +164,6 @@ esac # Environment variables for determinism export TAR_OPTIONS="--owner=0 --group=0 --numeric-owner --mtime='@${SOURCE_DATE_EPOCH}' --sort=name" export TZ="UTC" -case "$HOST" in - *darwin*) - # cctools AR, unlike GNU binutils AR, does not have a deterministic mode - # or a configure flag to enable determinism by default, it only - # understands if this env-var is set or not. See: - # - # https://github.com/tpoechtrager/cctools-port/blob/55562e4073dea0fbfd0b20e0bf69ffe6390c7f97/cctools/ar/archive.c#L334 - export ZERO_AR_DATE=yes - ;; -esac #################### # Depends Building # diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm index f761bdbabb5d7..36dea3a1a09ce 100644 --- a/contrib/guix/manifest.scm +++ b/contrib/guix/manifest.scm @@ -607,8 +607,9 @@ inspecting signatures in Mach-O binaries.") ((string-contains target "darwin") (list ;; Native GCC 11 toolchain gcc-toolchain-11 - binutils clang-toolchain-17 + lld-17 + (make-lld-wrapper lld-17 #:lld-as-ld? #t) python-signapple zip)) (else '()))))) diff --git a/contrib/macdeploy/README.md b/contrib/macdeploy/README.md index b9a2a6b0240e2..22f989a6b692c 100644 --- a/contrib/macdeploy/README.md +++ b/contrib/macdeploy/README.md @@ -56,28 +56,13 @@ The `sha256sum` should be `c0c2e7bb92c1fee0c4e9f3a485e4530786732d6c6dd9e9f418c28 ## Deterministic macOS App Notes -macOS Applications are created in Linux by combining a recent `clang` and the Apple -`binutils` (`ld`, `ar`, etc). +macOS Applications are created in Linux using a recent LLVM. Apple uses `clang` extensively for development and has upstreamed the necessary functionality so that a vanilla clang can take advantage. It supports the use of `-F`, `-target`, `-mmacosx-version-min`, and `-isysroot`, which are all necessary when building for macOS. -Apple's version of `binutils` (called `cctools`) contains lots of functionality missing in the -FSF's `binutils`. In addition to extra linker options for frameworks and sysroots, several -other tools are needed as well. These do not build under Linux, so they have been patched to -do so. The work here was used as a starting point: [mingwandroid/toolchain4](https://github.com/mingwandroid/toolchain4). - -In order to build a working toolchain, the following source packages are needed from -Apple: `cctools`, `dyld`, and `ld64`. - -These tools inject timestamps by default, which produce non-deterministic binaries. The -`ZERO_AR_DATE` environment variable is used to disable that. - -This version of `cctools` has been patched to use the current version of `clang`'s headers -and its `libLTO.so` rather than those from `llvmgcc`, as it was originally done in `toolchain4`. - To complicate things further, all builds must target an Apple SDK. These SDKs are free to download, but not redistributable. See the SDK Extraction notes above for how to obtain it. diff --git a/depends/Makefile b/depends/Makefile index cc9a249b9e896..90a91201adffe 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -178,7 +178,6 @@ all_packages = $(packages) $(native_packages) meta_depends = Makefile config.guess config.sub 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 @@ -210,9 +209,8 @@ $(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages) # tool needs to be available in $PATH at all times. # # 2. If the tool is _**not**_ expected to be available in $PATH at all times -# (such as is the case for our native_cctools binutils tools), it needs to -# be referred to by its absolute path, such as would be output by the -# AC_PATH_{PROG,TOOL} macros. +# it needs to be referred to by its absolute path, such as would be output +# by the AC_PATH_{PROG,TOOL} macros. # # Minor note: it is also okay to refer to tools by their absolute path even if # we expect them to be available in $PATH at all times, more specificity does diff --git a/depends/builders/darwin.mk b/depends/builders/darwin.mk index be04e1d8f3fc8..d84c23ed44b5f 100644 --- a/depends/builders/darwin.mk +++ b/depends/builders/darwin.mk @@ -18,7 +18,6 @@ darwin_STRIP:=$(shell xcrun -f strip) darwin_OBJDUMP:=$(shell xcrun -f objdump) darwin_NM:=$(shell xcrun -f nm) darwin_DSYMUTIL:=$(shell xcrun -f dsymutil) -darwin_native_binutils= darwin_native_toolchain= x86_64_darwin_CFLAGS += -arch x86_64 diff --git a/depends/funcs.mk b/depends/funcs.mk index d51329cdc4b0c..23d844786ff58 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -46,7 +46,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_toolchain) $($(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))) @@ -299,4 +299,4 @@ $(foreach package,$(all_packages),$(eval $(call int_config_attach_build_config,$ $(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) )) +$(foreach package,$(packages),$(eval $($(package)_extracted): |$($($(host_arch)_$(host_os)_native_toolchain)_cached) )) diff --git a/depends/gen_id b/depends/gen_id index a0cd5864616c0..83bc308542f4f 100755 --- a/depends/gen_id +++ b/depends/gen_id @@ -50,7 +50,6 @@ echo "BEGIN AR" bash -c "${AR} --version" env | grep '^AR_' - echo "ZERO_AR_DATE=${ZERO_AR_DATE}" echo "END AR" echo "BEGIN RANLIB" diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index 7f717d1eacdef..a64008d6aa786 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -6,24 +6,28 @@ LD64_VERSION=711 OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-libcxx-headers -darwin_native_binutils=native_cctools - -cctools_TOOLS=AR RANLIB STRIP NM - 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 -darwin_native_toolchain=native_cctools - -cctools_TOOLS+=" DSYMUTIL" +darwin_native_toolchain=native_llvm 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 @@ -44,18 +48,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 -# 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 @@ -65,7 +65,7 @@ $(foreach TOOL,$(cctools_TOOLS),$(eval darwin_$(TOOL) = $$(build_prefix)/bin/$$( # # -B$(build_prefix)/bin # -# Explicitly point to our binaries (e.g. cctools) so that they are +# Explicitly point to our binaries so that they are # ensured to be found and preferred over other possibilities. # # -isysroot$(OSX_SDK) -nostdlibinc @@ -82,6 +82,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 \ @@ -107,6 +112,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 -fuse-ld=lld endif darwin_release_CFLAGS=-O2 diff --git a/depends/packages/native_cctools.mk b/depends/packages/native_cctools.mk deleted file mode 100644 index 3148e51048c5c..0000000000000 --- a/depends/packages/native_cctools.mk +++ /dev/null @@ -1,39 +0,0 @@ -package=native_cctools -$(package)_version=c74fafe86076713cb8e6f937af43b6df6da1f42d -$(package)_download_path=https://github.com/tpoechtrager/cctools-port/archive -$(package)_file_name=$($(package)_version).tar.gz -$(package)_sha256_hash=e2c1588d505a69c32e079f4e616e0f117d5478429040e394f624f43f2796e6bc -$(package)_build_subdir=cctools -$(package)_dependencies=native_libtapi - -define $(package)_set_vars - $(package)_config_opts=--target=$(host) --enable-lto-support - $(package)_config_opts+=--with-llvm-config=$(llvm_config_prog) - $(package)_ldflags+=-Wl,-rpath=\\$$$$$$$$\$$$$$$$$ORIGIN/../lib - $(package)_cc=$(clang_prog) - $(package)_cxx=$(clangxx_prog) -endef - -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/ -endef -else -endif - -define $(package)_config_cmds - $($(package)_autoconf) -endef - -define $(package)_build_cmds - $(MAKE) -endef - -define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) install -endef - -define $(package)_postprocess_cmds - rm -rf share -endef diff --git a/depends/packages/native_libtapi.mk b/depends/packages/native_libtapi.mk deleted file mode 100644 index fb5ab0b4dccc6..0000000000000 --- a/depends/packages/native_libtapi.mk +++ /dev/null @@ -1,22 +0,0 @@ -package=native_libtapi -$(package)_version=eb33a59f2e30ff9724dc1ea8bee8b5229b0557c9 -$(package)_download_path=https://github.com/tpoechtrager/apple-libtapi/archive -$(package)_file_name=$($(package)_version).tar.gz -$(package)_sha256_hash=d4d46c64622f13d6938cecf989046d9561011bb59e8ee835f8f39825d67f578f -$(package)_patches=disable_zlib.patch - -ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) -$(package)_dependencies=native_llvm -endif - -define $(package)_preprocess_cmds - patch -p1 < $($(package)_patch_dir)/disable_zlib.patch -endef - -define $(package)_build_cmds - CC=$(clang_prog) CXX=$(clangxx_prog) INSTALLPREFIX=$($(package)_staging_prefix_dir) ./build.sh -endef - -define $(package)_stage_cmds - ./install.sh -endef diff --git a/depends/packages/native_llvm.mk b/depends/packages/native_llvm.mk index 1953c91bf4277..c701147edc8b9 100644 --- a/depends/packages/native_llvm.mk +++ b/depends/packages/native_llvm.mk @@ -16,9 +16,14 @@ 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/ld64.lld $($(package)_staging_prefix_dir)/bin/ld64.lld && \ + 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/packages.mk b/depends/packages/packages.mk index 1adbb116cc5fd..7bf762a334326 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -27,7 +27,6 @@ usdt_linux_packages=systemtap darwin_native_packages = ifneq ($(build_os),darwin) -darwin_native_packages += native_cctools native_libtapi ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) darwin_native_packages+= native_llvm diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 6cb6e53ed74e5..67d6b812b7f71 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -15,6 +15,7 @@ $(package)_patches += no-xlib.patch $(package)_patches += fix_android_jni_static.patch $(package)_patches += dont_hardcode_pwd.patch $(package)_patches += qtbase-moc-ignore-gcc-macro.patch +$(package)_patches += no_warnings_for_symbols.patch $(package)_patches += rcc_hardcode_timestamp.patch $(package)_patches += duplicate_lcqpafonts.patch $(package)_patches += guix_cross_lib_path.patch @@ -138,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 @@ -248,6 +249,7 @@ define $(package)_preprocess_cmds patch -p1 -i $($(package)_patch_dir)/no-xlib.patch && \ patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \ patch -p1 -i $($(package)_patch_dir)/memory_resource.patch && \ + patch -p1 -i $($(package)_patch_dir)/no_warnings_for_symbols.patch && \ patch -p1 -i $($(package)_patch_dir)/clang_18_libpng.patch && \ patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \ patch -p1 -i $($(package)_patch_dir)/duplicate_lcqpafonts.patch && \ diff --git a/depends/patches/native_libtapi/disable_zlib.patch b/depends/patches/native_libtapi/disable_zlib.patch deleted file mode 100644 index 6c7691214aa84..0000000000000 --- a/depends/patches/native_libtapi/disable_zlib.patch +++ /dev/null @@ -1,17 +0,0 @@ -build: disable zlib - -This isn't needed, and causes issues when clang-tblgen -is built, but trys to reach for a system libz.so. - -diff --git a/build.sh b/build.sh -index e25d2f732..ec8422621 100755 ---- a/build.sh -+++ b/build.sh -@@ -66,6 +66,7 @@ cmake ../src/llvm \ - -DCMAKE_INSTALL_PREFIX=$INSTALLPREFIX \ - -DTAPI_REPOSITORY_STRING=$TAPI_VERSION \ - -DTAPI_FULL_VERSION=$TAPI_VERSION \ -+ -DLLVM_ENABLE_ZLIB=OFF \ - $CMAKE_EXTRA_ARGS - - echo "" diff --git a/depends/patches/qt/mac-qmake.conf b/depends/patches/qt/mac-qmake.conf index cb94bf07b42d8..a29db20004bbe 100644 --- a/depends/patches/qt/mac-qmake.conf +++ b/depends/patches/qt/mac-qmake.conf @@ -13,6 +13,7 @@ QMAKE_MAC_SDK.macosx.Path = $${MAC_SDK_PATH} QMAKE_MAC_SDK.macosx.platform_name = macosx QMAKE_MAC_SDK.macosx.SDKVersion = $${MAC_SDK_VERSION} QMAKE_MAC_SDK.macosx.PlatformPath = /phony +QMAKE_CXXFLAGS += -fuse-ld=lld !host_build: QMAKE_CFLAGS += -target $${MAC_TARGET} !host_build: QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_CFLAGS !host_build: QMAKE_CXXFLAGS += -target $${MAC_TARGET} diff --git a/depends/patches/qt/no_warnings_for_symbols.patch b/depends/patches/qt/no_warnings_for_symbols.patch new file mode 100644 index 0000000000000..11cdc599ed3d6 --- /dev/null +++ b/depends/patches/qt/no_warnings_for_symbols.patch @@ -0,0 +1,11 @@ +--- a/qtbase/mkspecs/features/mac/no_warn_empty_obj_files.prf ++++ b/qtbase/mkspecs/features/mac/no_warn_empty_obj_files.prf +@@ -1,7 +1,7 @@ + # Prevent warnings about object files without any symbols. This is a common + # thing in Qt as we tend to build files unconditionally, and then use ifdefs + # to compile out parts that are not relevant. +-QMAKE_RANLIB += -no_warning_for_no_symbols ++# QMAKE_RANLIB += -no_warning_for_no_symbols + + # We have to tell 'ar' to not run ranlib by itself + QMAKE_AR += -S From 7e7d7bd6f7c4235188aab8e9732a07778554bb2f Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Mon, 4 Nov 2024 14:38:58 +0000 Subject: [PATCH 11/15] merge bitcoin#30204: consolidate dependency docs --- depends/README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/depends/README.md b/depends/README.md index 57d82518a08de..977910f67e974 100644 --- a/depends/README.md +++ b/depends/README.md @@ -45,9 +45,13 @@ The paths are automatically configured and no other options are needed unless ta ### Install the required dependencies: Ubuntu & Debian +#### Common + + apt install automake bison cmake curl libtool make patch pkg-config python3 xz-utils + #### For macOS cross compilation - sudo apt-get install curl bsdmainutils cmake zip + sudo apt-get install g++ zip Note: You must obtain the macOS SDK before proceeding with a cross-compile. Under the depends directory, create a subdirectory named `SDKs`. @@ -62,7 +66,7 @@ For more information, see [SDK Extraction](../contrib/macdeploy/README.md#sdk-ex Common linux dependencies: - sudo apt-get install make automake curl g++-multilib libtool binutils bsdmainutils pkg-config python3 patch bison + sudo apt-get install g++-multilib binutils For linux ARM cross compilation: From 994e7b1a850d409b47baeef886119fce0cbebd5b Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:40:42 +0000 Subject: [PATCH 12/15] merge bitcoin#29765: Use clang-18 --- ci/test/00_setup_env_native_fuzz.sh | 2 +- ci/test/00_setup_env_native_fuzz_with_valgrind.sh | 2 +- ci/test/00_setup_env_native_multiprocess.sh | 2 +- ci/test/00_setup_env_native_tsan.sh | 6 +++--- ci/test/00_setup_env_native_ubsan.sh | 4 ++-- ci/test/00_setup_env_native_valgrind.sh | 2 +- contrib/containers/ci/Dockerfile | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ci/test/00_setup_env_native_fuzz.sh b/ci/test/00_setup_env_native_fuzz.sh index 2ba78325ff16c..d1bb30d1991c9 100755 --- a/ci/test/00_setup_env_native_fuzz.sh +++ b/ci/test/00_setup_env_native_fuzz.sh @@ -16,4 +16,4 @@ export RUN_UNIT_TESTS=false export RUN_FUNCTIONAL_TESTS=false export RUN_FUZZ_TESTS=true export GOAL="install" -export BITCOIN_CONFIG="--enable-zmq --disable-ccache --enable-fuzz --with-sanitizers=fuzzer,address,undefined,integer --enable-suppress-external-warnings CC=clang-16 CXX=clang++-16 --with-boost-process" +export BITCOIN_CONFIG="--enable-zmq --disable-ccache --enable-fuzz --with-sanitizers=fuzzer,address,undefined,integer --enable-suppress-external-warnings CC=clang-18 CXX=clang++-18 --with-boost-process" diff --git a/ci/test/00_setup_env_native_fuzz_with_valgrind.sh b/ci/test/00_setup_env_native_fuzz_with_valgrind.sh index b5c6b60b4a73a..9860123546744 100755 --- a/ci/test/00_setup_env_native_fuzz_with_valgrind.sh +++ b/ci/test/00_setup_env_native_fuzz_with_valgrind.sh @@ -14,4 +14,4 @@ export RUN_FUNCTIONAL_TESTS=false export RUN_FUZZ_TESTS=true export FUZZ_TESTS_CONFIG="--valgrind" export GOAL="install" -export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer --enable-suppress-external-warnings CC=clang-16 CXX=clang++-16" +export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer --enable-suppress-external-warnings CC=clang-18 CXX=clang++-18" diff --git a/ci/test/00_setup_env_native_multiprocess.sh b/ci/test/00_setup_env_native_multiprocess.sh index d23fae22b51ff..04d1b1df55f99 100755 --- a/ci/test/00_setup_env_native_multiprocess.sh +++ b/ci/test/00_setup_env_native_multiprocess.sh @@ -11,5 +11,5 @@ export PACKAGES="cmake python3 llvm clang" export DEP_OPTS="DEBUG=1 MULTIPROCESS=1" export GOAL="install" export TEST_RUNNER_EXTRA="--v2transport" -export BITCOIN_CONFIG="--with-boost-process --enable-debug CC=clang-16 CXX=clang++-16" # Use clang to avoid OOM +export BITCOIN_CONFIG="--with-boost-process --enable-debug CC=clang-18 CXX=clang++-18" # Use clang to avoid OOM export BITCOIND=dash-node # Used in functional tests diff --git a/ci/test/00_setup_env_native_tsan.sh b/ci/test/00_setup_env_native_tsan.sh index add809a28c379..7e6ce2b7fa905 100755 --- a/ci/test/00_setup_env_native_tsan.sh +++ b/ci/test/00_setup_env_native_tsan.sh @@ -7,11 +7,11 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_native_tsan -export PACKAGES="clang-16 llvm-16 libclang-rt-16-dev libc++abi-16-dev libc++-16-dev python3-zmq" -export DEP_OPTS="CC=clang-16 CXX='clang++-16 -stdlib=libc++'" +export PACKAGES="clang-18 llvm-18 libclang-rt-18-dev libc++abi-18-dev libc++-18-dev python3-zmq" +export DEP_OPTS="CC=clang-18 CXX='clang++-18 -stdlib=libc++'" export TEST_RUNNER_EXTRA="--extended --exclude feature_pruning,feature_dbcrash,wallet_multiwallet.py" # Temporarily suppress ASan heap-use-after-free (see issue #14163) export TEST_RUNNER_EXTRA="${TEST_RUNNER_EXTRA} --timeout-factor=4" # Increase timeout because sanitizers slow down export GOAL="install" -export BITCOIN_CONFIG="--enable-zmq --with-gui=no --with-sanitizers=thread CC=clang-16 CXX=clang++-16 CXXFLAGS='-g' --with-boost-process" +export BITCOIN_CONFIG="--enable-zmq --with-gui=no --with-sanitizers=thread CC=clang-18 CXX=clang++-18 CXXFLAGS='-g' --with-boost-process" export CPPFLAGS="-DARENA_DEBUG -DDEBUG_LOCKORDER -DDEBUG_LOCKCONTENTION" export PYZMQ=true diff --git a/ci/test/00_setup_env_native_ubsan.sh b/ci/test/00_setup_env_native_ubsan.sh index 3d44490a4f102..9fb440dfd41e2 100755 --- a/ci/test/00_setup_env_native_ubsan.sh +++ b/ci/test/00_setup_env_native_ubsan.sh @@ -8,8 +8,8 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_native_ubsan -export PACKAGES="clang-16 llvm-16 python3-zmq qtbase5-dev qttools5-dev-tools libevent-dev bsdmainutils libboost-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libqrencode-dev" +export PACKAGES="clang-18 llvm-18 python3-zmq qtbase5-dev qttools5-dev-tools libevent-dev bsdmainutils libboost-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libqrencode-dev" export DEP_OPTS="NO_UPNP=1 DEBUG=1" export GOAL="install" -export BITCOIN_CONFIG="--enable-zmq --enable-reduce-exports --enable-crash-hooks --with-sanitizers=undefined CC=clang-16 CXX=clang++-16" +export BITCOIN_CONFIG="--enable-zmq --enable-reduce-exports --enable-crash-hooks --with-sanitizers=undefined CC=clang-18 CXX=clang++-18" export PYZMQ=true diff --git a/ci/test/00_setup_env_native_valgrind.sh b/ci/test/00_setup_env_native_valgrind.sh index 2703963a05549..b0793313fb1a5 100755 --- a/ci/test/00_setup_env_native_valgrind.sh +++ b/ci/test/00_setup_env_native_valgrind.sh @@ -11,4 +11,4 @@ export USE_VALGRIND=1 export NO_DEPENDS=1 export TEST_RUNNER_EXTRA="--exclude rpc_bind --timeout-factor=4" # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547 export GOAL="install" -export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=no --enable-suppress-external-warnings CC=clang-16 CXX=clang++-16" # TODO enable GUI +export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=no --enable-suppress-external-warnings CC=clang-18 CXX=clang++-18" # TODO enable GUI diff --git a/contrib/containers/ci/Dockerfile b/contrib/containers/ci/Dockerfile index a62a6f4d39f19..6312faade4bdc 100644 --- a/contrib/containers/ci/Dockerfile +++ b/contrib/containers/ci/Dockerfile @@ -55,7 +55,7 @@ RUN set -ex; \ # Install Clang+LLVM and set it as default # We don't need all packages but the default set doesn't include some # packages we want so we will need to install some of them manually. -ARG LLVM_VERSION=16 +ARG LLVM_VERSION=18 RUN set -ex; \ echo "Installing LLVM and Clang ${LLVM_VERSION}..."; \ curl -sL https://apt.llvm.org/llvm.sh | bash -s -- "${LLVM_VERSION}"; \ From 632b8b43dddf8f0c34c5a0c379c54829422727f2 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Thu, 2 May 2024 15:57:43 +0800 Subject: [PATCH 13/15] merge bitcoin#30201: remove `FORCE_USE_SYSTEM_CLANG` --- ci/test/00_setup_env_mac.sh | 2 +- contrib/devtools/symbol-check.py | 6 ++--- contrib/guix/libexec/build.sh | 3 +-- contrib/guix/manifest.scm | 6 ++--- depends/Makefile | 2 -- depends/README.md | 11 +++----- depends/builders/darwin.mk | 1 - depends/funcs.mk | 5 +--- depends/hosts/darwin.mk | 46 +++----------------------------- depends/packages/native_llvm.mk | 31 --------------------- depends/packages/packages.mk | 10 ------- 11 files changed, 16 insertions(+), 107 deletions(-) delete mode 100644 depends/packages/native_llvm.mk diff --git a/ci/test/00_setup_env_mac.sh b/ci/test/00_setup_env_mac.sh index 654a67e45e870..3764caa0debe1 100755 --- a/ci/test/00_setup_env_mac.sh +++ b/ci/test/00_setup_env_mac.sh @@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_macos_cross export HOST=x86_64-apple-darwin -export PACKAGES="cmake zip" +export PACKAGES="clang cmake lld llvm zip" export XCODE_VERSION=15.0 export XCODE_BUILD_ID=15A240d export RUN_UNIT_TESTS=false diff --git a/contrib/devtools/symbol-check.py b/contrib/devtools/symbol-check.py index 5ac1131684ace..f4b6847a94f54 100755 --- a/contrib/devtools/symbol-check.py +++ b/contrib/devtools/symbol-check.py @@ -251,8 +251,8 @@ def check_MACHO_sdk(binary) -> bool: return True return False -def check_MACHO_ld64(binary) -> bool: - if binary.build_version.tools[0].version == [17, 0, 6]: +def check_MACHO_lld(binary) -> bool: + if binary.build_version.tools[0].version == [18, 1, 6]: return True return False @@ -295,7 +295,7 @@ def check_ELF_ABI(binary) -> bool: ('DYNAMIC_LIBRARIES', check_MACHO_libraries), ('MIN_OS', check_MACHO_min_os), ('SDK', check_MACHO_sdk), - ('LD64', check_MACHO_ld64), + ('LLD', check_MACHO_lld), ], lief.EXE_FORMATS.PE: [ ('DYNAMIC_LIBRARIES', check_PE_libraries), diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh index a63c6b3aea9b8..ea1d5079ee3d7 100755 --- a/contrib/guix/libexec/build.sh +++ b/contrib/guix/libexec/build.sh @@ -180,8 +180,7 @@ make -C depends --jobs="$JOBS" HOST="$HOST" \ x86_64_linux_AR=x86_64-linux-gnu-gcc-ar \ x86_64_linux_RANLIB=x86_64-linux-gnu-gcc-ranlib \ x86_64_linux_NM=x86_64-linux-gnu-gcc-nm \ - x86_64_linux_STRIP=x86_64-linux-gnu-strip \ - FORCE_USE_SYSTEM_CLANG=1 + x86_64_linux_STRIP=x86_64-linux-gnu-strip ########################### diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm index 36dea3a1a09ce..b5f44fae2765b 100644 --- a/contrib/guix/manifest.scm +++ b/contrib/guix/manifest.scm @@ -607,9 +607,9 @@ inspecting signatures in Mach-O binaries.") ((string-contains target "darwin") (list ;; Native GCC 11 toolchain gcc-toolchain-11 - clang-toolchain-17 - lld-17 - (make-lld-wrapper lld-17 #:lld-as-ld? #t) + clang-toolchain-18 + lld-18 + (make-lld-wrapper lld-18 #:lld-as-ld? #t) python-signapple zip)) (else '()))))) diff --git a/depends/Makefile b/depends/Makefile index 90a91201adffe..8583521f3f75e 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -178,8 +178,6 @@ all_packages = $(packages) $(native_packages) meta_depends = Makefile config.guess config.sub funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk -$(host_arch)_$(host_os)_native_toolchain?=$($(host_os)_native_toolchain) - include funcs.mk final_build_id_long+=$(shell $(build_SHA256SUM) config.site.in) diff --git a/depends/README.md b/depends/README.md index 977910f67e974..59fb62b24d77a 100644 --- a/depends/README.md +++ b/depends/README.md @@ -51,11 +51,11 @@ The paths are automatically configured and no other options are needed unless ta #### For macOS cross compilation - sudo apt-get install g++ zip + apt install clang lld llvm g++ zip -Note: You must obtain the macOS SDK before proceeding with a cross-compile. -Under the depends directory, create a subdirectory named `SDKs`. -Then, place the extracted SDK under this new directory. +Clang 18 or later is required. You must also obtain the macOS SDK before +proceeding with a cross-compile. Under the depends directory, create a +subdirectory named `SDKs`. Then, place the extracted SDK under this new directory. For more information, see [SDK Extraction](../contrib/macdeploy/README.md#sdk-extraction). #### For Win64 cross compilation @@ -124,9 +124,6 @@ The following can be set when running make: `make FOO=bar` - `DEBUG`: Disable some optimizations and enable more runtime checking - `HOST_ID_SALT`: Optional salt to use when generating host package ids - `BUILD_ID_SALT`: Optional salt to use when generating build package ids -- `FORCE_USE_SYSTEM_CLANG`: (EXPERTS ONLY) When cross-compiling for macOS, use Clang found in the - system's `$PATH` rather than the default prebuilt release of Clang - from llvm.org. Clang 8 or later is required - `LOG`: Use file-based logging for individual packages. During a package build its log file resides in the `depends` directory, and the log file is printed out automatically in case of build error. After successful build log files are moved along with package archives diff --git a/depends/builders/darwin.mk b/depends/builders/darwin.mk index d84c23ed44b5f..2b59353e84f31 100644 --- a/depends/builders/darwin.mk +++ b/depends/builders/darwin.mk @@ -18,7 +18,6 @@ darwin_STRIP:=$(shell xcrun -f strip) darwin_OBJDUMP:=$(shell xcrun -f objdump) darwin_NM:=$(shell xcrun -f nm) darwin_DSYMUTIL:=$(shell xcrun -f dsymutil) -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 23d844786ff58..aeaff2288b1b2 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -46,7 +46,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)_dependencies))) +$(eval $(1)_all_dependencies:=$(call int_get_all_dependencies,$(1),$($(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))) @@ -297,6 +297,3 @@ $(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) )) diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index a64008d6aa786..f2e9abdf373f6 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -2,39 +2,10 @@ OSX_MIN_VERSION=11.0 OSX_SDK_VERSION=14.0 XCODE_VERSION=15.0 XCODE_BUILD_ID=15A240d -LD64_VERSION=711 +LLD_VERSION=711 OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-libcxx-headers -ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) -# FORCE_USE_SYSTEM_CLANG is empty, so we use our depends-managed, pinned LLVM -# from llvm.org - -darwin_native_toolchain=native_llvm - -clang_prog=$(build_prefix)/bin/clang -clangxx_prog=$(clang_prog)++ -llvm_config_prog=$(build_prefix)/bin/llvm-config - -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 -# system - -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 # prior to 1af314465e5dfe3e8baa839a32a72e83c04f26ef, first released in v4.2.90. @@ -44,9 +15,6 @@ darwin_native_toolchain= # Source: https://lists.gnu.org/archive/html/bug-make/2017-11/msg00017.html clang_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang") clangxx_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang++") -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") @@ -54,7 +22,6 @@ 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 # Flag explanations: # @@ -63,11 +30,6 @@ endif # Ensures that modern linker features are enabled. See here for more # details: https://github.com/bitcoin/bitcoin/pull/19407. # -# -B$(build_prefix)/bin -# -# Explicitly point to our binaries so that they are -# ensured to be found and preferred over other possibilities. -# # -isysroot$(OSX_SDK) -nostdlibinc # # Disable default include paths built into the compiler as well as @@ -92,7 +54,6 @@ darwin_CC=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \ -u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \ -u LIBRARY_PATH \ $(clang_prog) --target=$(host) \ - -B$(build_prefix)/bin \ -isysroot$(OSX_SDK) -nostdlibinc \ -iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks @@ -100,7 +61,6 @@ darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \ -u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \ -u LIBRARY_PATH \ $(clangxx_prog) --target=$(host) \ - -B$(build_prefix)/bin \ -isysroot$(OSX_SDK) -nostdlibinc \ -iwithsysroot/usr/include/c++/v1 \ -iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks @@ -110,8 +70,8 @@ darwin_CXXFLAGS=-pipe -std=$(CXX_STANDARD) -mmacosx-version-min=$(OSX_MIN_VERSIO 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_CFLAGS += -mlinker-version=$(LLD_VERSION) +darwin_CXXFLAGS += -mlinker-version=$(LLD_VERSION) darwin_LDFLAGS += -Wl,-no_adhoc_codesign -fuse-ld=lld endif diff --git a/depends/packages/native_llvm.mk b/depends/packages/native_llvm.mk deleted file mode 100644 index c701147edc8b9..0000000000000 --- a/depends/packages/native_llvm.mk +++ /dev/null @@ -1,31 +0,0 @@ -package=native_llvm -$(package)_version=17.0.6 -$(package)_major_version=$(firstword $(subst ., ,$($(package)_version))) -$(package)_download_path=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version) -ifneq (,$(findstring aarch64,$(BUILD))) -$(package)_file_name=clang+llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz -$(package)_sha256_hash=6dd62762285326f223f40b8e4f2864b5c372de3f7de0731cb7cd55ca5287b75a -else -$(package)_file_name=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-22.04.tar.xz -$(package)_sha256_hash=884ee67d647d77e58740c1e645649e29ae9e8a6fe87c1376be0f3a30f3cc9ab3 -endif - -define $(package)_stage_cmds - mkdir -p $($(package)_staging_prefix_dir)/lib/clang/$($(package)_major_version)/include && \ - mkdir -p $($(package)_staging_prefix_dir)/bin && \ - 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/dsymutil && \ - cp bin/ld64.lld $($(package)_staging_prefix_dir)/bin/ld64.lld && \ - cp bin/llvm-ar $($(package)_staging_prefix_dir)/bin/llvm-ar && \ - cp bin/llvm-config $($(package)_staging_prefix_dir)/bin/ && \ - 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/ && \ - cp -r lib/clang/$($(package)_major_version)/include/* $($(package)_staging_prefix_dir)/lib/clang/$($(package)_major_version)/include/ -endef diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 7bf762a334326..ea64a497dd4ef 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -23,13 +23,3 @@ multiprocess_packages = libmultiprocess capnp multiprocess_native_packages = native_libmultiprocess native_capnp usdt_linux_packages=systemtap - -darwin_native_packages = - -ifneq ($(build_os),darwin) - -ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) -darwin_native_packages+= native_llvm -endif - -endif From cc5c30ec0521c978faba152a6abcbb9411953883 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Thu, 13 Jun 2024 16:34:10 +0100 Subject: [PATCH 14/15] merge bitcoin#30287: rewrite some docs & swap `mmacosx-version-min` for `mmacos-version-min` --- contrib/macdeploy/README.md | 34 +++++++++++++--------------------- depends/hosts/darwin.mk | 4 ++-- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/contrib/macdeploy/README.md b/contrib/macdeploy/README.md index 22f989a6b692c..cf32a07602d3b 100644 --- a/contrib/macdeploy/README.md +++ b/contrib/macdeploy/README.md @@ -56,31 +56,23 @@ The `sha256sum` should be `c0c2e7bb92c1fee0c4e9f3a485e4530786732d6c6dd9e9f418c28 ## Deterministic macOS App Notes -macOS Applications are created in Linux using a recent LLVM. +macOS Applications are created on Linux using a recent LLVM. -Apple uses `clang` extensively for development and has upstreamed the necessary -functionality so that a vanilla clang can take advantage. It supports the use of `-F`, -`-target`, `-mmacosx-version-min`, and `-isysroot`, which are all necessary when -building for macOS. +All builds must target an Apple SDK. These SDKs are free to download, but not redistributable. +See the SDK Extraction notes above for how to obtain it. -To complicate things further, all builds must target an Apple SDK. These SDKs are free to -download, but not redistributable. See the SDK Extraction notes above for how to obtain it. +The Guix build process has been designed to avoid including the SDK's files in Guix's outputs. +All interim tarballs are fully deterministic and may be freely redistributed. -The Guix process builds 2 sets of files: Linux tools, then Apple binaries which are -created using these tools. The build process has been designed to avoid including the -SDK's files in Guix's outputs. All interim tarballs are fully deterministic and may be freely -redistributed. - -As of OS X 10.9 Mavericks, using an Apple-blessed key to sign binaries is a requirement in -order to satisfy the new Gatekeeper requirements. Because this private key cannot be -shared, we'll have to be a bit creative in order for the build process to remain somewhat -deterministic. Here's how it works: +Using an Apple-blessed key to sign binaries is a requirement to produce (distributable) macOS +binaries. Because this private key cannot be shared, we'll have to be a bit creative in order +for the build process to remain somewhat deterministic. Here's how it works: - Builders use Guix to create an unsigned release. This outputs an unsigned ZIP which - users may choose to bless and run. It also outputs an unsigned app structure in the form - of a tarball. + users may choose to bless, self-codesign, and run. It also outputs an unsigned app structure + in the form of a tarball. - The Apple keyholder uses this unsigned app to create a detached signature, using the - script that is also included there. Detached signatures are available from this [repository](https://github.com/dashpay/dash-detached-sigs). + included script. Detached signatures are available from this [repository](https://github.com/dashpay/dash-detached-sigs). -- Builders feed the unsigned app + detached signature back into Guix. It uses the - pre-built tools to recombine the pieces into a deterministic ZIP. +- Builders feed the unsigned app + detached signature back into Guix, which combines the + pieces into a deterministic ZIP. diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index f2e9abdf373f6..564381d1e9308 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -65,8 +65,8 @@ darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \ -iwithsysroot/usr/include/c++/v1 \ -iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks -darwin_CFLAGS=-pipe -std=$(C_STANDARD) -mmacosx-version-min=$(OSX_MIN_VERSION) -darwin_CXXFLAGS=-pipe -std=$(CXX_STANDARD) -mmacosx-version-min=$(OSX_MIN_VERSION) +darwin_CFLAGS=-pipe -std=$(C_STANDARD) -mmacos-version-min=$(OSX_MIN_VERSION) +darwin_CXXFLAGS=-pipe -std=$(CXX_STANDARD) -mmacos-version-min=$(OSX_MIN_VERSION) darwin_LDFLAGS=-Wl,-platform_version,macos,$(OSX_MIN_VERSION),$(OSX_SDK_VERSION) ifneq ($(build_os),darwin) From ee04e1f5e96fd45b6eee5f03d071926d62391bab Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Tue, 23 Jul 2024 12:19:54 +0100 Subject: [PATCH 15/15] merge bitcoin#30511: GCC 12 consolidation includes: - 8b41ede55ebbc6978deb3f4fad5e18b76b372506 continuation of cfc6cba4 in dash#6383 --- contrib/guix/manifest.scm | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm index b5f44fae2765b..789792f554fab 100644 --- a/contrib/guix/manifest.scm +++ b/contrib/guix/manifest.scm @@ -577,6 +577,7 @@ inspecting signatures in Mach-O binaries.") gzip xz ;; Build tools + gcc-toolchain-12 cmake-minimal gnu-make libtool @@ -592,22 +593,16 @@ inspecting signatures in Mach-O binaries.") python-lief) (let ((target (getenv "HOST"))) (cond ((string-suffix? "-mingw32" target) - (list ;; Native GCC 12 toolchain - gcc-toolchain-12 - zip + (list zip (make-mingw-pthreads-cross-toolchain "x86_64-w64-mingw32") nsis-x86_64 nss-certs osslsigncode)) ((string-contains target "-linux-") - (list ;; Native GCC 12 toolchain - gcc-toolchain-12 - (list gcc-toolchain-12 "static") + (list (list gcc-toolchain-12 "static") (make-bitcoin-cross-toolchain target))) ((string-contains target "darwin") - (list ;; Native GCC 11 toolchain - gcc-toolchain-11 - clang-toolchain-18 + (list clang-toolchain-18 lld-18 (make-lld-wrapper lld-18 #:lld-as-ld? #t) python-signapple