From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 63B1A15800A for ; Mon, 24 Jul 2023 23:19:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9BE95E079C; Mon, 24 Jul 2023 23:19:22 +0000 (UTC) Received: from out-44.mta1.migadu.com (out-44.mta1.migadu.com [95.215.58.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7CB07E079C for ; Mon, 24 Jul 2023 23:19:21 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catcream.org; s=key1; t=1690240759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MDNfPEtmM+Kyop1pyuBnu7nIeqe/ndt2fK4MLaymGLo=; b=H524yHgbFbyTjA6bQh8KMxgFadkL9LfTcsUEG8Vv9ddKKWAsM8Ksw3dNuH3QH7WsFMbKvl CSaY5JEXyX7rh6Y9R3Ji5tIQz3unZRE787DEOlUfyfVZ6ubHDmcDU/M5K7foRuxxhm7/Jz 8tNxc9ReEwsCR6oBvy0SGG3vmFGID1wReU9rGOXM3nIaeXVVEfR5fAloKIx2PiQ3SeiPqD tsIpiHY883kv5tuKuQUSUkcbRbY99oreZTibYYj23J6uI0Ai9hdZy5XgEKIpRnNPguHmjC TcLPdlfAkrnaIX3ZEcRmvjnM3UF0VrAqWH815myBbTMGijjJtEmBRCuShItCBQ== From: catcream To: gentoo-soc@lists.gentoo.org Subject: [gentoo-soc] Weekly report 8, LLVM libc Date: Tue, 25 Jul 2023 00:49:56 +0200 Message-ID: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-soc@lists.gentoo.org Reply-to: gentoo-soc@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Archives-Salt: 0b37c1a8-e2b8-4a47-997d-84fb1b9c1b0b X-Archives-Hash: 3545d6810096c50ef3c08681a90b4de2 =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Hi! This (and last week) I've spent my time polishing the LLVM/Clang crossdev work. I have also created ebuilds for llvm-libc, libc-hdrgen and also the SCUDO allocator. But I will probably bake SCUDO into the llvm-libc ebuild instead actually. One thing I have also made is a cross eclass that handles cross compilation, instead of having the same logic copy-pasted in all ebuilds. To differentiate a "normal" crossdev package and LLVM/Clang crossdev I decided to use "cross_llvm-${CTARGET}" as package category name. This is necessary since you need some way to tell the ebuild about using LLVM for cross. My initial idea was to handle all this in the crossdev script, but crossdev ebuilds are self-contained, and you can do something like "emerge cross_llvm-gentoo-linux-llvm/llvm-libc" and it will do the right thing without running emerge from crossdev. Hence I need to handle cross compilation in the ebuilds themselves, using the eclass. Me and sam are not sure if a new eclass is the right thing to do but I will continue with it until I get some more thoughts as we can just inline everything later without wasting any work. I feel pretty much done now except for baking SCUDO directly into the llvm-libc ebuild. Actually it is very simple to do but I got some issues with libstdc++ when using llvm/ as root source directory for the libc build, which is necessary to use when compiling SCUDO. Previously I used runtimes/ as root directory, and that worked without issue. Currently to work around this you can just compile the source files in llvm-project/compiler-rt/lib/scudo/standalone and append the object files into libc.a. LLVM libc then just works with crossdev and you can compile things with the emerge wrapper as usual, but currently a lot of autotools things break due to me not having specified gnuconfig for llvm-libc yet. I had a lot of trouble last week with sonames when doing an aarch64 musl crossdev setup and running binaries with qemu-user, however it turned out it was just a warning and it worked after setting LD_LIBRARY_PATH as envvar to qemu-user. I spent a loong time on this. Currently I will need to upstream changes to compiler-rt ebuild, musl llvm-libc ebuild, libc-hdrgen, cross.eclass, and of course crossdev. Next week I will send the changes upstream for review and continue work on LLVM libc, most likely simple packages like ed, and then try to get the missing pieces upstreamed to LLVM libc. fileno() is definitely needed for ed. Last week I did not write a blog post as I was in "bug hell" and worked on a lot of small things at once and thought "if I just finish this I can write a good report", and then wednesday came, and I decided to just do an overview of all my work for this weeks' blog instead :D =2D --=20 catcream =2D----BEGIN PGP SIGNATURE----- iIcEARYIAC8WIQTrvBqrbtsVNc2oScop9g9HYPvztAUCZL8G8BEcY2F0QGNhdGNy ZWFtLm9yZwAKCRAp9g9HYPvztCXXAQDibiVDcLJ1DTq2wu4elXZRtuTUAp3awc5C zCee4DDSIAEAmB2/z8iQYH2CPrP3mCahc365lbRctFypXkwkPK7iRAA=3D =3DE1pk =2D----END PGP SIGNATURE-----