Skip to content

Commit d48d55e

Browse files
committed
Merge bitcoin/bitcoin#29890: deploy: remove some tools when cross-compiling for macOS
1a9aa8d build: better scope usage of -Wl,-headerpad_max_install_names (fanquake) 3bee514 build: don't use install_name_tool for macOS deploy when cross-compiling (fanquake) 78b6b5c build: don't pass strip to macOS deploy if cross-compiling (fanquake) Pull request description: Neither of these tools are actually used when we are cross-compiling for macOS. They are used when we have to adjust non-static libs during a deploy after building on a macOS machine. Simplies #29739 (will be rebased on top). Guix (aarch64): ```bash 8f29bce75d7f574306a0e38d793e0e4e145b547a4b9e5a755a54976121d8ac41 guix-build-5afd3c302051/output/arm64-apple-darwin/SHA256SUMS.part 9ba01fe46be715adcbe80f39dc7dbe449f32ca9d9b660da698f933aef3e6d80b guix-build-5afd3c302051/output/arm64-apple-darwin/bitcoin-5afd3c302051-arm64-apple-darwin-unsigned.tar.gz 37719437e951449341d0e10dcc4afe93e955d59de5312ce6351e1fa01b4927ac guix-build-5afd3c302051/output/arm64-apple-darwin/bitcoin-5afd3c302051-arm64-apple-darwin-unsigned.zip 06a79fc871dcd4290f5f7e7e9de19a5a535203d20279f4555d1c319d07abe2d0 guix-build-5afd3c302051/output/arm64-apple-darwin/bitcoin-5afd3c302051-arm64-apple-darwin.tar.gz 98d2b8b37197dcad36a04eb2f3ff2130b859220a17b83a4186a78dcf0af4eafd guix-build-5afd3c302051/output/dist-archive/bitcoin-5afd3c302051.tar.gz df63ff44ef41565ff13ce6dde5485173a18d5866ebc316df86f9ebd91fda18f5 guix-build-5afd3c302051/output/x86_64-apple-darwin/SHA256SUMS.part 28362ce9e80d5e78db198efa5f89434fbe76ca91df5fde7455da4d50ceb8523a guix-build-5afd3c302051/output/x86_64-apple-darwin/bitcoin-5afd3c302051-x86_64-apple-darwin-unsigned.tar.gz 534745b679eb9e8e408dd251a6bf0829e62e12f7a41772b8a57a044ded14208c guix-build-5afd3c302051/output/x86_64-apple-darwin/bitcoin-5afd3c302051-x86_64-apple-darwin-unsigned.zip f53d0c9a1bb83d548c7d274c7d39653a3989fb1b4efec49e73dd1cac7c92074c guix-build-5afd3c302051/output/x86_64-apple-darwin/bitcoin-5afd3c302051-x86_64-apple-darwin.tar.gz ``` ACKs for top commit: TheCharlatan: ACK 1a9aa8d Tree-SHA512: 0aa77ea4d6dc45c226806bb1758b6aa7e8ca17f91045bab4fc6891af7b9de476211cd5692c11cb9d5bcf59744fd86a2534812a77fe304ae10c3518e08fc412be
2 parents ee1c975 + 1a9aa8d commit d48d55e

File tree

9 files changed

+9
-17
lines changed

9 files changed

+9
-17
lines changed

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ $(OSX_ZIP): deploydir
126126
cd $(APP_DIST_DIR) && find . | sort | $(ZIP) -X@ $@
127127

128128
$(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
129-
INSTALL_NAME_TOOL=$(INSTALL_NAME_TOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) $(OSX_VOLNAME) -translations-dir=$(QT_TRANSLATION_DIR)
129+
OTOOL=$(OTOOL) $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) $(OSX_VOLNAME) -translations-dir=$(QT_TRANSLATION_DIR)
130130

131131
deploydir: $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
132132
endif !BUILD_DARWIN

configure.ac

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,9 @@ case $host in
696696
TARGET_OS=darwin
697697
if test $cross_compiling != "yes"; then
698698
BUILD_OS=darwin
699+
700+
AX_CHECK_LINK_FLAG([-Wl,-headerpad_max_install_names], [CORE_LDFLAGS="$CORE_LDFLAGS -Wl,-headerpad_max_install_names"], [], [$LDFLAG_WERROR])
701+
699702
AC_CHECK_PROG([BREW], [brew], [brew])
700703
if test "$BREW" = "brew"; then
701704
dnl These Homebrew packages may be keg-only, meaning that they won't be found
@@ -759,7 +762,6 @@ case $host in
759762
;;
760763
*)
761764
AC_PATH_TOOL([DSYMUTIL], [dsymutil], [dsymutil])
762-
AC_PATH_TOOL([INSTALL_NAME_TOOL], [install_name_tool], [install_name_tool])
763765
AC_PATH_TOOL([OTOOL], [otool], [otool])
764766
AC_PATH_PROG([ZIP], [zip], [zip])
765767

@@ -772,7 +774,6 @@ case $host in
772774
esac
773775
fi
774776

775-
AX_CHECK_LINK_FLAG([-Wl,-headerpad_max_install_names], [CORE_LDFLAGS="$CORE_LDFLAGS -Wl,-headerpad_max_install_names"], [], [$LDFLAG_WERROR])
776777
CORE_CPPFLAGS="$CORE_CPPFLAGS -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0"
777778

