mirror of
https://github.com/Relintai/osxcross.git
synced 2025-02-03 22:45:56 +01:00
* Update README
* Update ChangeLog * Mac OS X -> macOS
This commit is contained in:
parent
5489149683
commit
536dc13153
14
CHANGELOG
14
CHANGELOG
@ -1,3 +1,11 @@
|
||||
/****************************** v1.3 *********************************/
|
||||
|
||||
Added:
|
||||
* Support for arm64 and arm64e targets
|
||||
|
||||
Changed:
|
||||
* Updated TAPI library to 1100.0.11
|
||||
|
||||
/****************************** v1.2 *********************************/
|
||||
|
||||
Added:
|
||||
@ -25,7 +33,7 @@ Changed:
|
||||
|
||||
Added:
|
||||
* Support for TAPIv3 stubs (including "zippering" target)
|
||||
* Support for Mac OS X SDKs up to 10.15
|
||||
* Support for macOS SDKs up to 10.15
|
||||
* SDK packaging script for ".xip" Xcode images
|
||||
-> tools/gen_sdk_package_pbzx.sh <xcode.xip>
|
||||
--> tested up to Xcode 10.2.1
|
||||
@ -156,7 +164,7 @@ Added:
|
||||
* '-stdlib=' support for GCC (as an extension through the wrapper)
|
||||
* 'OSXCROSS_C_STANDARD' env var (set C standard globally)
|
||||
* 'OSXCROSS_CXX_STANDARD' env var (set C++ standard globally)
|
||||
* OS X support (as host)
|
||||
* macOS support (as host)
|
||||
|
||||
Changed:
|
||||
* 'osxcross-conf', 'osxcross-env' and the (fake) 'dsymutil' are now
|
||||
@ -216,7 +224,7 @@ Changed:
|
||||
* Updated cctools to 839 with ld64-134.9
|
||||
|
||||
Fixed:
|
||||
* Check if MacOSX package is present in tarballs
|
||||
* Check if macOS package is present in tarballs
|
||||
|
||||
/******************************* v0.1 *******************************/
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
### Requirements: ###
|
||||
|
||||
* llvm-dsymutil (>= 3.8)
|
||||
* A Mac OS X system with lldb / gdb installed
|
||||
* A macOS system with lldb / gdb installed
|
||||
|
||||
### Setting up llvm-dsymutil: ###
|
||||
|
||||
@ -18,5 +18,5 @@ Run `./build_llvm_dsymutil.sh` to build and install llvm-dsymutil to target/bin.
|
||||
* [LTO only] Add `-Wl,-object_path_lto,lto.o` to the linker flags
|
||||
* After linking run: `dsymutil binary`
|
||||
* [Optional] Strip the binary: `x86_64-apple-darwinXX-strip binary`
|
||||
* Copy the binary **and** the created `<binary>.dSYM` "folder" onto the target Mac OS X system
|
||||
* Copy the binary **and** the created `<binary>.dSYM` "folder" onto the target macOS system
|
||||
* Debug the binary as usual
|
||||
|
67
README.md
67
README.md
@ -1,37 +1,42 @@
|
||||
## OS X Cross toolchain for Linux and FreeBSD ##
|
||||
|
||||
## macOS Cross toolchain for Linux and FreeBSD ##
|
||||
|
||||
### WHAT IS THE GOAL OF OSXCROSS? ###
|
||||
|
||||
The goal of OSXCross is to provide a well working OS X cross toolchain for
|
||||
The goal of OSXCross is to provide a well working macOS cross toolchain for
|
||||
Linux, FreeBSD, OpenBSD and Android (Termux).
|
||||
|
||||
OSXCross works **on** x86, x86_64, ARM and AArch64.
|
||||
OSXCross works **on** `x86`, `x86_64`, `arm` and `AArch64`/`arm64`
|
||||
and is able to **target** `arm64`, `arm64e`, `x86_64`, `x86_64h`, and `i386`.
|
||||
|
||||
`arm64` requires macOS 12 SDK (or later).
|
||||
`arm64e` [requires a recent Apple clang compiler.](https://github.com/apple/llvm-project)
|
||||
|
||||
### HOW DOES IT WORK? ###
|
||||
|
||||
For cross-compiling for OS X you need
|
||||
For cross-compiling for macOS you need
|
||||
* the Clang/LLVM compiler
|
||||
* the cctools (lipo, otool, nm, ar, ...) and ld64
|
||||
* the OSX SDK.
|
||||
* the macOS SDK.
|
||||
|
||||
[Clang/LLVM is a cross compiler by default](http://clang.llvm.org/docs/CrossCompilation.html)
|
||||
and is now available on nearly every Linux distribution, so we just
|
||||
need a proper [port](https://github.com/tpoechtrager/cctools-port) of
|
||||
the cctools/ld64 and the OS X SDK.
|
||||
the cctools/ld64 and the macOS SDK.
|
||||
|
||||
OSXCross includes a collection of scripts for preparing the SDK and
|
||||
building the cctools/ld64.
|
||||
|
||||
It also includes scripts for optionally building
|
||||
* Clang using gcc (for the case your distribution does not include it),
|
||||
* an up-to-date vanilla GCC as a cross-compiler for target OS X,
|
||||
* an up-to-date vanilla GCC as a cross-compiler for target macOS,
|
||||
* the "compiler-rt" runtime library, and
|
||||
* the `llvm-dsymutil` tool required for debugging.
|
||||
|
||||
|
||||
### WHAT CAN I BUILD WITH IT? ###
|
||||
### WHAT CAN BE BUILT WITH IT? ###
|
||||
|
||||
Basically everything you can build on OS X with clang/gcc should build with
|
||||
Basically everything you can build on macOS with clang/gcc should build with
|
||||
this cross toolchain as well.
|
||||
|
||||
### PACKET MANAGERS ###
|
||||
@ -69,7 +74,7 @@ On Ubuntu trusty you must upgrade CMake to >= 3.2.3 first. Or do this:
|
||||
##### Building Clang #####
|
||||
|
||||
OSXCross uses `clang` as the default compiler for building its tools, and also
|
||||
as a cross-compiler to create OSX binaries.
|
||||
as a cross-compiler to create macOS binaries.
|
||||
|
||||
In `clang` there is no difference between cross-compilation and native
|
||||
compilation, so OSXCross can use a normal `clang` install for both. You can
|
||||
@ -154,7 +159,7 @@ use these variants unless you know what you're doing.
|
||||
**[Please ensure you have read and understood the Xcode license
|
||||
terms before continuing.](https://www.apple.com/legal/sla/docs/xcode.pdf)**
|
||||
|
||||
##### Packaging the SDK on Mac OS X: #####
|
||||
##### Packaging the SDK on macOS: #####
|
||||
|
||||
1. [Download Xcode: https://developer.apple.com/download/more] \*\*
|
||||
2. [Mount Xcode.dmg (Open With -> DiskImageMounter) \*\*\*]
|
||||
@ -178,21 +183,21 @@ Step 1. and 2. can be skipped if you have Xcode installed.
|
||||
This method may require up to 25 GB of free disk space.
|
||||
An SSD is recommended for this method.
|
||||
|
||||
1. Download Xcode like described in 'Packaging the SDK on Mac OS X'
|
||||
1. Download Xcode like described in 'Packaging the SDK on macOS'
|
||||
2. Install `clang`, `make`, `libssl-devel`, `lzma-devel` and `libxml2-devel`
|
||||
3. Run `./tools/gen_sdk_package_pbzx.sh <xcode>.xip`
|
||||
4. Copy or move the SDK into the tarballs/ directory
|
||||
|
||||
##### Packing the SDK on Linux - Method 2 (works up to Xcode 7.3): #####
|
||||
|
||||
1. Download Xcode like described in 'Packaging the SDK on Mac OS X'
|
||||
1. Download Xcode like described in 'Packaging the SDK on macOS'
|
||||
2. Install `cmake`, `libxml2-dev` and `fuse`
|
||||
3. Run `./tools/gen_sdk_package_darling_dmg.sh <xcode>.dmg`
|
||||
4. Copy or move the SDK into the tarballs/ directory
|
||||
|
||||
##### Packing the SDK on Linux (and others) - Method 3 (works up to Xcode 7.2): #####
|
||||
|
||||
1. Download Xcode like described in 'Packaging the SDK on Mac OS X'
|
||||
1. Download Xcode like described in 'Packaging the SDK on macOS'
|
||||
2. Ensure you have `clang` and `make` installed
|
||||
3. Run `./tools/gen_sdk_package_p7zip.sh <xcode>.dmg`
|
||||
4. Copy or move the SDK into the tarballs/ directory
|
||||
@ -211,6 +216,8 @@ An SSD is recommended for this method.
|
||||
|
||||
##### Example. To compile a file called test.cpp, you can run: #####
|
||||
|
||||
## x86 ##
|
||||
|
||||
* Clang:
|
||||
|
||||
* 32 bit: `o32-clang++ test.cpp -O3 -o test` OR
|
||||
@ -225,6 +232,16 @@ An SSD is recommended for this method.
|
||||
* 64 bit: `o64-g++ test.cpp -O3 -o test` OR
|
||||
`x86_64-apple-darwinXX-g++ test.cpp -O3 -o test`
|
||||
|
||||
## ARM ##
|
||||
|
||||
* Clang:
|
||||
|
||||
* arm64: `oa64-clang++ test.cpp -O3 -o test` OR
|
||||
`arm64-apple-darwinXX-clang++ test.cpp -O3 -o test`
|
||||
* arm64e: `oa64e-clang++ test.cpp -O3 -o test` OR
|
||||
`arm64e-apple-darwinXX-clang++ test.cpp -O3 -o test`
|
||||
|
||||
|
||||
XX= the target version, you can find it out by running `osxcross-conf` and
|
||||
then see `TARGET`.
|
||||
|
||||
@ -244,8 +261,8 @@ which you prefer.
|
||||
|
||||
##### Building test.cpp with libc++: #####
|
||||
|
||||
Note: libc++ requires Mac OS X 10.7 or newer! If you really need C++11 for
|
||||
an older OS X version, then you can do the following:
|
||||
Note: libc++ requires macOS 10.7 or later! If you really need C++11 for
|
||||
an older macOS version, then you can do the following:
|
||||
|
||||
1. Build GCC so you have an up-to-date libstdc++
|
||||
2. Build your source code with GCC or
|
||||
@ -259,22 +276,22 @@ Usage Examples:
|
||||
* C++11: `o32-clang++ -stdlib=libc++ -std=c++11 test1.cpp -o test`
|
||||
* C++14: `o32-clang++ -stdlib=libc++ -std=c++14 test1.cpp -o test`
|
||||
* C++17: `o32-clang++ -stdlib=libc++ -std=c++17 test1.cpp -o test`
|
||||
* C++2a: `o32-clang++ -stdlib=libc++ -std=c++2a test1.cpp -o test`
|
||||
* C++2a: `o32-clang++ -stdlib=libc++ -std=c++20 test1.cpp -o test`
|
||||
|
||||
* Clang (shortcut):
|
||||
|
||||
* C++98: `o32-clang++-libc++ -std=c++98 test.cpp -o test`
|
||||
* C++11: `o32-clang++-libc++ -std=c++11 test.cpp -o test`
|
||||
* C++14: `o32-clang++-libc++ -std=c++14 test.cpp -o test`
|
||||
* C++17: `o32-clang++-libc++ -std=c++17 test.cpp -o test`
|
||||
* C++2a: `o32-clang++-libc++ -std=c++2a test.cpp -o test`
|
||||
* C++14: `o32-clang++-libc++ -std=c++14 test.cpp -o test`
|
||||
* C++17: `o32-clang++-libc++ -std=c++17 test.cpp -o test`
|
||||
* C++2a: `o32-clang++-libc++ -std=c++20 test.cpp -o test`
|
||||
|
||||
* GCC
|
||||
|
||||
* C++11: `o32-g++-libc++ -std=c++11 test.cpp`
|
||||
* C++14: `o32-g++-libc++ -std=c++14 test.cpp -o test`
|
||||
* C++17: `o32-g++-libc++ -std=c++17 test.cpp -o test`
|
||||
* C++2a: `o32-g++-libc++ -std=c++2a test.cpp -o test`
|
||||
* C++2a: `o32-g++-libc++ -std=c++20 test.cpp -o test`
|
||||
|
||||
##### Building test1.cpp and test2.cpp with LTO (Link Time Optimization): #####
|
||||
|
||||
@ -296,8 +313,8 @@ Usage Examples:
|
||||
|
||||
The default deployment target is:
|
||||
|
||||
SDK <= 10.13: `Mac OS X 10.6`
|
||||
SDK >= 10.14: `Mac OS X 10.9`
|
||||
SDK <= 10.13: `macOS 10.6`
|
||||
SDK >= 10.14: `macOS 10.9`
|
||||
|
||||
However, there are several ways to override the default value:
|
||||
|
||||
@ -308,13 +325,13 @@ However, there are several ways to override the default value:
|
||||
\>= 10.9 also defaults to `libc++` instead of `libstdc++`, this behavior
|
||||
can be overriden by explicitly passing `-stdlib=libstdc++` to clang.
|
||||
|
||||
x86\_64h defaults to `Mac OS X 10.8` and requires clang 3.5+.
|
||||
x86\_64h defaults to `macOS 10.8` and requires clang 3.5+.
|
||||
x86\_64h = x86\_64 with optimizations for the Intel Haswell Architecture.
|
||||
|
||||
### PROJECTS USING OSXCROSS: ###
|
||||
|
||||
* [multiarch/crossbuild](https://github.com/multiarch/crossbuild): various
|
||||
cross-compilers (**Systems**: Linux, OS X, Windows, **Archs**: x86\_64,
|
||||
cross-compilers (**Systems**: Linux, macOS, Windows, **Archs**: x86\_64,
|
||||
i386, arm, ppc, mips) in Docker. OSXCross powers the Darwin builds.
|
||||
* [Smartmontools](https://www.smartmontools.org)
|
||||
|
||||
|
8
build.sh
8
build.sh
@ -44,7 +44,7 @@ case $SDK_VERSION in
|
||||
*) echo "Unsupported SDK"; exit 1 ;;
|
||||
esac
|
||||
|
||||
# Minimum targeted OS X version
|
||||
# Minimum targeted macOS version
|
||||
# Must be <= SDK_VERSION
|
||||
if [ -n "$OSX_VERSION_MIN_INT" -a -z "$OSX_VERSION_MIN" ]; then
|
||||
OSX_VERSION_MIN=$OSX_VERSION_MIN_INT
|
||||
@ -55,8 +55,8 @@ export TARGET
|
||||
echo ""
|
||||
echo "Building OSXCross toolchain, Version: $VERSION"
|
||||
echo ""
|
||||
echo "OS X SDK Version: $SDK_VERSION, Target: $TARGET"
|
||||
echo "Minimum targeted OS X Version: $OSX_VERSION_MIN"
|
||||
echo "macOS SDK Version: $SDK_VERSION, Target: $TARGET"
|
||||
echo "Minimum targeted macOS Version: $OSX_VERSION_MIN"
|
||||
echo "Tarball Directory: $TARBALL_DIR"
|
||||
echo "Build Directory: $BUILD_DIR"
|
||||
echo "Install Directory: $TARGET_DIR"
|
||||
@ -287,7 +287,7 @@ if [ $(osxcross-cmp $SDK_VERSION ">=" 10.7) -eq 1 ]; then
|
||||
echo -n "Given SDK does not contain libc++ headers "
|
||||
echo "(-stdlib=libc++ test may fail)"
|
||||
echo -n "You may want to re-package your SDK using "
|
||||
echo "'tools/gen_sdk_package.sh' on OS X"
|
||||
echo "'tools/gen_sdk_package.sh' on macOS"
|
||||
fi
|
||||
if [ -f "usr/include/c++/v1/__hash_table" ]; then
|
||||
if [ $(osxcross-cmp $SDK_VERSION ">=" 10.7) -eq 1 ]; then
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Build and install the GNU binutils and the GNU Debugger (gdb) for
|
||||
# target OS X.
|
||||
# target macOS.
|
||||
#
|
||||
# You may want to run this script if you want to build software using
|
||||
# gcc. Please refer to the README.md for details.
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Package the OS X SDKs into a tar file to be used by `build.sh`.
|
||||
# Package the macOS SDKs into a tar file to be used by `build.sh`.
|
||||
#
|
||||
|
||||
export LC_ALL=C
|
||||
@ -84,7 +84,7 @@ function set_xcode_dir()
|
||||
|
||||
if [ $(uname -s) != "Darwin" ]; then
|
||||
if [ -z "$XCODEDIR" ]; then
|
||||
echo "This script must be run on OS X" 1>&2
|
||||
echo "This script must be run on macOS" 1>&2
|
||||
echo "... Or with XCODEDIR=... on Linux" 1>&2
|
||||
exit 1
|
||||
else
|
||||
|
@ -13,7 +13,7 @@ pushd "${0%/*}/.." &>/dev/null
|
||||
source tools/tools.sh
|
||||
|
||||
if [ $PLATFORM == "Darwin" ]; then
|
||||
echo "Use gen_sdk_package.sh on Mac OS X" 1>&2
|
||||
echo "Use gen_sdk_package.sh on macOS" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -12,7 +12,7 @@ pushd "${0%/*}/.." &>/dev/null
|
||||
source tools/tools.sh
|
||||
|
||||
if [ $PLATFORM == "Darwin" ]; then
|
||||
echo "Use gen_sdk_package.sh on Mac OS X" 1>&2
|
||||
echo "Use gen_sdk_package.sh on macOS" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -6,7 +6,7 @@ source tools/tools.sh
|
||||
require cpio
|
||||
|
||||
if [ $PLATFORM == "Darwin" ]; then
|
||||
echo "Use gen_sdk_package.sh on Mac OS X" 1>&2
|
||||
echo "Use gen_sdk_package.sh on macOS" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -127,7 +127,7 @@ int sdk(Target*, char **argv) {
|
||||
|
||||
// Ignore empty argument.
|
||||
if (SDK[0]) {
|
||||
err << "xcrun: '-sdk': expected Mac OS X SDK" << err.endl();
|
||||
err << "xcrun: '-sdk': expected macOS SDK" << err.endl();
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -158,7 +158,7 @@ bool Target::getSDKPath(std::string &path, bool MacOSX10_16Fix) const {
|
||||
if (SDKVer == OSVersion(11, 0) && !MacOSX10_16Fix)
|
||||
return getSDKPath(path, true);
|
||||
|
||||
err << "cannot find Mac OS X SDK (expected in: " << path << ")"
|
||||
err << "cannot find macOS SDK (expected in: " << path << ")"
|
||||
<< err.endl();
|
||||
|
||||
return false;
|
||||
@ -531,14 +531,14 @@ bool Target::setup() {
|
||||
if (RequiredSDK.lower) {
|
||||
if (SDKOSNum > RequiredSDK.SDKVer) {
|
||||
err << "Architecture '" << getArchName(RequiredSDK.arch) << "' requires "
|
||||
<< "Mac OS X <= '" << RequiredSDK.SDKVer.shortStr() << "' SDK"
|
||||
<< "macOS " << RequiredSDK.SDKVer.shortStr() << " SDK (or earlier)"
|
||||
<< err.endl();
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (SDKOSNum < RequiredSDK.SDKVer) {
|
||||
err << "Architecture '" << getArchName(RequiredSDK.arch) << "' requires "
|
||||
<< "Mac OS X >= '" << RequiredSDK.SDKVer.shortStr() << "' SDK"
|
||||
<< "macOS " << RequiredSDK.SDKVer.shortStr() << " SDK (or later)"
|
||||
<< err.endl();
|
||||
return false;
|
||||
}
|
||||
@ -577,7 +577,7 @@ bool Target::setup() {
|
||||
}
|
||||
} else if (stdlib == StdLib::libcxx) {
|
||||
if (!hasLibCXX()) {
|
||||
err << "libc++ requires Mac OS X SDK 10.7 (or later)" << err.endl();
|
||||
err << "libc++ requires macOS SDK 10.7 (or later)" << err.endl();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -590,24 +590,24 @@ bool Target::setup() {
|
||||
|
||||
if (SDKOSNum >= OSVersion(10, 14)) {
|
||||
if (!isGCC() && !usegcclibs && stdlib == StdLib::libstdcxx) {
|
||||
err << "Mac OS X SDK '>= 10.14' does not support libstdc++ anymore"
|
||||
err << "macOS SDK '>= 10.14' does not support libstdc++ anymore"
|
||||
<< err.endl();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (haveArch(Arch::i386)) {
|
||||
err << "Mac OS X SDK '>= 10.14' does not support i386 anymore"
|
||||
err << "macOS SDK '>= 10.14' does not support i386 anymore"
|
||||
<< err.endl();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (OSNum > SDKOSNum) {
|
||||
err << "targeted OS X version must be <= " << SDKOSNum.Str() << " (SDK)"
|
||||
err << "targeted macOS version must be <= " << SDKOSNum.Str() << " (SDK)"
|
||||
<< err.endl();
|
||||
return false;
|
||||
} else if (OSNum < OSVersion(10, 4)) {
|
||||
err << "targeted OS X version must be >= 10.4" << err.endl();
|
||||
err << "targeted macOS version must be >= 10.4" << err.endl();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -899,13 +899,13 @@ bool Target::setup() {
|
||||
bool nowarning = false;
|
||||
|
||||
if (isgcclibstdcxx) {
|
||||
err << "building for OS X '<= 10.5' with GCC (or clang++-gstdc++) "
|
||||
err << "building for macOS '<= 10.5' with GCC (or clang++-gstdc++) "
|
||||
"is no longer supported" << err.endl();
|
||||
error = true;
|
||||
} else if (isClang()) {
|
||||
nowarning = !!getenv("OSXCROSS_NO_10_5_DEPRECATION_WARNING");
|
||||
if (!nowarning)
|
||||
warn << "building for OS X '<= 10.5' "
|
||||
warn << "building for macOS '<= 10.5' "
|
||||
"is no longer supported" << warn.endl();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user