ld64 build for Linux - EXPERIMENT for using Mach-Os for Darling's libs
Go to file
Martin Storsjö b909882f93 Fix the logic for the default fallback sdk version in ld64
The apple case for the default uses sysctl to get the kernel
version, which is a version number like 18.7.0, where the major
version, minus 4, is used for setting the minor version of
the macOS version number, translating 18.7.0 into 10.14.

The previous ld64-port specific case of trying to hardcode 10.5,
just ends up parsed as kernel version 10, i.e. 10.6, regardless of
which version the default string is set to.

Instead of passing the cctools/ld64-port specific default to the
kernel version parsing logic, just set the result of
parseVersionNumber32 as the version number.

Change the default to 10.6, which is what actually was set before
in practice.
2020-04-13 12:36:14 +03:00
cctools Fix the logic for the default fallback sdk version in ld64 2020-04-13 12:36:14 +03:00
tools Update fix_liblto.sh (for otool) 2020-03-24 12:42:18 +01:00
usage_examples/ios_toolchain Fixes to make cctools and ld64 work on Android 2019-11-06 17:54:58 +01:00
.gitignore cctools: make is_llvm_bitcode() more portable (fixes -flto with multiple -arch flags) 2014-02-15 14:54:10 +01:00
.travis.yml Merge pull request #67 from fanquake/sudo_deprecated 2019-06-04 15:19:18 +02:00
package.sh * linux ppc/ppc64 & arm/arm64/aarch64 port 2015-03-15 22:21:16 +01:00
README.md Update README.md 2020-03-20 13:35:53 +01:00

Apple cctools and ld64 port for Linux, *BSD and macOS

Current Version: cctools: 949.0.1, ld64: 512.4.
Originally ported by cjacker.

SUPPORTED HOSTS

SUPPORTED OPERATING SYSTEMS:

Linux, Android (Termux), FreeBSD,
Mac OS X, iOS, OpenBSD and NetBSD

SUPPORTED HOST ARCHITECTURES:

x86, x86_64, arm, arm64/aarch64

SUPPORTED TARGET ARCHITECTURES

armv6, armv7, armv7s, arm64, arm64e,
arm64_32 (untested), i386, x86_64, x86_64h,
armv6m, armv7k, armv7m and armv7em

arm64e requires Apple LLVM/Clang.

SUPPORTED TARGET OPERATING SYSTEMS

macOS, iOS, tvOS, watchOS, bridgeOS, Mac Catalyst,
iOS Simluator, watchOS Simulator, DriverKit

Not all of the targets have been tested.

DEPENDENCIES

Clang 3.4+

SDKs with .tdb stubs (>= Xcode 7) require the TAPI library to be installed.
=> https://github.com/tpoechtrager/apple-libtapi

musl-libc based systems require the musl-fts library to be installed. => https://github.com/pullmoll/musl-fts

Optional, but recommended:

llvm-devel (For Link Time Optimization Support)
uuid-devel (For ld64 -random_uuid Support)
llvm-devel + xar-devel (For ld64 -bitcode_bundle Support)

You can find xar here.
Do not install libxar-dev on Ubuntu, it's a different package.

INSTALLATION

Install Apple's TAPI library:

This step is only required if you intend to use SDKs with .tdb stubs.

git clone https://github.com/tpoechtrager/apple-libtapi.git
cd apple-libtapi
[INSTALLPREFIX=/home/user/cctools] ./build.sh
./install.sh

Install cctools and ld64:

git clone https://github.com/tpoechtrager/cctools-port.git
cd cctools-port/cctools
./configure \
    [--prefix=/home/user/cctools] \
    [--with-libtapi=/home/user/cctools] \
    [--target=<target>] \
    [--with-llvm-config=...]
make
make install

target = i386-apple-darwin11, x86_64-apple-darwin11, arm-apple-darwin11, ...

If you get compile errors because of unistd.h, then please run
../tools/fix_unistd_issue.sh and restart compiling.

TRAVIS CI

Build Status