Skip to content

Conversation

ryanofsky
Copy link
Contributor

Catalina SDK clang stopped automatically searching the SDK include paths when invoked without --sysroot:

This hasn't been a problem for current native depends packages because are passing their own --sysroot values, and hasn't been a problem for current host packages because they use darwin_ commands instead of build_darwin_ commands. But the current build_darwin_CC and build_darwin_CXX commands are still unnecessarily fragile, and incompatible with new native depends packages added in #18677.

Cory Fields (theuni) suggested in #16367 (comment) switching compiler from SDK clang to native clang (from $PATH) to avoid this problem. This is easy and makes a certain amount of sense for building native packages, as opposed to host packages. But Michael (fanquake) pointed out in #18677 (comment) that it would be inconsistent to switch to non-SDK compilers while still using other SDK tools like ranlib and install_name_tool. So simplest, minimal fix seems to be just adding the missing --sysroot option.

Catalina SDK clang stopped automatically searching the SDK include paths when
invoked without --sysroot:

bitcoin#16367 (comment)
Homebrew/homebrew-core#45061

This hasn't been a problem for current native depends packages because are
passing their own --sysroot values, and hasn't been a problem for current host
packages because they use `darwin_` commands instead of `build_darwin_`
commands.  But the current `build_darwin_CC` and `build_darwin_CXX` commands
are still unnecessarily fragile, and incompatible with new native depends
packages added in bitcoin#18677.

Cory Fields <cory-nospam-@coryfields.com> suggested in
bitcoin#16367 (comment) switching
compiler from SDK clang to native clang (from $PATH) to avoid this problem.
This is easy and makes a certain amount of sense for building native packages,
as opposed to host packages. But fanquake <fanquake@gmail.com> pointed out in
bitcoin#18677 (comment) that it
would be inconsistent use switch to non-SDK compilers while still using other
SDK tools like ranlib and install_name_tool. So simplest, minimal fix seems to
be just adding the missing --sysroot option.
@DrahtBot
Copy link
Contributor

DrahtBot commented Apr 23, 2020

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

No conflicts as of last run.

This was referenced Apr 23, 2020
@fanquake
Copy link
Member

Thanks for splitting this out. Will review.

@DrahtBot
Copy link
Contributor

Gitian builds

File commit 65276c7
(master)
commit 3eef5a8
(master and this pull)
bitcoin-0.20.99-aarch64-linux-gnu-debug.tar.gz 673ecc74f832f550... ef2da77636f77213...
bitcoin-0.20.99-aarch64-linux-gnu.tar.gz 8cacd39d9032cfa0... d518a16100bebac1...
bitcoin-0.20.99-arm-linux-gnueabihf-debug.tar.gz f33c821af966c7cc... 51517d70e1cc74c5...
bitcoin-0.20.99-arm-linux-gnueabihf.tar.gz 1610dfc4ad6edcc8... 3329784eeba74a35...
bitcoin-0.20.99-osx-unsigned.dmg d9b58fd52650821b... e90b4ef8b34de195...
bitcoin-0.20.99-osx64.tar.gz 2dd8003da396d8ff... efe0d7ad03802192...
bitcoin-0.20.99-riscv64-linux-gnu-debug.tar.gz 6ab423f10d0576b8... 159270fcefb99d2f...
bitcoin-0.20.99-riscv64-linux-gnu.tar.gz e2c3d277f9188905... 4c21230cb8e7bba6...
bitcoin-0.20.99-win64-debug.zip 920cfb921c277ab6... 17c821f355dbcb1e...
bitcoin-0.20.99-win64-setup-unsigned.exe 499d0e7e3d66123b... a740d57641934e69...
bitcoin-0.20.99-win64.zip b4c5466788c5ab31... e5cecb010a8761d0...
bitcoin-0.20.99-x86_64-linux-gnu-debug.tar.gz 771c49516716cf2f... 7a889fadc72217f6...
bitcoin-0.20.99-x86_64-linux-gnu.tar.gz 9baf50756b8e295a... dfb6d8c65626ce14...
bitcoin-0.20.99.tar.gz 20db243e4a63e9be... e6f760ab887255cb...
bitcoin-core-linux-0.21-res.yml 3764dafda91b4998... f87b786f87dc80d6...
bitcoin-core-osx-0.21-res.yml c908e4d8f612478d... 8328176b5a51f997...
bitcoin-core-win-0.21-res.yml 65a1ad714e6b7e4c... a301db7f0b7ab07d...
linux-build.log dbc67f519f1bc039... a5ca86f8bcf5ee20...
osx-build.log 680987f733987400... bceeff7bb568289d...
win-build.log 861910357a3af2e6... 11e069a64a7df2b8...
bitcoin-core-linux-0.21-res.yml.diff 8d65ed4c652db944...
bitcoin-core-osx-0.21-res.yml.diff 02b2959f25184b43...
bitcoin-core-win-0.21-res.yml.diff 8ff030c505315d26...
linux-build.log.diff 667d3b0264bc58d7...
osx-build.log.diff cd0fbf4e35269f82...
win-build.log.diff dab47fa63d28ec09...

