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) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 75C5515810F for ; Thu, 8 Jun 2023 02:30:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 72925E0845; Thu, 8 Jun 2023 02:30:51 +0000 (UTC) Received: from out-14.mta0.migadu.com (out-14.mta0.migadu.com [IPv6:2001:41d0:1004:224b::e]) (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 52DD0E0845 for ; Thu, 8 Jun 2023 02:30:50 +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=1686191448; 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=gBdL7P6UjKpMlV/lWqzzVn0G9DUtp+m0RyNIZ7HFWNA=; b=riAaXvyK3tElTlUNGahdq4yijEh84AQCC1c5Qd1eI00e7UTnzDwJg2t8rG36EBjgfzArIw kwrSnvCu17qD3fkovbkzoSe9C+NPe4FrexttIf9SX2mtBz35pBhZ7nsWNxgb5V3ZFjB1KC GREmCcV5nKwrDjUmKFYH86zMQcimuQFNrFkbDhTOSLG4tJSqobyiB8BzciwaKNbDaQm0st Iu+CQVSlM5VgZJ76W2Lbz3jHkGSgFO8PbptZ59K8SXvrGayYxyJAhyQJ/lWy0I5VakFy5F 3SGET7bjpgxONiKQ1og1847it4hfU3hG3JWNUQjwFPgt5WpQcsgXg5tyIz2tKA== From: catcream To: gentoo-soc@lists.gentoo.org Subject: [gentoo-soc] Weekly report 1, LLVM libc Date: Thu, 08 Jun 2023 03:56:23 +0200 Message-ID: <87r0qmlm7c.fsf@catcream.org> 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; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Archives-Salt: 9dd58934-a973-42a3-8972-055805ac9a29 X-Archives-Hash: 5397a148a1386681a1febdac19e36722 =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Hey! I had to start GSoC on sunday last week due to school, and I didn't think that I'd write a weekly report for the first week but I decided to do it anyways. My plan for week 1 was: >This week I will set up a LLVM toolchain and sysroot for compiling >programs targeting LLVM libc. I will also start setting up a >=E2=80=9Cllvm-libc/Linux from Scratch=E2=80=9D chroot. Because I played with LLVM libc before last week I had already completed th= is goal. Going forward I will only work in the sysroot until setting up crossdev because it's simple and gives me everything I need to fix dependencies like Python. This far the project has been going pretty smooth, but I've also ran into some issues which I will comment on. The first issue was regarding SSP when setting up the LLVM toolchain. LLVM libc currently does not support stack smashing protection, and somehow compiled binaries automatically wants it if the toolchain was built with SSP enabled, even when compiling with =2D -fno-stack-protector. Probably this has something to do with internal libraries getting built with it. I spent quite a bit of time on this because I forgot CXXFLAGS was a thing and only set CFLAGS, thinking that something else was causing it :). Why this works out of the box on some other distributions, hence not in setup docs, is because Gentoo enables SSP in the clang config files. (See: https://blogs.gentoo.org/mgorny/2022/10/07/clang-in-gentoo-now-sets-d= efault-runtimes-via-config-file/) I then moved on to work on Python. When I talked with LLVM libc developers about this project they told me that the biggest obstacle for Python would be the missing libm functions, so I decided to use Julia's openlibm instead of the built in one. > I=E2=80=99d guess that python wouldn=E2=80=99t quite work yet since we do= n=E2=80=99t have all > of the double precision math functions yet, though you might be able > to fudge it by creating entrypoints that just call the single > precision versions. Openlibm just compiled and worked out of the box with Python by configuring with =2D --with-libm=3D*libopenlibm.a*, and then substituting math.h for openlibm_math.h. Next week I will mostly work on Python, because libm isn't the only issue. Things like fileno, wide strings, pthread_cond are used in Python and is not in LLVM libc yet. posixsource.c is particularly annoying. Yes, I have a time machine. =2D --=20 catcream =2D----BEGIN PGP SIGNATURE----- iIcEARYKAC8WIQTrvBqrbtsVNc2oScop9g9HYPvztAUCZIE9VxEcY2F0QGNhdGNy ZWFtLm9yZwAKCRAp9g9HYPvztPDgAQC2DCOzxCKIQbf6QBd+8pAvDpz55dhyzEJL Q/m+5o1wuQD/ecuKxM6NLSn9X73waKPlt7JdfdQY3BTerYFe9p4hEQA=3D =3DSxdi =2D----END PGP SIGNATURE-----