Skip to content

Commit 4c62f4b

Browse files
committed
Merge bitcoin/bitcoin#30451: depends: remove Darwin ENV unsetting
bda537f depends: remove ENV unsetting for darwin (fanquake) 1807760 guix: improve ENV unsetting for macOS (fanquake) 0b2aeee depends: patch explicit -lm usage out of Qt tools (fanquake) Pull request description: Now that we use the native compiler, and have fixed Qt, and these vars are (almost) unset in Guix, we can remove the unsetting from our compiler command here. I couldn't manage to make a darwin-clang-cross only exclusion of `-lm` work properly for Qt, so opted for just removing the explicit link entirely. I do not think this should have any other unwanted side-effects. Fixes #21552. ACKs for top commit: TheCharlatan: ACK bda537f Tree-SHA512: 97a2d85de7d4b1d65717ecb521399ecba5f53863b8aef21af62ede5ceee59ee1a9392663da3a3852cad1b6d8b420dd4b0b5f0eea38d30a81785d8b2718620b5f
2 parents f66738f + bda537f commit 4c62f4b

File tree

4 files changed

+30
-11
lines changed

4 files changed

+30
-11
lines changed

contrib/guix/libexec/build.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,9 @@ unset OBJCPLUS_INCLUDE_PATH
7171

7272
export C_INCLUDE_PATH="${NATIVE_GCC}/include"
7373
export CPLUS_INCLUDE_PATH="${NATIVE_GCC}/include/c++:${NATIVE_GCC}/include"
74-
export OBJC_INCLUDE_PATH="${NATIVE_GCC}/include"
75-
export OBJCPLUS_INCLUDE_PATH="${NATIVE_GCC}/include/c++:${NATIVE_GCC}/include"
7674

7775
case "$HOST" in
78-
*darwin*) export LIBRARY_PATH="${NATIVE_GCC}/lib" ;;
76+
*darwin*) export LIBRARY_PATH="${NATIVE_GCC}/lib" ;; # Required for qt/qmake
7977
*mingw*) export LIBRARY_PATH="${NATIVE_GCC}/lib" ;;
8078
*)
8179
NATIVE_GCC_STATIC="$(store_path gcc-toolchain static)"
@@ -180,6 +178,14 @@ make -C depends --jobs="$JOBS" HOST="$HOST" \
180178
x86_64_linux_NM=x86_64-linux-gnu-gcc-nm \
181179
x86_64_linux_STRIP=x86_64-linux-gnu-strip
182180

181+
case "$HOST" in
182+
*darwin*)
183+
# Unset now that Qt is built
184+
unset C_INCLUDE_PATH
185+
unset CPLUS_INCLUDE_PATH
186+
unset LIBRARY_PATH
187+
;;
188+
esac
183189

184190
###########################
185191
# Source Tarball Building #

depends/hosts/darwin.mk

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,11 @@ darwin_STRIP=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-strip")
5050
# Disable adhoc codesigning (for now) when using LLVM tooling, to avoid
5151
# non-determinism issues with the Identifier field.
5252

53-
darwin_CC=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
54-
-u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \
55-
-u LIBRARY_PATH \
56-
$(clang_prog) --target=$(host) \
53+
darwin_CC=$(clang_prog) --target=$(host) \
5754
-isysroot$(OSX_SDK) -nostdlibinc \
5855
-iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks
5956

60-
darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
61-
-u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \
62-
-u LIBRARY_PATH \
63-
$(clangxx_prog) --target=$(host) \
57+
darwin_CXX=$(clangxx_prog) --target=$(host) \
6458
-isysroot$(OSX_SDK) -nostdlibinc \
6559
-iwithsysroot/usr/include/c++/v1 \
6660
-iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks

depends/packages/qt.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ $(package)_patches += memory_resource.patch
2323
$(package)_patches += clang_18_libpng.patch
2424
$(package)_patches += utc_from_string_no_optimize.patch
2525
$(package)_patches += windows_lto.patch
26+
$(package)_patches += darwin_no_libm.patch
2627
$(package)_patches += zlib-timebits64.patch
2728

2829
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
@@ -236,6 +237,7 @@ define $(package)_preprocess_cmds
236237
patch -p1 -i $($(package)_patch_dir)/utc_from_string_no_optimize.patch && \
237238
patch -p1 -i $($(package)_patch_dir)/guix_cross_lib_path.patch && \
238239
patch -p1 -i $($(package)_patch_dir)/windows_lto.patch && \
240+
patch -p1 -i $($(package)_patch_dir)/darwin_no_libm.patch && \
239241
patch -p1 -i $($(package)_patch_dir)/zlib-timebits64.patch && \
240242
mkdir -p qtbase/mkspecs/macx-clang-linux &&\
241243
cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
build: remove explicit -lm link from qttools
2+
3+
This causes issues with at least the macOS cross build, and shouldn't
4+
actually be required anywhere else. GCC with libstdc++ will already get libm.
5+
6+
--- a/qtbase/src/corelib/tools/tools.pri
7+
+++ b/qtbase/src/corelib/tools/tools.pri
8+
@@ -111,9 +111,6 @@ qtConfig(easingcurve) {
9+
tools/qtimeline.cpp
10+
}
11+
12+
-# Note: libm should be present by default becaue this is C++
13+
-unix:!macx-icc:!vxworks:!haiku:!integrity:!wasm: LIBS_PRIVATE += -lm
14+
-
15+
TR_EXCLUDE += ../3rdparty/*
16+
17+
# MIPS DSP

0 commit comments

Comments
 (0)