@fanquake
Copy link
Member

fanquake commented Apr 27, 2020

ACK 1e94a2b - I think this change is ok, and I prefer it to the previous patch. Thanks for the summary in the PR description. I played around with Xcode and the CLT; I think previously I didn't fully grok the slight differences between the two.

This output was produced from a test.cpp containing just #include <stdlib.h>.

CLT Clang vs CLT Clang with -isysroot:

/Library/Developer/CommandLineTools/usr/bin/clang++ -c test.cpp -v
/Library/Developer/CommandLineTools/usr/bin/clang++ -c test.cpp -v -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

--- a.txt
+++ b.txt
@@ -1,17 +1,17 @@
 Apple clang version 11.0.3 (clang-1103.0.32.59)
 Target: x86_64-apple-darwin19.4.0
 Thread model: posix
 InstalledDir: /Library/Developer/CommandLineTools/usr/bin
- "/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.15.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name test.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mframe-pointer=all -fno-strict-return -masm-verbose -munwind-tables -target-cpu penryn -dwarf-column-info -debugger-tuning=lldb -target-linker-version 556.6 -v -coverage-notes-file /Users/michael/Desktop/clt/test.gcno -resource-dir /Library/Developer/CommandLineTools/usr/lib/clang/11.0.3 -stdlib=libc++ -internal-isystem /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1 -internal-isystem /usr/include/c++/v1 -internal-isystem /usr/local/include -internal-isystem /Library/Developer/CommandLineTools/usr/lib/clang/11.0.3/include -internal-externc-isystem /usr/include -internal-externc-isystem /Library/Developer/CommandLineTools/usr/include -Wno-objc-signed-char-bool-implicit-int-conversion -Wno-extra-semi-stmt -Wno-quoted-include-in-framework-header -fdeprecated-macro -fdebug-compilation-dir /Users/michael/Desktop/clt -ferror-limit 19 -fmessage-length 131 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fobjc-runtime=macosx-10.15.0 -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o test.o -x c++ test.cpp
+ "/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.15.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name test.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mframe-pointer=all -fno-strict-return -masm-verbose -munwind-tables -target-sdk-version=10.15.4 -target-cpu penryn -dwarf-column-info -debugger-tuning=lldb -target-linker-version 556.6 -v -coverage-notes-file /Users/michael/Desktop/clt/test.gcno -resource-dir /Library/Developer/CommandLineTools/usr/lib/clang/11.0.3 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -stdlib=libc++ -internal-isystem /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1 -internal-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1 -internal-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/local/include -internal-isystem /Library/Developer/CommandLineTools/usr/lib/clang/11.0.3/include -internal-externc-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -internal-externc-isystem /Library/Developer/CommandLineTools/usr/include -Wno-objc-signed-char-bool-implicit-int-conversion -Wno-extra-semi-stmt -Wno-quoted-include-in-framework-header -fdeprecated-macro -fdebug-compilation-dir /Users/michael/Desktop/clt -ferror-limit 19 -fmessage-length 131 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fobjc-runtime=macosx-10.15.0 -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o test.o -x c++ test.cpp
 clang -cc1 version 11.0.3 (clang-1103.0.32.59) default target x86_64-apple-darwin19.4.0
