[Top][All Lists]

[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: Thu, 25 Feb 2021 19:54:59 +0100 (CET)
User-agent: Alpine 2.21 (LSU 202 2017-01-01)


On Wed, 24 Feb 2021, Christian JULLIEN wrote:

libSystem.dylib no longer exists as a file on file system,
see https://github.com/pyinstaller/pyinstaller/issues/5107

Aha, I see, so they really moved it to only be contained in the shared lib cache :-/

Okay, so something with dlopen and dlsym might be possible. But not having access to the symbol table directly is quite cumbersome. We'll have to load all (system) libraries with dlopen into tcc itself, just so that we can check if they provide symbols required from the program. Gah. Apple! ;-/


      Le : 24 février 2021 à 18:24 (GMT +01:00)
      De : "Michael Matz" <matz.tcc@frakked.de>
      À : "jullien@eligis.com" <jullien@eligis.com>,
      "tinycc-devel@nongnu.org" <tinycc-devel@nongnu.org>
      Objet : Re: [Tinycc-devel] macOS Big Sur M1 port status


      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(“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
      > 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)
      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.

      Tinycc-devel mailing list

reply via email to

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