Being able to extract SDKs from Command Line Tools for Xcode instead
of the full Xcode package saves bandwidth, disk space, and time.
Two scripts are added:
* tools/gen_sdk_package_tools.sh: extracts SDKs from installed
Command Line Tools on macOS (/Library/Developer/CommandLineTools)
or from a path specified via XCODE_TOOLS_DIR
* tools/gen_sdk_package_tools_dmg.sh: unpacks the content of provided
Command_Line_Tools_for_Xcode.dmg and extracts SDKs via the above
script.
Tested with Command Line Tools for Xcode 12.x.
To get a completely env independent setup we may want to install
Clang/LLVM to the target folder as well. So let's allow user
to do it in a scripted way just adding ENABLE_CLANG_INSTALL=1
for execution string.
There're quite a few mirrors where GNU software might be found.
Though there're some problems with them:
1. There's no guarantee any random mirror will be still up tomorrow
2. For mere mortal it's not clear how credible if xxx-yyy-zzz.org
in a sense that either tarball with sources might be corrupted
unintentionally or even with some bad intentions.
One solution here might be calculation of checksum but still
as long as the main "FTP" storage of GNU project is up there's
not much sense in using a _hard-coded_ mirror.
Unfortunately snapshots of GCC are not hosted at https://ftp.gnu.org/,
so keeping https://mirror.koddos.net for now.
With C++14 the following error happens on CentOS 7.x:
==================================
$ clang++ -std=c++1y -Wall -Wextra -pedantic -Wno-missing-field-initializers \
-I. -O2 -DOSXCROSS_VERSION="\"1.2\"" -DOSXCROSS_TARGET="\"darwin14\"" \
-DOSXCROSS_OSX_VERSION_MIN="\"10.6\"" -DOSXCROSS_LINKER_VERSION="\"530\"" \
-DOSXCROSS_LIBLTO_PATH="\"/usr/lib64/llvm\"" \
-DOSXCROSS_BUILD_DIR="\"/osxcross/build\"" -isystem quirks/include \
-c -o target.o target.cpp
In file included from target.cpp:24:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/iostream:39:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/ostream:38:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/ios:42:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/ios_base.h:41:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/locale_classes.h:40:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/string:52:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/basic_string.h:2815:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/ext/string_conversions.h:43:
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/cstdio:120:11: error: no member named 'gets' in the global namespace
using ::gets;
~~^
1 error generated.
==================================
That's a known issue with older C++ headers, see https://bugs.llvm.org/show_bug.cgi?id=30277
With C++11 we then get another problem:
==================================
$ clang++ -std=c++0x -Wall -Wextra -pedantic -Wno-missing-field-initializers \
-I. -O2 -DOSXCROSS_VERSION="\"1.2\"" -DOSXCROSS_TARGET="\"darwin14\"" \
-DOSXCROSS_OSX_VERSION_MIN="\"10.6\"" -DOSXCROSS_LINKER_VERSION="\"530\"" \
-DOSXCROSS_LIBLTO_PATH="\"/usr/lib64/llvm\"" \
-DOSXCROSS_BUILD_DIR="\"/osxcross/build\"" -isystem quirks/include \
-c -o programs/osxcross-conf.o programs/osxcross-conf.cpp
programs/osxcross-conf.cpp:50:49: error: 'auto' not allowed in lambda parameter
static auto print = [](const char *var, const auto &val) {
^~~~
programs/osxcross-conf.cpp:50:55: warning: unused parameter 'val' [-Wunused-parameter]
static auto print = [](const char *var, const auto &val) {
^
programs/osxcross-conf.cpp:54:3: error: no matching function for call to object of type '<lambda at programs/osxcross-conf.cpp:50:23>'
print("VERSION", getOSXCrossVersion());
==================================
That last issue requires a move from a lambda to more ugly
template solution. But in the end we get all built!
* build_compiler_rt.sh: Change git repository. The llvm.org one is no longer synced.
* build_compiler_rt.sh: Add check for os/lock.h.
* xcrun: "Support" -show-sdk-platform-path.
* sw_vers: Output 0CFFFF for Build Version.