-ignoring nonexistent directory "/usr/include/c++/v1"
-ignoring nonexistent directory "/usr/include"
+ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1"
+ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/local/include"
+ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/Library/Frameworks"
 #include "..." search starts here:
 #include <...> search starts here:
  /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1
- /usr/local/include
  /Library/Developer/CommandLineTools/usr/lib/clang/11.0.3/include
+ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
  /Library/Developer/CommandLineTools/usr/include
- /System/Library/Frameworks (framework directory)
- /Library/Frameworks (framework directory)
+ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)
 End of search list.

When you pass -isysroot, to CLT Clang, /usr/local/include and /Library/Frameworks are dropped from the include search paths, and /usr/include is added. Note that -target-sdk-version=SDK_VERSION is also added to the compile flags.

CLT Clang -isysroot vs Xcode Clang:

Invoking CLT Clang with -isysroot is then seemingly equivalent to Xcode Clang, except for Xcode Clang additionally searching /usr/local/include.

/Library/Developer/CommandLineTools/usr/bin/clang++ -c test.cpp -v -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
clang++ -c test.cpp -v

-InstalledDir: /Library/Developer/CommandLineTools/usr/bin
- "/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.15.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name test.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mframe-pointer=all -fno-strict-return -masm-verbose -munwind-tables -target-sdk-version=10.15.4 -target-cpu penryn -dwarf-column-info -debugger-tuning=lldb -target-linker-version 556.6 -v -coverage-notes-file /Users/michael/Desktop/clt/test.gcno -resource-dir /Library/Developer/CommandLineTools/usr/lib/clang/11.0.3 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -stdlib=libc++ -internal-isystem /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1 -internal-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1 -internal-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/local/include -internal-isystem /Library/Developer/CommandLineTools/usr/lib/clang/11.0.3/include -internal-externc-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -internal-externc-isystem /Library/Developer/CommandLineTools/usr/include -Wno-objc-signed-char-bool-implicit-int-conversion -Wno-extra-semi-stmt -Wno-quoted-include-in-framework-header -fdeprecated-macro -fdebug-compilation-dir /Users/michael/Desktop/clt -ferror-limit 19 -fmessage-length 131 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fobjc-runtime=macosx-10.15.0 -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o test.o -x c++ test.cpp
+InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
+ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.15.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name test.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mframe-pointer=all -fno-strict-return -masm-verbose -munwind-tables -target-sdk-version=10.15.4 -target-cpu penryn -dwarf-column-info -debugger-tuning=lldb -target-linker-version 556.6 -v -coverage-notes-file /Users/michael/Desktop/clt/test.gcno -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -I/usr/local/include -stdlib=libc++ -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.3/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-objc-signed-char-bool-implicit-int-conversion -Wno-extra-semi-stmt -Wno-quoted-include-in-framework-header -fdeprecated-macro -fdebug-compilation-dir /Users/michael/Desktop/clt -ferror-limit 19 -fmessage-length 131 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fobjc-runtime=macosx-10.15.0 -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o test.o -x c++ test.cpp
 clang -cc1 version 11.0.3 (clang-1103.0.32.59) default target x86_64-apple-darwin19.4.0
-ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1"
-ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/local/include"
-ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/Library/Frameworks"
+ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1"
+ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include"
+ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks"
 #include "..." search starts here:
 #include <...> search starts here:
- /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1
- /Library/Developer/CommandLineTools/usr/lib/clang/11.0.3/include
- /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
- /Library/Developer/CommandLineTools/usr/include
- /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)
+ /usr/local/include
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.3/include
+ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
+ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)
 End of search list.

@dongcarl
Copy link
Contributor

Is /Library/Developer/CommandLineTools a symlink to /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain or vice versa?

@fanquake
Copy link
Member

Is /Library/Developer/CommandLineTools a symlink to /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain or vice versa?

No, they are standalone, and there are decent differences between the content of either. Xcode has a bunch more Swift modules, Apple simulator components and dylibs bundled with it. For example, you can see a diff of /Library/Developer/CommandLineTools/usr and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr here: https://gist.github.com/fanquake/22267d783ac76fbe3eba110d14433e7c.

