tpoechtrager / osxcross

Mac OS X cross toolchain for Linux, FreeBSD, OpenBSD and Android (Termux)
GNU General Public License v2.0
2.85k stars 320 forks source link

Request: Fully self-hosting #295

Open mcandre opened 2 years ago

mcandre commented 2 years ago

Hi,

I am curious about how to shrink my disk usage. After I produce an osxcross toolchain with ./build.sh, then I would like to remove the toolchain which produced osxcross. In my case, this is Apple Clang. I am setting up osxcross in a reusable Docker image, which should be as small as possible.

However, when I remove Apple Clang, then the arm64e-apple-darwin20.4-clang no longer works. It begins complaining about missing architecture arm64e.

How can we make osxcross fully hosted, so that the user will have the option to safely remove the original compiler toolchain and continue to use 100% osxcross compiler?

tpoechtrager commented 2 years ago

Clang is used to build OSXCross and for cross-compiling. OSXCross does not need its own version of Clang. Clang is a cross compiler by default.

Only for arm64 and arm64e you may or may not need a more recent version of Clang.

mcandre commented 2 years ago

Another example: I cannot compile Hello World with osxcross unless libxml2-dev is installed. Even though hello.c does not use anything from libxml2-dev.

Perhaps this is something that could be statically built into osxcross.

tpoechtrager commented 2 years ago

It is required by libxar and libxar is required by ld64 for -bitcode_bundle support. You are mixing up host and target libraries. Built executables do not depend on libxml2-dev nor libxar.