Skip to content

Commit c818607

Browse files
committed
Merge bitcoin/bitcoin#29233: build: depends move macOS C(XX) FLAGS out of C & CXX
cbc9bf1 build: move -mlinker-version to *FLAGS (fanquake) 42b2283 depends: deduplicate use of mmacosx-version-min in macOS build (fanquake) Pull request description: Move some C/CXX FLAGS out of C/CXX. The remaining flags are host/SDK related, and will need some more thought. This is more correct in any case, and simplifies future changes. Related to #21778. ACKs for top commit: theuni: utACK cbc9bf1 TheCharlatan: ACK cbc9bf1 Tree-SHA512: 373216c1de32375faddc161ecc09b14fed0e0994cbd5ed62c862c38a5aea80c7f1740f32f36b8a60ac1caf749309750d22164c50b89916f41838d6453296ac4a
2 parents 8106b26 + cbc9bf1 commit c818607

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

depends/builders/darwin.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ build_darwin_SHA256SUM=shasum -a 256
1111
build_darwin_DOWNLOAD=curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o
1212

1313
#darwin host on darwin builder. overrides darwin host preferences.
14-
darwin_CC=$(shell xcrun -f clang) -mmacosx-version-min=$(OSX_MIN_VERSION) -isysroot$(shell xcrun --show-sdk-path)
15-
darwin_CXX:=$(shell xcrun -f clang++) -mmacosx-version-min=$(OSX_MIN_VERSION) -stdlib=libc++ -isysroot$(shell xcrun --show-sdk-path)
14+
darwin_CC=$(shell xcrun -f clang) -isysroot$(shell xcrun --show-sdk-path)
15+
darwin_CXX:=$(shell xcrun -f clang++) -stdlib=libc++ -isysroot$(shell xcrun --show-sdk-path)
1616
darwin_AR:=$(shell xcrun -f ar)
1717
darwin_RANLIB:=$(shell xcrun -f ranlib)
1818
darwin_STRIP:=$(shell xcrun -f strip)

depends/hosts/darwin.mk

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,24 +79,29 @@ $(foreach TOOL,$(cctools_TOOLS),$(eval darwin_$(TOOL) = $$(build_prefix)/bin/$$(
7979
darwin_CC=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
8080
-u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \
8181
-u LIBRARY_PATH \
82-
$(clang_prog) --target=$(host) -mmacosx-version-min=$(OSX_MIN_VERSION) \
83-
-B$(build_prefix)/bin -mlinker-version=$(LD64_VERSION) \
82+
$(clang_prog) --target=$(host) \
83+
-B$(build_prefix)/bin \
8484
-isysroot$(OSX_SDK) -nostdlibinc \
8585
-iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks
8686

8787
darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
8888
-u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \
8989
-u LIBRARY_PATH \
90-
$(clangxx_prog) --target=$(host) -mmacosx-version-min=$(OSX_MIN_VERSION) \
91-
-B$(build_prefix)/bin -mlinker-version=$(LD64_VERSION) \
90+
$(clangxx_prog) --target=$(host) \
91+
-B$(build_prefix)/bin \
9292
-isysroot$(OSX_SDK) -nostdlibinc \
9393
-iwithsysroot/usr/include/c++/v1 \
9494
-iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks
9595

96-
darwin_CFLAGS=-pipe -std=$(C_STANDARD)
97-
darwin_CXXFLAGS=-pipe -std=$(CXX_STANDARD)
96+
darwin_CFLAGS=-pipe -std=$(C_STANDARD) -mmacosx-version-min=$(OSX_MIN_VERSION)
97+
darwin_CXXFLAGS=-pipe -std=$(CXX_STANDARD) -mmacosx-version-min=$(OSX_MIN_VERSION)
9898
darwin_LDFLAGS=-Wl,-platform_version,macos,$(OSX_MIN_VERSION),$(OSX_SDK_VERSION)
9999

100+
ifneq ($(build_os),darwin)
101+
darwin_CFLAGS += -mlinker-version=$(LD64_VERSION)
102+
darwin_CXXFLAGS += -mlinker-version=$(LD64_VERSION)
103+
endif
104+
100105
darwin_release_CFLAGS=-O2
101106
darwin_release_CXXFLAGS=$(darwin_release_CFLAGS)
102107

0 commit comments

Comments
 (0)