The macOS SDKs inside either seem to be identical. i.e: diffoscope /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk --exclude-directory-metadata

@ryanofsky
Copy link
Contributor Author

ACK 1e94a2b - I think this change is ok, and I prefer it to the previous patch.

The current change 1e94a2b is the original fix I made for the issue before Cory's suggestion in #16367 (comment).

It seems safe and good. But Cory's suggestion to just use clang and presumably ld, nm, etc directly instead of going through an SDK for native packages (which are internal build & code generation tools not distributed or used at runtime) seems it should be a nice simplification and cleanup and more durable fix. I could be wrong but I'd assume a more typical way of building non-gui unix tools on mac is:

./configure
make
make install

and not:

./configure CC="$(shell xcrun -f clang) --sysroot $(shell xcrun --show-sdk-path)"
make
make install

My reason for going back to the direct bugfix 1e94a2b instead of my half-implementation fba09de of Cory suggestion is just that I know the direct fix works and I don't have a great way of testing other alternatives. But probably an extension of fba09de would be a better way to go in the long run.

@fanquake
Copy link
Member

fanquake commented May 2, 2020

@dongcarl did you have something specific you wanted to follow up with here in regards to the symlink query?

@dongcarl
Copy link
Contributor

dongcarl commented May 4, 2020

@fanquake No not really. My initial impression here is that we should remove all the xcrun invocations if we can, as doing that makes explicit we're expecting a standard toolchain for building (open source) applications from source. Will need to test that it works though.

@fanquake
Copy link
Member

fanquake commented May 7, 2020

@dongcarl Ok, lets follow up with that then. Want to open an issue to track? I'm going to merge this now to unblock Russ and #18677.

@fanquake fanquake merged commit 56611b0 into bitcoin:master May 7, 2020
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request May 12, 2020
…ompile flags

1e94a2b depends: Add --sysroot option to mac os native compile flags (Russell Yanofsky)

Pull request description:

  Catalina SDK clang stopped automatically searching the SDK include paths when invoked without `--sysroot`:

  - bitcoin#16367 (comment)
  - Homebrew/homebrew-core#45061

  This hasn't been a problem for current native depends packages because are passing their own `--sysroot` values, and hasn't been a problem for current host packages because they use `darwin_` commands instead of `build_darwin_` commands.  But the current `build_darwin_CC` and `build_darwin_CXX` commands are still unnecessarily fragile, and incompatible with new native depends packages added in bitcoin#18677.

  Cory Fields (theuni) suggested in bitcoin#16367 (comment) switching compiler from SDK clang to native clang (from $PATH) to avoid this problem. This is easy and makes a certain amount of sense for building native packages, as opposed to host packages. But Michael (fanquake) pointed out in bitcoin#18677 (comment) that it would be inconsistent to switch to non-SDK compilers while still using other SDK tools like `ranlib` and `install_name_tool`. So simplest, minimal fix seems to be just adding the missing `--sysroot` option.

ACKs for top commit:
  ryanofsky:
    > ACK [1e94a2b](bitcoin@1e94a2b) - I think this change is ok, and I prefer it to the previous patch.
  fanquake:
    ACK 1e94a2b - I think this change is ok, and I prefer it to the previous patch. Thanks for the summary in the PR description. I played around with Xcode and the CLT; I think previously I didn't fully grok the slight differences between the two.

Tree-SHA512: 4d4bbb7f49acb76d934a872a15b4e14f36290b508cb9e728815f959767ec174bcfb6d2ca7dcd995cc550d86980d64d4247ea5ecfca2301f0953006e50744fdb4
jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Sep 23, 2020
Summary:
```
Catalina SDK clang stopped automatically searching the SDK include paths
when invoked without --sysroot:

bitcoin/bitcoin#16367 (comment)
Homebrew/homebrew-core#45061

This hasn't been a problem for current native depends packages because
are passing their own --sysroot values, and hasn't been a problem for
current host packages because they use `darwin_` commands instead of
`build_darwin_` commands.  But the current `build_darwin_CC` and
`build_darwin_CXX` commands are still unnecessarily fragile, and
incompatible with new native depends packages added in
bitcoin/bitcoin#18677.

Cory Fields <cory-nospam-@coryfields.com> suggested in
bitcoin/bitcoin#16367 (comment)
switching compiler from SDK clang to native clang (from $PATH) to avoid
this problem. This is easy and makes a certain amount of sense for
building native packages, as opposed to host packages. But fanquake
<fanquake@gmail.com> pointed out in
bitcoin/bitcoin#18677 (comment) that
it would be inconsistent use switch to non-SDK compilers while still
using other SDK tools like ranlib and install_name_tool. So simplest,
minimal fix seems to be just adding the missing --sysroot option.
```

