tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] macOS Big Sur M1 port status


From: Michael Matz
Subject: Re: [Tinycc-devel] macOS Big Sur M1 port status
Date: Wed, 24 Feb 2021 18:23:51 +0100 (CET)
User-agent: Alpine 2.21 (LSU 202 2017-01-01)

Hello,

On Mon, 22 Feb 2021, Christian Jullien wrote:

I started to adapt mob to compile tcc natively on M1 (which is a damn cool and fast CPU, really).

With my few latest changes already pushed on mod, I’m able to build tcc and its libs.

I’m facing an important issue with Big Sur, libc.dylib (or libc.a) no longer exist as file on disk!

After googling a lot, I’ve found it exists “magically” for dlopen.

dlopen(“libc.dylib”, RTLD_NOW) => ok

With few simple (uncommitted) changes I have been able to let tcc succeed
searching for libc (using dlopen instead of fopen) but it finally failed at
macho_load_dll which reads from opened fd.

I’m don’t know how macho_load_dll could use dlopen instead of read.

For those wo. macOS, I think you can do the same on linux using dlopen.

I’m afraid, with my limited knowledge, I can’t go further on this port.

dlopen is not the answer, it's not the right interface for what TCC needs doing. (it's basically the difference between -run mode (dlopen) and compile-to-file mode ((f)read)).

The file that is necessary surely is somewhere. But it's possbile that Apple got rid of the libc name and only retained libSystem (which already exists on x86-64 MacOS and libc is basically just a symlink).

When I find time and motivation I'll have a look, as someone I know also bought a new macbook.


Ciao,
Michael.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]