• Work on adding TLS support to LLVM on m68k

    From John Paul Adrian Glaubitz@21:1/5 to All on Sat Jan 28 21:40:01 2023
    Hello!

    The maintainers of the m68k backend in LLVM have started initial planning for adding
    TLS support. An issue for that has been opened in the LLVM Github tracker [1].

    If anyone can help shed more light on how TLS works on m68k, please add your comments
    to this Github issue. Any information on the topic is highly appreciated.

    Thanks,
    Adrian

    [1] https://github.com/llvm/llvm-project/issues/60354

    --
    .''`. John Paul Adrian Glaubitz
    : :' : Debian Developer
    `. `' Physicist
    `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Hanson@21:1/5 to All on Sun Jan 29 00:10:02 2023
    There wasn't really a TLS standard on any 68K ABIs that I know about. If the SVR4 ABI for 68K defined one then that's probably the one I'd use for LLVM's default, as most everything else should follow the SVR4 ABI for 68K by default too, right?

    That said, any compiler or linker for 68K needs to support multiple ABI standards since Mac OS, Atari, Amiga, and all the different UNIX and UNIX-like operating systems had their own ABI. Fortunately LLVM itself supports the concept of multiple ABIs…

    -- Chris

    On Jan 28, 2023, at 12:33 PM, John Paul Adrian Glaubitz <[email protected]> wrote:

    Hello!

    The maintainers of the m68k backend in LLVM have started initial planning for adding
    TLS support. An issue for that has been opened in the LLVM Github tracker [1].

    If anyone can help shed more light on how TLS works on m68k, please add your comments
    to this Github issue. Any information on the topic is highly appreciated.

    Thanks,
    Adrian

    [1] https://github.com/llvm/llvm-project/issues/60354

    --
    .''`. John Paul Adrian Glaubitz
    : :' : Debian Developer
    `. `' Physicist
    `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Finn Thain@21:1/5 to John Paul Adrian Glaubitz on Sun Jan 29 01:40:01 2023
    On Sat, 28 Jan 2023, John Paul Adrian Glaubitz wrote:

    Hello!

    The maintainers of the m68k backend in LLVM have started initial
    planning for adding TLS support. An issue for that has been opened in
    the LLVM Github tracker [1].

    If anyone can help shed more light on how TLS works on m68k, please add
    your comments to this Github issue. Any information on the topic is
    highly appreciated.

    Thanks,
    Adrian

    [1] https://github.com/llvm/llvm-project/issues/60354


    The developers of the TLS/NPTL support for m68k/coldfire were working for Freescale and Codesourcery at the time...

    https://lists.debian.org/debian-68k/2008/02/msg00212.html https://lists.debian.org/debian-68k/2007/11/msg00071.html

    The toolchain mailing lists at sourceware.org might be a good place to
    seek technical information about the implementation. Or you could try
    sending a question to the old e-mail addresses of the people who sent the patches e.g.

    https://git.kernel.org/torvalds/c/9674cdc74d63

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Karoly Balogh@21:1/5 to Chris Hanson on Sun Jan 29 11:10:01 2023
    This message is in MIME format. The first part should be readable text,
    while the remaining parts are likely unreadable without MIME-aware tools.

    Hi,

    On Sat, 28 Jan 2023, Chris Hanson wrote:

    That said, any compiler or linker for 68K needs to support multiple ABI standards since Mac OS, Atari, Amiga, and all the different UNIX and UNIX-like operating systems had their own ABI. Fortunately LLVM itself supports the concept of multiple ABIs…

    Indeed, but the systems you mention A., use a mixure of ABIs, I mean one
    system with many ABIs, even if there are some "basic assumptions" about volatile/nonvolatile registers and so on, but otherwise "you're on your
    own", and B., neither of these have "threads" as such, let alone anything
    that resembles the concept of a Thread Local Storage in the modern sense.

    Point is: it's safe to start on Linux/NetBSD, because there the OS at
    least knows about these as a concept, so there's some framework for it to follow as guard rails. Elsewhere - prepare for a lot of faking, and
    hacking, and cheating. :)

    (Ask me where I know... ;) )

    Charlie

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard@21:1/5 to All on Sun Jan 29 13:50:01 2023
    ------PG2EY85YUM7KA321IDXI7LMZZIVJ2E
    Content-Type: text/plain;
    charset=utf-8
    Content-Transfer-Encoding: quoted-printable

    Well afaics Linux/m68k sacrificed a global register (A5 ?) for TLS so that should be the easy start.

    Not sure if the concept of threads, TLS and such makes any sense on AmigaOS or TOS. Most likely fairly irrelevant as those have a substantially different process/thread model than POSIX.

    Richard

    ------PG2EY85YUM7KA321IDXI7LMZZIVJ2E
    Content-Type: text/html;
    charset=utf-8
    Content-Transfer-Encoding: quoted-printable

    <!DOCTYPE html><html><body>Well afaics Linux/m68k sacrificed a global register (A5 ?) for TLS so that should be the easy start.<br><br>Not sure if the concept of threads, TLS and such makes any sense on AmigaOS or TOS. Most likely fairly irrelevant as
    those have a substantially different process/thread model than POSIX.<br><br>Richard<br></body></html>
    ------PG2EY85YUM7KA321IDXI7LMZZIVJ2E--

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Paul Adrian Glaubitz@21:1/5 to Finn Thain on Mon Jan 30 11:20:01 2023
    Hi Finn!

    On 1/29/23 01:15, Finn Thain wrote:
    The developers of the TLS/NPTL support for m68k/coldfire were working for Freescale and Codesourcery at the time...

    https://lists.debian.org/debian-68k/2008/02/msg00212.html https://lists.debian.org/debian-68k/2007/11/msg00071.html

    Thanks, these links are very useful, especially the one describing the ABI.

    I have copied the ABI description into the Github issue, crediting the source:

    https://github.com/llvm/llvm-project/issues/60354

    The toolchain mailing lists at sourceware.org might be a good place to
    seek technical information about the implementation. Or you could try
    sending a question to the old e-mail addresses of the people who sent the patches e.g.

    https://git.kernel.org/torvalds/c/9674cdc74d63

    I have sent an email to both Joseph and Maxim, but I haven't got any reply yet.

    Adrian

    --
    .''`. John Paul Adrian Glaubitz
    : :' : Debian Developer
    `. `' Physicist
    `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)