Skip to content

Commit 76b45d5

Browse files
committed
Merge #19683: depends: Pin clang search paths for darwin host
196b727 depends: Add comment about cache invalidation (Carl Dong) 949c480 depends: Fully determine path for darwin cctools (Carl Dong) 880660a depends: Fully determine path for darwin_{CC,CXX} (Carl Dong) 8033110 depends: Quote to prevent word splitting in config.site (Carl Dong) 77b1ef8 depends: Remove -fuse-ld line (Carl Dong) 3007339 depends: Pin clang search paths for darwin host (Carl Dong) 107f33d depends: Delay expansion of per-package vars (Carl Dong) Pull request description: > Hello clang/lib/frontend, > I search your headers once again. > Because it's time for some housekeeping, > Within the code I was tweaking, > And the targets I was making with my build, > Are unfulfilled, > It's just language compliance. > > In reference works I scroll alone > Pages cribbed from holy tomes > In the details of a template > My code's behaviour has now found its fate > When my hopes were dashed as a note left it as described: > As undefined > It's not in compliance > > And from the standard text I saw > Ten thousand errors, maybe more > Threading used without locking > Pointers referenced after freeing > Linters writing warnings that coders will never fix > But still they tick > The box that claims compliance > > "Fools," said I, "you do not know" > Errors, like a cancer, grow > Hear my words that I might reach you > Use -Wall and it might teach you > But my words and compiler errors fade. > Schedules forbade compliance. > > And the people bowed and prayed > With static checking torn and frayed > The markets flashed out their warning > In the words that they were forming > As recruiters said "The search for more profits leads to writing stuff in CSS, > And node.js. > Without a need for compliance" Many thanks to ajtowns for the above contribution! ----- This PR is ready for review! When cross-compiling for macOS, the SDK gives us the entire context/sysroot on which we should base the build. This means that we can be extremely specific w/re our search path ordering in order to avoid build problems that arise out of a user's specific environment/system setup and improve the robustness of our macOS toolchain. This PR does 2 things to this end: 1. Unset environment variables which are known to alter search paths. 1. Makes us (in the case of macOS builds) explicitly specify the list of system include search paths and its ordering, rather than rely on `clang`'s unreliable autodetection routine. Here is the [rabbit-hole gist](https://gist.github.com/dongcarl/5cdc6990b7599e8a5bf6d2a9c70e82f9). See the added comments in `depends/hosts/darwin.mk` for more details: https://github.com/bitcoin/bitcoin/blob/8b8296dc70a0aa5ca86d11ba5d3151fc56208e25/depends/hosts/darwin.mk#L37-L60 We can be this specific _only_ because macOS builds are neatly contained in an SDK, **and** we are cross-compiling. Native toolchains should rely on the environment/distro/user to know how best to build for the running system. Note: Although the `-u` flag of `env` is not a POSIX standard flag, it seems like it is useful enough to be implemented in [coreutils](https://www.gnu.org/software/coreutils/manual/html_node/env-invocation.html), [busybox](https://busybox.net/downloads/BusyBox.html#env), [FreeBSD](https://www.freebsd.org/cgi/man.cgi?env). ACKs for top commit: laanwj: code review ACK 196b727 Tree-SHA512: 406442df16d9aa0aef62f9fa94f72d7e48374301f3d826bf32f183e1610942aa44a4adfac7bead1f14aded0044fac400e1328fcd933b2337e55a024f034b5013
2 parents 86a8b35 + 196b727 commit 76b45d5

File tree

4 files changed

+173
-70
lines changed

4 files changed

+173
-70
lines changed

depends/Makefile

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ $(host_arch)_$(host_os)_id_string+=$(shell $(host_RANLIB) --version 2>/dev/null)
127127
$(host_arch)_$(host_os)_id_string+=$(shell $(host_STRIP) --version 2>/dev/null)
128128

129129
ifneq ($(strip $(FORCE_USE_SYSTEM_CLANG)),)
130+
# Make sure that cache is invalidated when switching between system and
131+
# depends-managed, pinned clang
130132
build_id_string+=system_clang
131133
$(host_arch)_$(host_os)_id_string+=system_clang
132134
endif
@@ -166,12 +168,6 @@ $(host_arch)_$(host_os)_native_toolchain?=$($(host_os)_native_toolchain)
166168

167169
include funcs.mk
168170

169-
binutils_path=$($($(host_arch)_$(host_os)_native_binutils)_prefixbin)
170-
ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),)
171-
toolchain_path=$($($(host_arch)_$(host_os)_native_toolchain)_prefixbin)
172-
else
173-
toolchain_path=
174-
endif
175171
final_build_id_long+=$(shell $(build_SHA256SUM) config.site.in)
176172
final_build_id+=$(shell echo -n "$(final_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH))
177173
$(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages)
@@ -182,15 +178,39 @@ $(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages)
182178
$(AT)cd $(@D); $(foreach package,$^, tar xf $($(package)_cached); )
183179
$(AT)touch $@
184180

181+
# $PATH is not preserved between ./configure and make by convention. Its
182+
# modification and overriding at ./configure time is (as I understand it)
183+
# supposed to be captured by the AC_{PROG_{,OBJ}CXX,PATH_{PROG,TOOL}} macros,
184+
# which will expand the program names to their full absolute paths. The notable
185+
# exception is command line overriding: ./configure CC=clang, which skips the
186+
# program name expansion step, and works because the user implicitly indicates
187+
# with CC=clang that clang will be available in $PATH at all times, and is most
188+
# likely part of the user's system.
189+
#
190+
# Therefore, when we "seed the autoconf cache"/"override well-known program
191+
# vars" by setting AR=<blah> in our config.site, either one of two things needs
192+
# to be true for the build system to work correctly:
193+
#
194+
# 1. If we refer to the program by name (e.g. AR=riscv64-gnu-linux-ar), the
195+
# tool needs to be available in $PATH at all times.
196+
#
197+
# 2. If the tool is _**not**_ expected to be available in $PATH at all times
198+
# (such as is the case for our native_cctools binutils tools), it needs to
199+
# be referred to by its absolute path, such as would be output by the
200+
# AC_PATH_{PROG,TOOL} macros.
201+
#
202+
# Minor note: it is also okay to refer to tools by their absolute path even if
203+
# we expect them to be available in $PATH at all times, more specificity does
204+
# not hurt.
185205
$(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_build_id)
186206
$(AT)@mkdir -p $(@D)
187207
$(AT)sed -e 's|@HOST@|$(host)|' \
188-
-e 's|@CC@|$(toolchain_path)$(host_CC)|' \
189-
-e 's|@CXX@|$(toolchain_path)$(host_CXX)|' \
190-
-e 's|@AR@|$(binutils_path)$(host_AR)|' \
191-
-e 's|@RANLIB@|$(binutils_path)$(host_RANLIB)|' \
192-
-e 's|@NM@|$(binutils_path)$(host_NM)|' \
193-
-e 's|@STRIP@|$(binutils_path)$(host_STRIP)|' \
208+
-e 's|@CC@|$(host_CC)|' \
209+
-e 's|@CXX@|$(host_CXX)|' \
210+
-e 's|@AR@|$(host_AR)|' \
211+
-e 's|@RANLIB@|$(host_RANLIB)|' \
212+
-e 's|@NM@|$(host_NM)|' \
213+
-e 's|@STRIP@|$(host_STRIP)|' \
194214
-e 's|@build_os@|$(build_os)|' \
195215
-e 's|@host_os@|$(host_os)|' \
196216
-e 's|@CFLAGS@|$(strip $(host_CFLAGS) $(host_$(release_type)_CFLAGS))|' \

depends/config.site.in

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,74 +8,74 @@ true # Dummy command because shellcheck treats all directives before first
88
# See: https://github.com/koalaman/shellcheck/wiki/Directive
99

1010
# shellcheck disable=SC2154
11-
depends_prefix="$(cd "$(dirname ${ac_site_file})/.." && pwd)"
11+
depends_prefix="$(cd "$(dirname "$ac_site_file")/.." && pwd)"
1212

1313
cross_compiling=maybe
14-
host_alias=@HOST@
15-
ac_tool_prefix=${host_alias}-
14+
host_alias="@HOST@"
15+
ac_tool_prefix="${host_alias}-"
1616

17-
if test -z $with_boost; then
18-
with_boost=$depends_prefix
17+
if test -z "$with_boost"; then
18+
with_boost="$depends_prefix"
1919
fi
20-
if test -z $with_qt_plugindir; then
21-
with_qt_plugindir=$depends_prefix/plugins
20+
if test -z "$with_qt_plugindir"; then
21+
with_qt_plugindir="${depends_prefix}/plugins"
2222
fi
23-
if test -z $with_qt_translationdir; then
24-
with_qt_translationdir=$depends_prefix/translations
23+
if test -z "$with_qt_translationdir"; then
24+
with_qt_translationdir="${depends_prefix}/translations"
2525
fi
26-
if test -z $with_qt_bindir && test -z "@no_qt@"; then
27-
with_qt_bindir=$depends_prefix/native/bin
26+
if test -z "$with_qt_bindir" && test -z "@no_qt@"; then
27+
with_qt_bindir="${depends_prefix}/native/bin"
2828
fi
29-
if test -z $with_mpgen && test -n "@multiprocess@"; then
30-
with_mpgen=$depends_prefix/native
29+
if test -z "$with_mpgen" && test -n "@multiprocess@"; then
30+
with_mpgen="${depends_prefix}/native"
3131
fi
3232

33-
if test -z $with_qrencode && test -n "@no_qr@"; then
33+
if test -z "$with_qrencode" && test -n "@no_qr@"; then
3434
with_qrencode=no
3535
fi
3636

37-
if test -z $enable_wallet && test -n "@no_wallet@"; then
37+
if test -z "$enable_wallet" && test -n "@no_wallet@"; then
3838
enable_wallet=no
3939
fi
4040

41-
if test -z $enable_multiprocess && test -n "@multiprocess@"; then
41+
if test -z "$enable_multiprocess" && test -n "@multiprocess@"; then
4242
enable_multiprocess=yes
4343
fi
4444

45-
if test -z $with_miniupnpc && test -n "@no_upnp@"; then
45+
if test -z "$with_miniupnpc" && test -n "@no_upnp@"; then
4646
with_miniupnpc=no
4747
fi
4848

49-
if test -z $with_natpmp && test -n "@no_natpmp@"; then
49+
if test -z "$with_natpmp" && test -n "@no_natpmp@"; then
5050
with_natpmp=no
5151
fi
5252

53-
if test -z $with_gui && test -n "@no_qt@"; then
53+
if test -z "$with_gui" && test -n "@no_qt@"; then
5454
with_gui=no
5555
fi
5656

57-
if test -z $enable_zmq && test -n "@no_zmq@"; then
57+
if test -z "$enable_zmq" && test -n "@no_zmq@"; then
5858
enable_zmq=no
5959
fi
6060

61-
if test x@host_os@ = xdarwin; then
61+
if test "x@host_os@" = xdarwin; then
6262
BREW=no
6363
PORT=no
6464
fi
6565

66-
PATH=$depends_prefix/native/bin:$PATH
66+
PATH="${depends_prefix}/native/bin:${PATH}"
6767
PKG_CONFIG="$(which pkg-config) --static"
6868

6969
# These two need to remain exported because pkg-config does not see them
7070
# otherwise. That means they must be unexported at the end of configure.ac to
7171
# avoid ruining the cache. Sigh.
72-
export PKG_CONFIG_PATH=$depends_prefix/share/pkgconfig:$depends_prefix/lib/pkgconfig
72+
export PKG_CONFIG_PATH="${depends_prefix}/share/pkgconfig:${depends_prefix}/lib/pkgconfig"
7373
if test -z "@allow_host_packages@"; then
74-
export PKG_CONFIG_LIBDIR=$depends_prefix/lib/pkgconfig
74+
export PKG_CONFIG_LIBDIR="${depends_prefix}/lib/pkgconfig"
7575
fi
7676

77-
CPPFLAGS="-I$depends_prefix/include/ $CPPFLAGS"
78-
LDFLAGS="-L$depends_prefix/lib $LDFLAGS"
77+
CPPFLAGS="-I${depends_prefix}/include/ ${CPPFLAGS}"
78+
LDFLAGS="-L${depends_prefix}/lib ${LDFLAGS}"
7979

8080
if test -n "@CC@" -a -z "${CC}"; then
8181
CC="@CC@"
@@ -86,33 +86,33 @@ fi
8686
PYTHONPATH="${depends_prefix}/native/lib/python3/dist-packages${PYTHONPATH:+${PATH_SEPARATOR}}${PYTHONPATH}"
8787

8888
if test -n "@AR@"; then
89-
AR=@AR@
90-
ac_cv_path_ac_pt_AR=${AR}
89+
AR="@AR@"
90+
ac_cv_path_ac_pt_AR="${AR}"
9191
fi
9292

9393
if test -n "@RANLIB@"; then
94-
RANLIB=@RANLIB@
95-
ac_cv_path_ac_pt_RANLIB=${RANLIB}
94+
RANLIB="@RANLIB@"
95+
ac_cv_path_ac_pt_RANLIB="${RANLIB}"
9696
fi
9797

9898
if test -n "@NM@"; then
99-
NM=@NM@
100-
ac_cv_path_ac_pt_NM=${NM}
99+
NM="@NM@"
100+
ac_cv_path_ac_pt_NM="${NM}"
101101
fi
102102

103103
if test -n "@debug@"; then
104104
enable_reduce_exports=no
105105
fi
106106

107107
if test -n "@CFLAGS@"; then
108-
CFLAGS="@CFLAGS@ $CFLAGS"
108+
CFLAGS="@CFLAGS@ ${CFLAGS}"
109109
fi
110110
if test -n "@CXXFLAGS@"; then
111-
CXXFLAGS="@CXXFLAGS@ $CXXFLAGS"
111+
CXXFLAGS="@CXXFLAGS@ ${CXXFLAGS}"
112112
fi
113113
if test -n "@CPPFLAGS@"; then
114-
CPPFLAGS="@CPPFLAGS@ $CPPFLAGS"
114+
CPPFLAGS="@CPPFLAGS@ ${CPPFLAGS}"
115115
fi
116116
if test -n "@LDFLAGS@"; then
117-
LDFLAGS="@LDFLAGS@ $LDFLAGS"
117+
LDFLAGS="@LDFLAGS@ ${LDFLAGS}"
118118
fi

depends/funcs.mk

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
define int_vars
22
#Set defaults for vars which may be overridden per-package
3-
$(1)_cc=$($($(1)_type)_CC)
4-
$(1)_cxx=$($($(1)_type)_CXX)
5-
$(1)_objc=$($($(1)_type)_OBJC)
6-
$(1)_objcxx=$($($(1)_type)_OBJCXX)
7-
$(1)_ar=$($($(1)_type)_AR)
8-
$(1)_ranlib=$($($(1)_type)_RANLIB)
9-
$(1)_libtool=$($($(1)_type)_LIBTOOL)
10-
$(1)_nm=$($($(1)_type)_NM)
11-
$(1)_cflags=$($($(1)_type)_CFLAGS) $($($(1)_type)_$(release_type)_CFLAGS)
12-
$(1)_cxxflags=$($($(1)_type)_CXXFLAGS) $($($(1)_type)_$(release_type)_CXXFLAGS)
13-
$(1)_ldflags=$($($(1)_type)_LDFLAGS) $($($(1)_type)_$(release_type)_LDFLAGS) -L$($($(1)_type)_prefix)/lib
14-
$(1)_cppflags=$($($(1)_type)_CPPFLAGS) $($($(1)_type)_$(release_type)_CPPFLAGS) -I$($($(1)_type)_prefix)/include
3+
$(1)_cc=$$($$($(1)_type)_CC)
4+
$(1)_cxx=$$($$($(1)_type)_CXX)
5+
$(1)_objc=$$($$($(1)_type)_OBJC)
6+
$(1)_objcxx=$$($$($(1)_type)_OBJCXX)
7+
$(1)_ar=$$($$($(1)_type)_AR)
8+
$(1)_ranlib=$$($$($(1)_type)_RANLIB)
9+
$(1)_libtool=$$($$($(1)_type)_LIBTOOL)
10+
$(1)_nm=$$($$($(1)_type)_NM)
11+
$(1)_cflags=$$($$($(1)_type)_CFLAGS) \
12+
$$($$($(1)_type)_$$(release_type)_CFLAGS)
13+
$(1)_cxxflags=$$($$($(1)_type)_CXXFLAGS) \
14+
$$($$($(1)_type)_$$(release_type)_CXXFLAGS)
15+
$(1)_ldflags=$$($$($(1)_type)_LDFLAGS) \
16+
$$($$($(1)_type)_$$(release_type)_LDFLAGS) \
17+
-L$$($($(1)_type)_prefix)/lib
18+
$(1)_cppflags=$$($$($(1)_type)_CPPFLAGS) \
19+
$$($$($(1)_type)_$$(release_type)_CPPFLAGS) \
20+
-I$$($$($(1)_type)_prefix)/include
1521
$(1)_recipe_hash:=
1622
endef
1723

depends/hosts/darwin.mk

Lines changed: 87 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,49 @@ LD64_VERSION=530
66

77
OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-libcxx-headers
88

9+
darwin_native_binutils=native_cctools
10+
11+
ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),)
12+
# FORCE_USE_SYSTEM_CLANG is empty, so we use our depends-managed, pinned clang
13+
# from llvm.org
14+
15+
# The native_cctools package is what provides clang when FORCE_USE_SYSTEM_CLANG
16+
# is empty
17+
darwin_native_toolchain=native_cctools
18+
19+
clang_prog=$(build_prefix)/bin/clang
20+
clangxx_prog=$(clang_prog)++
21+
22+
clang_resource_dir=$(build_prefix)/lib/clang/$(native_cctools_clang_version)
23+
else
24+
# FORCE_USE_SYSTEM_CLANG is non-empty, so we use the clang from the user's
25+
# system
26+
27+
darwin_native_toolchain=
28+
29+
# We can't just use $(shell command -v clang) because GNU Make handles builtins
30+
# in a special way and doesn't know that `command` is a POSIX-standard builtin
31+
# prior to 1af314465e5dfe3e8baa839a32a72e83c04f26ef, first released in v4.2.90.
32+
# At the time of writing, GNU Make v4.2.1 is still being used in supported
33+
# distro releases.
34+
#
35+
# Source: https://lists.gnu.org/archive/html/bug-make/2017-11/msg00017.html
36+
clang_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang")
37+
clangxx_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang++")
38+
39+
clang_resource_dir=$(shell clang -print-resource-dir)
40+
endif
41+
42+
cctools_TOOLS=AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL
43+
44+
# Make-only lowercase function
45+
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))))))))))))))))))))))))))
46+
47+
# For well-known tools provided by cctools, make sure that their well-known
48+
# variable is set to the full path of the tool, just like how AC_PATH_{TOO,PROG}
49+
# would.
50+
$(foreach TOOL,$(cctools_TOOLS),$(eval darwin_$(TOOL) = $$(build_prefix)/bin/$$(host)-$(call lc,$(TOOL))))
51+
952
# Flag explanations:
1053
#
1154
# -mlinker-version
@@ -18,7 +61,7 @@ OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-
1861
# Explicitly point to our binaries (e.g. cctools) so that they are
1962
# ensured to be found and preferred over other possibilities.
2063
#
21-
# -nostdinc++ -isystem $(OSX_SDK)/usr/include/c++/v1
64+
# -stdlib=libc++ -nostdinc++ -Xclang -cxx-isystem$(OSX_SDK)/usr/include/c++/v1
2265
#
2366
# Forces clang to use the libc++ headers from our SDK and completely
2467
# forget about the libc++ headers from the standard directories
@@ -28,8 +71,49 @@ OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-
2871
# https://reviews.llvm.org/D64089, we should use that instead. Read the
2972
# differential summary there for more details.
3073
#
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
74+
# -Xclang -*system<path_a> \
75+
# -Xclang -*system<path_b> \
76+
# -Xclang -*system<path_c> ...
77+
#
78+
# Adds path_a, path_b, and path_c to the bottom of clang's list of
79+
# include search paths. This is used to explicitly specify the list of
80+
# system include search paths and its ordering, rather than rely on
81+
# clang's autodetection routine. This routine has been shown to:
82+
# 1. Fail to pickup libc++ headers in $SYSROOT/usr/include/c++/v1
83+
# when clang was built manually (see: https://github.com/bitcoin/bitcoin/pull/17919#issuecomment-656785034)
84+
# 2. Fail to pickup C headers in $SYSROOT/usr/include when
85+
# C_INCLUDE_DIRS was specified at configure time (see: https://gist.github.com/dongcarl/5cdc6990b7599e8a5bf6d2a9c70e82f9)
86+
#
87+
# Talking directly to cc1 with -Xclang here grants us access to specify
88+
# more granular categories for these system include search paths, and we
89+
# can use the correct categories that these search paths would have been
90+
# placed in if the autodetection routine had worked correctly. (see:
91+
# https://gist.github.com/dongcarl/5cdc6990b7599e8a5bf6d2a9c70e82f9#the-treatment)
92+
#
93+
# Furthermore, it places these search paths after any "non-Xclang"
94+
# specified search paths. This prevents any additional clang options or
95+
# environment variables from coming after or in between these system
96+
# include search paths, as that would be wrong in general but would also
97+
# break #include_next's.
98+
#
99+
darwin_CC=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
100+
-u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \
101+
-u LIBRARY_PATH \
102+
$(clang_prog) --target=$(host) -mmacosx-version-min=$(OSX_MIN_VERSION) \
103+
-B$(build_prefix)/bin -mlinker-version=$(LD64_VERSION) \
104+
--sysroot=$(OSX_SDK) \
105+
-Xclang -internal-externc-isystem$(clang_resource_dir)/include \
106+
-Xclang -internal-externc-isystem$(OSX_SDK)/usr/include
107+
darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
108+
-u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \
109+
-u LIBRARY_PATH \
110+
$(clangxx_prog) --target=$(host) -mmacosx-version-min=$(OSX_MIN_VERSION) \
111+
-B$(build_prefix)/bin -mlinker-version=$(LD64_VERSION) \
112+
--sysroot=$(OSX_SDK) \
113+
-stdlib=libc++ -nostdinc++ \
114+
-Xclang -cxx-isystem$(OSX_SDK)/usr/include/c++/v1 \
115+
-Xclang -internal-externc-isystem$(clang_resource_dir)/include \
116+
-Xclang -internal-externc-isystem$(OSX_SDK)/usr/include
33117

34118
darwin_CFLAGS=-pipe
35119
darwin_CXXFLAGS=$(darwin_CFLAGS)
@@ -40,11 +124,4 @@ darwin_release_CXXFLAGS=$(darwin_release_CFLAGS)
40124
darwin_debug_CFLAGS=-O1
41125
darwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS)
42126

43-
darwin_native_binutils=native_cctools
44-
ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),)
45-
darwin_native_toolchain=native_cctools
46-
else
47-
darwin_native_toolchain=
48-
endif
49-
50127
darwin_cmake_system=Darwin

0 commit comments

Comments
 (0)