778779
dnl ignore deprecated-declarations warnings coming from objcxx code

contrib/macdeploy/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,8 @@ building for macOS.
6666

6767
Apple's version of `binutils` (called `cctools`) contains lots of functionality missing in the
6868
FSF's `binutils`. In addition to extra linker options for frameworks and sysroots, several
69-
other tools are needed as well such as `install_name_tool`, `lipo`, and `nmedit`. These
70-
do not build under Linux, so they have been patched to do so. The work here was used as
71-
a starting point: [mingwandroid/toolchain4](https://github.com/mingwandroid/toolchain4).
69+
other tools are needed as well. These do not build under Linux, so they have been patched to
70+
do so. The work here was used as a starting point: [mingwandroid/toolchain4](https://github.com/mingwandroid/toolchain4).
7271

7372
In order to build a working toolchain, the following source packages are needed from
7473
Apple: `cctools`, `dyld`, and `ld64`.

depends/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_
234234
-e 's|@NM@|$(host_NM)|' \
235235
-e 's|@STRIP@|$(host_STRIP)|' \
236236
-e 's|@OTOOL@|$(host_OTOOL)|' \
237-
-e 's|@INSTALL_NAME_TOOL@|$(host_INSTALL_NAME_TOOL)|' \
238237
-e 's|@DSYMUTIL@|$(host_DSYMUTIL)|' \
239238
-e 's|@build_os@|$(build_os)|' \
240239
-e 's|@host_os@|$(host_os)|' \

depends/builders/darwin.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ build_darwin_RANLIB:=$(shell xcrun -f ranlib)
55
build_darwin_STRIP:=$(shell xcrun -f strip)
66
build_darwin_OTOOL:=$(shell xcrun -f otool)
77
build_darwin_NM:=$(shell xcrun -f nm)
8-
build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool)
98
build_darwin_DSYMUTIL:=$(shell xcrun -f dsymutil)
109
build_darwin_SHA256SUM=shasum -a 256
1110
build_darwin_DOWNLOAD=curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o
@@ -18,7 +17,6 @@ darwin_RANLIB:=$(shell xcrun -f ranlib)
1817
darwin_STRIP:=$(shell xcrun -f strip)
1918
darwin_OTOOL:=$(shell xcrun -f otool)
2019
darwin_NM:=$(shell xcrun -f nm)
21-
darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool)
2220
darwin_DSYMUTIL:=$(shell xcrun -f dsymutil)
2321
darwin_native_binutils=
2422
darwin_native_toolchain=

depends/builders/default.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ build_$(build_os)_$1 ?= $$(default_build_$1)
1212
build_$(build_arch)_$(build_os)_$1 ?= $$(build_$(build_os)_$1)
1313
build_$1=$$(build_$(build_arch)_$(build_os)_$1)
1414
endef
15-
$(foreach var,CC CXX AR TAR RANLIB NM STRIP SHA256SUM DOWNLOAD OTOOL INSTALL_NAME_TOOL DSYMUTIL TOUCH,$(eval $(call add_build_tool_func,$(var))))
15+
$(foreach var,CC CXX AR TAR RANLIB NM STRIP SHA256SUM DOWNLOAD OTOOL DSYMUTIL TOUCH,$(eval $(call add_build_tool_func,$(var))))
1616
define add_build_flags_func
1717
build_$(build_arch)_$(build_os)_$1 += $(build_$(build_os)_$1)
1818
build_$1=$$(build_$(build_arch)_$(build_os)_$1)

depends/config.site.in

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,6 @@ if test "@host_os@" = darwin; then
123123
ac_cv_path_OTOOL="${OTOOL}"
124124
fi
125125

126-
if test -n "@INSTALL_NAME_TOOL@"; then
127-
INSTALL_NAME_TOOL="@INSTALL_NAME_TOOL@"
128-
ac_cv_path_INSTALL_NAME_TOOL="${INSTALL_NAME_TOOL}"
129-
fi
130-
131126
if test -n "@DSYMUTIL@"; then
132127
DSYMUTIL="@DSYMUTIL@"
133128
ac_cv_path_DSYMUTIL="${DSYMUTIL}"

depends/hosts/darwin.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ llvm_config_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-config")
3939
llvm_lib_dir=$(shell $(llvm_config_prog) --libdir)
4040
endif
4141

42-
cctools_TOOLS=AR RANLIB STRIP NM OTOOL INSTALL_NAME_TOOL DSYMUTIL
42+
cctools_TOOLS=AR RANLIB STRIP NM OTOOL DSYMUTIL
4343

4444
# Make-only lowercase function
4545
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))))))))))))))))))))))))))

depends/hosts/default.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ host_$1 = $$($(host_arch)_$(host_os)_$1)
3838
host_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1)
3939
endef
4040

41-
$(foreach tool,CC CXX AR RANLIB STRIP NM OBJCOPY OTOOL INSTALL_NAME_TOOL DSYMUTIL,$(eval $(call add_host_tool_func,$(tool))))
41+
$(foreach tool,CC CXX AR RANLIB STRIP NM OBJCOPY OTOOL DSYMUTIL,$(eval $(call add_host_tool_func,$(tool))))
4242
$(foreach flags,CFLAGS CXXFLAGS CPPFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags))))

0 commit comments

Comments
 (0)