Source note: https://stackoverflow.com/a/76183280/9363996
Goal: cross-build the omnirefl tool for macOS from the Alpine build image.
-
Existing osxcross images are available on Docker Hub.
liushuyu/osxcross:latestwas inspected.- It contains
/opt/osxcross/SDK/MacOSX10.14.sdk. - It contains
o64-clang,x86_64-apple-darwin18-*,ld64,lipo,install_name_tool, and related cctools. - It is old: created in 2020, Clang 10, Darwin18/x86_64 oriented.
- It bundles an Apple SDK, so it has the same SDK redistribution concern.
- Treat as a reference/probe image, not a release base.
-
Darling has an SDK-like open-source tree.
- Repo: https://github.com/darlinghq/darling
- Path:
Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk - C/POSIX headers are present.
libSystem.dylibis a symlink into Darling build output.- No
.tbdstubs were found in the repo tree. - Not a drop-in SDK for release binaries, but useful for research.
-
Apple open-source Darwin components are not a complete macOS SDK.
- Repo: https://github.com/apple-oss-distributions/distribution-macOS
- Useful source drops, not a packaged sysroot.
- Apple SDK/sysroot
MacOSX.sdkextracted from Xcode.- Not an Alpine package; must be imported from a Mac/Xcode install.
-
MacOSX.sdk- install: cannot be installed from Alpine packages
- build: cannot be built from open source; copy/extract from Xcode or Apple Command Line Tools
-
clang- install: Alpine
clang21/ existing prebuilt LLVM image layer - build: https://github.com/llvm/llvm-project
- install: Alpine
-
llvm-config- install: existing prebuilt LLVM image layer
- build: https://github.com/llvm/llvm-project
-
lld- install: Alpine
lld21 - build: https://github.com/llvm/llvm-project
- install: Alpine
-
libc++headers- install: existing generated LLVM runtimes headers in the image
- build: https://github.com/llvm/llvm-project/tree/main/runtimes
-
apple-libtapi- install: not available from Alpine packages
- build: https://github.com/tpoechtrager/apple-libtapi
-
xar- install: Alpine
xar - build: https://github.com/tpoechtrager/xar
- install: Alpine
-
cctools-port- install: not available from Alpine packages
- build: https://github.com/tpoechtrager/cctools-port
-
ld- install: built/installed by
cctools-port - build: https://github.com/tpoechtrager/cctools-port
- install: built/installed by
-
ar- install: built/installed by
cctools-port - build: https://github.com/tpoechtrager/cctools-port
- install: built/installed by
-
ranlib- install: built/installed by
cctools-port - build: https://github.com/tpoechtrager/cctools-port
- install: built/installed by
-
strip- install: built/installed by
cctools-port - build: https://github.com/tpoechtrager/cctools-port
- install: built/installed by
-
libtool- install: built/installed by
cctools-port - build: https://github.com/tpoechtrager/cctools-port
- install: built/installed by
-
lipo- install: built/installed by
cctools-port - build: https://github.com/tpoechtrager/cctools-port
- install: built/installed by
-
install_name_tool- install: built/installed by
cctools-port - build: https://github.com/tpoechtrager/cctools-port
- install: built/installed by
- Add
AArch64toLLVM_TARGETS_TO_BUILDfor Apple Silicon. - Consider adding
lldtoLLVM_ENABLE_PROJECTS.- May not be required if using cctools
ld64.
- May not be required if using cctools
Current Alpine image builds LLVM with LLVM_TARGETS_TO_BUILD=X86 only.
Likely needed to build the missing tools:
bashautoconfautomakelibtoolpkgconfzlib-devopenssl-devlibxml2-devmusl-fts-devor equivalent
musl-fts matters because cctools-port documents musl-libc systems as needing
it.