public inbox for gentoo-soc@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-soc] Weekly report 11, LLVM libc
@ 2023-08-14 23:49 catcream
  0 siblings, 0 replies; only message in thread
From: catcream @ 2023-08-14 23:49 UTC (permalink / raw
  To: gentoo-soc

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512


Hello! In this report I will write about my work from both last week and
this week. As seen in last weeks' update I got very sick but I started
working again on wednesday this week. I am still not well but I can
atleast sit at my computer now :)

To start with I've sent my Crossdev ebuild changes to the Gentoo mailing
lists and gotten feedback on the patches which I have fixed. Now it's
just Crossdev itself that needs some more reviews.

Secondly I have gotten initial work on limits.h merged into LLVM-libc,
the plan is to add additional macros along the way.

Another thing I have worked on is adding the fileno function. It
currently works just as it should, but I am struggling with my test
suite because it fails due to missing __llvmlibc_errno symbol. Other
test that depend on errno work, and the CMake source is pretty much
identical to mine, so I am unsure what goes wrong actually. Compiling
the test manually and linking the object file that has __llvmlibc_errno
works, but I have no clue why CMake doesn't fix that for me.

Similarly I've worked on is to add the fdopen function to LLVM-libc. It
currently is implemented very similar to fopen, and I think fopen could
be implemented using fdopen like how it's done in musl libc
https://elixir.bootlin.com/musl/v1.2.4/source/src/stdio/fopen.c#L26.
It still needs a test before merging.

I've also looked into two existing test suites that fail for me. The
first one is platform_file (reported here:
https://github.com/llvm/llvm-project/issues/64663).
I think that this one fails because LLVM-libc tests uses the host libc
for testing, and it ends up having duplicate standard streams in the
test binary. To solve this I learned to use git-bisect to track down the
commit that introduced this bug. The commit moved around std{in,out,err}
definitions, and by using nm I could see that the binary before the commit
did not have its own standard streams, but after the commit it provided
its own (and dynamically linked to glibc which has symbol versioned
standard streams). The author of the commit is aware of the issue.

Another issue is an abort test that seems to fail when running a lot of
tests multithreaded, I haven't looked into this much, but I will
definitely take another look. When running the test by itself it always
works.

Two small things I have done worth mentioning is:
1) https://reviews.llvm.org/D157842
This defines __UTS_NAME_LENGTH for __APPLE__, another commit I made
previously that changed wrong __unix__ checks to __linux__ made macOS
targets use the generic 1024 length instead of the previous Linux specific
65. Both of those are wrong, and this commit changes it to match XNU
with length 256.
2) https://github.com/gentoo/gentoo/commit/83c21c4aa868798e09be47c810f0478329c6dd1b
This adds USE=static-libs to sci-libs/openlibm. Openlibm currently has a
lot more functions than the LLVM-libc provided libm, so it is a great
alternative to use in the meantime. However, LLVM-libc only supports
static linking, so therefore the USE-flag was needed.

Next week I hope to merge all the Crossdev changes and also continue
work on LLVM-libc.

- -- 
catcream
-----BEGIN PGP SIGNATURE-----

iIcEARYKAC8WIQTrvBqrbtsVNc2oScop9g9HYPvztAUCZNrMTBEcY2F0QGNhdGNy
ZWFtLm9yZwAKCRAp9g9HYPvztDCYAQDvR/iCVFa9mLm4a/5fWNve0BYbai6fMZOW
k9/x1SBe7QD7BtFZQ43u0tP9qLRE/yeP5QHkgN508zGSVQsqcoaVGQg=
=vpON
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-15  0:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-14 23:49 [gentoo-soc] Weekly report 11, LLVM libc catcream

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox