Skip to content

Commit 07185c3

Browse files
fanquakefurszy
authored andcommitted
build: use -isysroot over --sysroot on macOS
1 parent 424ea09 commit 07185c3

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

contrib/macdeploy/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Working macOS DMGs are created in Linux by combining a recent `clang`, the Apple
5656

5757
Apple uses `clang` extensively for development and has upstreamed the necessary
5858
functionality so that a vanilla clang can take advantage. It supports the use of `-F`,
59-
`-target`, `-mmacosx-version-min`, and `--sysroot`, which are all necessary when
59+
`-target`, `-mmacosx-version-min`, and `-isysroot`, which are all necessary when
6060
building for macOS.
6161

6262
Apple's version of `binutils` (called `cctools`) contains lots of functionality missing in the

depends/builders/darwin.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
build_darwin_CC:=$(shell xcrun -f clang) --sysroot $(shell xcrun --show-sdk-path)
2-
build_darwin_CXX:=$(shell xcrun -f clang++) --sysroot $(shell xcrun --show-sdk-path)
1+
build_darwin_CC:=$(shell xcrun -f clang) -isysroot$(shell xcrun --show-sdk-path)
2+
build_darwin_CXX:=$(shell xcrun -f clang++) -isysroot$(shell xcrun --show-sdk-path)
33
build_darwin_AR:=$(shell xcrun -f ar)
44
build_darwin_RANLIB:=$(shell xcrun -f ranlib)
55
build_darwin_STRIP:=$(shell xcrun -f strip)
@@ -10,8 +10,8 @@ build_darwin_SHA256SUM=shasum -a 256
1010
build_darwin_DOWNLOAD=curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o
1111

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

depends/hosts/darwin.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-
2828
# https://reviews.llvm.org/D64089, we should use that instead. Read the
2929
# differential summary there for more details.
3030
#
31-
darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) -B$(build_prefix)/bin
32-
darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -stdlib=libc++ -mlinker-version=$(LD64_VERSION) -B$(build_prefix)/bin -nostdinc++ -isystem $(OSX_SDK)/usr/include/c++/v1
31+
darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) -isysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) -B$(build_prefix)/bin
32+
darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) -isysroot $(OSX_SDK) -stdlib=libc++ -mlinker-version=$(LD64_VERSION) -B$(build_prefix)/bin -nostdinc++ -isystem $(OSX_SDK)/usr/include/c++/v1
3333

3434
darwin_CFLAGS=-pipe
3535
darwin_CXXFLAGS=$(darwin_CFLAGS)

0 commit comments

Comments
 (0)