SerenityOS / serenity

The Serenity Operating System 🐞
https://serenityos.org
BSD 2-Clause "Simplified" License
30.56k stars 3.19k forks source link

Toolchain: Upstreaming tracking for gcc/binutils/llvm #14183

Open ADKaster opened 2 years ago

ADKaster commented 2 years ago

In order to be a fully accepted CMake target, we should have compiler support upstreamed to at least gcc or llvm-project.

Here's the list of things that need done for that do have a chance of succeeding:

This issue is being tracked at the same time on CMake's GitLab here

In SerenityOS/serenity:

Loader/Kernel/LibELF:

LibC:


GNU Autotools:

Binutils:

GCC/libstdc++:


LLVM:

ghost commented 2 years ago

In order for <ctype.h.> to be POSIX compliant, doesn't <locale.h> have to also be POSIX compliant?

ADKaster commented 2 years ago

I believe our locale.h is compliant -- the C library only accepts the C locale.

The issue with ctype relates to us pretending to be newlib but not having the elements in the _ctype_ global array arranged properly. LLVM chokes on it and we have to tell it to provide its own ctype.h

ADKaster commented 2 years ago

Turns out plenty of systems tell libc++ to provide its own "Rune table" ... so us doing so as well isn't that big a deal.

ADKaster commented 2 years ago

We should update the CMake patches to reflect the fact that LibDL is now an ld-script stub like Musl's by removing the LibDL lib variable from the Platform files.

timschumi commented 2 years ago

LibDL is now an ld-script

Not sure if this is a typo, but better safe than sorry. Both LibDl and LibM are completely normal libraries at the moment, the only library that has been merged into LibC so far is LibPthread.

That said, I do plan to do the same with LibDl and LibM some time in the near future.

ADKaster commented 1 year ago

I created an RFC for LLVM upstreaming here: https://discourse.llvm.org/t/rfc-add-support-for-serenityos/71641