Backport of core [[bitcoin/bitcoin#18743 | PR18743]].
Note that it doesn't fix any real life problem for now.

Test Plan: Run the OSX Gitian build.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D7522
random-zebra added a commit to PIVX-Project/PIVX that referenced this pull request Jul 2, 2021
07f08d4 build: fix mutex detection when building bdb on macOS (fanquake)
07185c3 build: use -isysroot over --sysroot on macOS (fanquake)
424ea09 depends: Add --sysroot option to mac os native compile flags (Russell Yanofsky)

Pull request description:

  Fixing macOS depends builds, solving #2456 issue.
  Back porting:
  * bitcoin#18743.
  * bitcoin#20195.
  * bitcoin#21793.

ACKs for top commit:
  Fuzzbawls:
    ACK 07f08d4
  random-zebra:
    utACK 07f08d4 and merging...

Tree-SHA512: 2de72a30e8bdfad582b303993eff8384e74d3699992695d6d7a6ec14f0e40898e7e1d70fc6e6a74318eaf21d5e312c346748a4a5986f1f29aa149150e30bdb3f
kwvg added a commit to kwvg/dash that referenced this pull request Jul 15, 2021
kwvg added a commit to kwvg/dash that referenced this pull request Jul 15, 2021
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request Jul 19, 2021
…ompile flags

1e94a2b depends: Add --sysroot option to mac os native compile flags (Russell Yanofsky)

Pull request description:

  Catalina SDK clang stopped automatically searching the SDK include paths when invoked without `--sysroot`:

  - bitcoin#16367 (comment)
  - Homebrew/homebrew-core#45061

  This hasn't been a problem for current native depends packages because are passing their own `--sysroot` values, and hasn't been a problem for current host packages because they use `darwin_` commands instead of `build_darwin_` commands.  But the current `build_darwin_CC` and `build_darwin_CXX` commands are still unnecessarily fragile, and incompatible with new native depends packages added in bitcoin#18677.

  Cory Fields (theuni) suggested in bitcoin#16367 (comment) switching compiler from SDK clang to native clang (from $PATH) to avoid this problem. This is easy and makes a certain amount of sense for building native packages, as opposed to host packages. But Michael (fanquake) pointed out in bitcoin#18677 (comment) that it would be inconsistent to switch to non-SDK compilers while still using other SDK tools like `ranlib` and `install_name_tool`. So simplest, minimal fix seems to be just adding the missing `--sysroot` option.

ACKs for top commit:
  ryanofsky:
    > ACK [1e94a2b](bitcoin@1e94a2b) - I think this change is ok, and I prefer it to the previous patch.
  fanquake:
    ACK 1e94a2b - I think this change is ok, and I prefer it to the previous patch. Thanks for the summary in the PR description. I played around with Xcode and the CLT; I think previously I didn't fully grok the slight differences between the two.

Tree-SHA512: 4d4bbb7f49acb76d934a872a15b4e14f36290b508cb9e728815f959767ec174bcfb6d2ca7dcd995cc550d86980d64d4247ea5ecfca2301f0953006e50744fdb4
UdjinM6 added a commit to dashpay/dash that referenced this pull request Jul 19, 2021
Merge bitcoin#18743: depends: Add --sysroot option to mac os native compile flags
kwvg added a commit to kwvg/dash that referenced this pull request Jul 20, 2021
kwvg added a commit to kwvg/dash that referenced this pull request Jul 20, 2021
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants