Hello,
On Tue, 16 Jun 2020, Christian Jullien wrote:
Hi, it looks new and I’ve not tested this solution but it may help to
finally get a native tcc port on macOS. Image is around 200Gb
I've just pushed my macos port to mob. It's lightly tested but seems to
work reasonably well, the testsuite is clean. I.e. you can now create
proper Mach-O executable files, link against system .dylibs and such. I
didn't bother implementing a Mach-O object file reader, so the support is
similar to Windows: you need to use TCC to compile C files into .o files
(which are ELF files), and then TCC to link those, which generates Mach-O
executables.
Generating shared libraries isn't implemented, neither are 32bit objects.
The generated executables should be runnable with relatively old MacOS
versions (dyld needs to support LC_MAIN, so 10.8 should be enough) but
I've developed and checked this only on 10.14 (Mojave).
You need at least the command line tools installed for system headers, but
you don't need to unpack them into /usr/include (modern MacOS deprecated
that one), the configure step tries to figure out the correct SDK
directory by using xcrun (which is then hardcoded into TCC as search
path for now).
For emulation I started with
https://github.com/foxlet/macOS-Simple-KVM.git (I didn't want to start
with docker and prefer plain qemu) and used the image fetcher from
https://github.com/kholia/OSX-KVM.git .
So, people with a real Mac: try it and give feedback ;-)
Ciao,
Michael.
_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel