From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id IDN2NmwyIWILNgEAgWs5BA (envelope-from ) for ; Thu, 03 Mar 2022 22:26:04 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id oJ3UM2wyIWJGNQEA9RJhRA (envelope-from ) for ; Thu, 03 Mar 2022 22:26:04 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 50A8C20877 for ; Thu, 3 Mar 2022 22:26:04 +0100 (CET) Received: from localhost ([::1]:50928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPsxW-00039E-Nf for larch@yhetil.org; Thu, 03 Mar 2022 16:26:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPssg-00066y-J6 for guix-patches@gnu.org; Thu, 03 Mar 2022 16:21:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:50061) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPssg-0002aa-9i for guix-patches@gnu.org; Thu, 03 Mar 2022 16:21:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nPssg-0002QI-3m for guix-patches@gnu.org; Thu, 03 Mar 2022 16:21:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54239] [PATCH] gnu: Add cross-clang. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Mar 2022 21:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54239 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Pierre Langlois Cc: 54239@debbugs.gnu.org Received: via spool by 54239-submit@debbugs.gnu.org id=B54239.16463424539279 (code B ref 54239); Thu, 03 Mar 2022 21:21:02 +0000 Received: (at 54239) by debbugs.gnu.org; 3 Mar 2022 21:20:53 +0000 Received: from localhost ([127.0.0.1]:43958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nPssX-0002Pb-5C for submit@debbugs.gnu.org; Thu, 03 Mar 2022 16:20:53 -0500 Received: from lepiller.eu ([89.234.186.109]:57082) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nPssV-0002PT-A8 for 54239@debbugs.gnu.org; Thu, 03 Mar 2022 16:20:52 -0500 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id a29708a3; Thu, 3 Mar 2022 21:20:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:in-reply-to:references:message-id:mime-version :content-type:content-transfer-encoding; s=dkim; bh=ZB/jQpBznI+X d5dFBgODJFdnv1vDWNQFCxk2gjhRU5c=; b=YbULnIjYBGvkIXwvJDInan1QrAcJ WbD9k8+G1jk6hLteIGDz6hoTfeLLWvxL2W6XJluV+EN5zt8/pqrVeIGO5FPwE1zn h2tMO9VAGOlDPBcftiLMJArQ713lqOsR7tKt1FIDXaDoHG+cKCGiry2fg5uhPdAg up0Nrp4HVsvZYnapcAM4RqN0RXM5nCehGkRXXeguG+ngB1tCa4O/olMskR8LDtiT LtxfS+2H1XrGJubB/kXuUSvs9nt16/kHrfv5WifkSGBQY7PVJNHs9uZ5t6anpCL4 gQsEDm28EyBS2WXV3Q+no7UhtRU4xzCiXYGPHQmN7kEe/DtnRIlsnXxtrg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 404d70d0 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Thu, 3 Mar 2022 21:20:48 +0000 (UTC) Date: Thu, 03 Mar 2022 22:20:45 +0100 From: Julien Lepiller User-Agent: K-9 Mail for Android In-Reply-To: <87wnhapwsv.fsf@gmx.com> References: <20220303170252.3caec0a6@tachikoma.lepiller.eu> <87wnhapwsv.fsf@gmx.com> Message-ID: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=----3KSS5RQVUTGPNXJNNC65RQ8SNWF588 Content-Transfer-Encoding: 7bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1646342764; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=r5oy1lsMlbGZjd1+afstBe+SAlL246RYJuLZK64khns=; b=eyWSnPoYaSw7rQwD5Q2QRRNL4HHJPF6nkltY/dBFGq5EUfDLu8kNwf1ZDbXDRyLr/UNCcQ YyHhW/GPyGC31mNQ7YcO8Yv4c/5uaNUq4pURoNeHQqJTIBko3NTK/8TyNjEwhqodxl/S6f BGcCUDPUOw58fl6fXpWkHenmHYFb6tDiutw38+lnZD9FI8vNmPwALC3v1VL6Ngt+sqYWjO jwO/S42ibkDRNpCnnUFKG66tcq0B1cSkGp+oaEuUZQ+97Wil+wH1VTgrbPXmaDm/FgTDKj Ax7O+NyznBJdWwws/5gIUxGh6LeI1GJKItCe4ydXriEtD+hxMrt1C0MZHO2yyA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646342764; a=rsa-sha256; cv=none; b=XcBSRpIJMmwlY89UutCkCMR7pEN/rT+eeOcznev0bD/6wvOAVN+KmF6GF1BANq31gUv42p JuVv23U3ARKVp9QuOAvtqmsDt8dPvYmHL1kUBOPvcU4smQ7EgnOlMgoEKRT2N4xTVBUvKr ZuWB3unJqHu58W9jGslVRkWU/OMOvO8O6G3ov/5eR2OgOyJ8PovN5F+d31TJNL1F9lfaaP 1TKlwCQ++PX1nXE+s5sOieHFmd9l1mbvwA3tv3RrY3Y55fcF1/bzQ3ElPfNIAhPZ3jn6Dc /XUxD4j2CclGTj7v6KDxzVXQkkdWR1pIp0Zkq8zs0+xYTc1hIe1EaPZNzlTMLQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=YbULnIjY; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 5.54 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=YbULnIjY; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 50A8C20877 X-Spam-Score: 5.54 X-Migadu-Scanner: scn0.migadu.com X-TUID: Lkc+ePPE/QvZ ------3KSS5RQVUTGPNXJNNC65RQ8SNWF588 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Oh wow! I need clang for Android: it's only tested and built with clang, and some = of the packages don't build with gcc=2E I don't really need any fancy targe= t, but one of the goals I had was to be able to cross-build my android pack= ages, hence this cross-compiler=2E A wasm cross-compiler would be awesome! On March 3, 2022 9:51:01 PM GMT+01:00, Pierre Langlois wrote: >Hi Julien, > >Julien Lepiller writes: > >> Hi Guix! >> >> This small patch series adds cross-clang, a cross-compiler version of >> clang=2E Clang doesn't really make a distinction between a native and a >> cross-build, it is already a cross-compiler, but this ensures that: >> >> 1=2E it actually works >> 2=2E it targets (%current-target-architecture) by default >> >> The rest of the series ensures that libcxx and libcxxabi can be >> cross-compiled with it=2E > >That's really cool! Out of curiosity, what target are you interested in >that clang supports and GCC doesn't? For instance I'm interested in >WebAssembly, and I've actually been contemplating how we could improve >support for cross-compilers based on Clang in Guix, to be able to >provide a working WebAssembly toolchain=2E > >For context, such a toolchain will be needed to enable potential use of >WebAssembly in IceCat, for security purposes, see >https://hacks=2Emozilla=2Eorg/2021/12/webassembly-and-back-again-fine-gra= ined-sandboxing-in-firefox-95/ > >I actually have a toolchain that works already, which targets the >wasm32-wasi-unknown triplet, but I wasn't convinced the way I did it was >the right way to go long term, so it needs more work=2E I'm attaching th= e >patch in case there's anything useful to you in there already! > >The approach I took was to create wrappers around clang/clang++ in order >to set the correct include paths, and then provide an isolated sysroot >for wasm32-wasi using union-build=2E This will work for IceCat, where >their should be a flag to pass a sysroot path, but we should be able to >do better in Guix=2E > >I though I'd share in case that's helpful! I'll take a look at your >patches to see if I can build on top of them for a future WebAssembly >toolchain in Guix=2E > >Thanks, >Pierre > ------3KSS5RQVUTGPNXJNNC65RQ8SNWF588 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Oh wow!

I need clang for Android: it's only= tested and built with clang, and some of the packages don't build with gcc= =2E I don't really need any fancy target, but one of the goals I had was to= be able to cross-build my android packages, hence this cross-compiler=2E
A wasm cross-compiler would be awesome!

On March 3, 2022 9:51:01 PM GMT+01:00, Pierre Langlois <pierre=2Ela= nglois@gmx=2Ecom> wrote:
Hi Julien,

Julien Lepiller <j= ulien@lepiller=2Eeu> writes:

Hi Guix!

This small patch series adds cross-clang, a = cross-compiler version of
clang=2E Clang doesn't really make a distinct= ion between a native and a
cross-build, it is already a cross-compiler,= but this ensures that:

1=2E it actually works
2=2E it targets = (%current-target-architecture) by default

The rest of the series en= sures that libcxx and libcxxabi can be
cross-compiled with it=2E

That's really cool! Out of curiosity, what target are you int= erested in
that clang supports and GCC doesn't? For instance I'm intere= sted in
WebAssembly, and I've actually been contemplating how we could i= mprove
support for cross-compilers based on Clang in Guix, to be able to=
provide a working WebAssembly toolchain=2E

For context, such a t= oolchain will be needed to enable potential use of
WebAssembly in IceCat= , for security purposes, see
ht= tps://hacks=2Emozilla=2Eorg/2021/12/webassembly-and-back-again-fine-grained= -sandboxing-in-firefox-95/

I actually have a toolchain that work= s already, which targets the
wasm32-wasi-unknown triplet, but I wasn't c= onvinced the way I did it was
the right way to go long term, so it needs= more work=2E I'm attaching the
patch in case there's anything useful t= o you in there already!

The approach I took was to create wrappers a= round clang/clang++ in order
to set the correct include paths, and then = provide an isolated sysroot
for wasm32-wasi using union-build=2E This wi= ll work for IceCat, where
their should be a flag to pass a sysroot path,= but we should be able to
do better in Guix=2E

I though I'd share= in case that's helpful! I'll take a look at your
patches to see if I ca= n build on top of them for a future WebAssembly
toolchain in Guix=2E
=
Thanks,
Pierre

------3KSS5RQVUTGPNXJNNC65RQ8SNWF588--