Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3193690ioa; Mon, 25 Apr 2022 21:01:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzM4xGkkMh8aR/JGCNrT9AYSCGQPeh/UGVXKRKWtn7xwueu/DJnXN+od+Ru/7T2neaHZ7sZ X-Received: by 2002:aa7:d916:0:b0:425:d75f:ae68 with SMTP id a22-20020aa7d916000000b00425d75fae68mr13409894edr.270.1650945709448; Mon, 25 Apr 2022 21:01:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650945709; cv=none; d=google.com; s=arc-20160816; b=q9zAw77zP33uO2jYzn9Jp8ltASTJPu2P4YihAWM0ZQlmTIvNIhc/mo6sBSeHft/B7K uqRX5Cdef6TWeT2EBXk1IXBfupEOCGYOkKLgqfv5NJxhD9jWM5R4IpUksG1/FOQTZtfJ kXJ+9twG0QMuFFq58Kspzl4E634ctgMnrPFsRYzCyGHfQf7MUnaCKn2iAYEniNTx5hNY zuCyxdHOG5ktvSRKq7Y09+H3LJiC55LhEX5b6fUwYI00qNFcyQ6azGNzYNOVStB079/Q HSGYhiPEnNAMDlSnsF28MJr/01+w9SVGFGpaytCfgsAOu8vpWS6zkvQOeocUT/f+7MPU btUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=d/UWyhGy/V+3CY+Z0FpUzNIvArLY0jk35nlqcW1aZd0=; b=F8tdhGU0fQtdi4ZWwwOP2imXP/CT8wcZD4XZJfdJj9foNtAWSmhry+4ejGw9P+s+0A pvvnyvQSacLQOZE3nnMpsV0zS7tSacpEFxTJG4X3PD1aIpc0jblNgzuwKH/8hGalL1Wc r1LyX4LqYdgxA3fph/D4fYK/pY8a3j069n/PdMe0Xb2Uyef6+pSWKDakbOLIoBfeKvWb hlTrb4F5fXR42nYYOpsA08sh95Mbe4z7/8xwdWeD6qRPROBrpgmQ2x+Pu6Ms2wwVkv1x YldfvC6f4f0xCJyJz620uE6PAkMl+cOXRa7i89N2Fmxozb7GR2jH7I+UD0sjBQ81sKZx pTMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bm7-20020a0564020b0700b00425ab11333csi10671149edb.428.2022.04.25.21.01.25; Mon, 25 Apr 2022 21:01:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242617AbiDYO6z (ORCPT + 99 others); Mon, 25 Apr 2022 10:58:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237989AbiDYO6q (ORCPT ); Mon, 25 Apr 2022 10:58:46 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C151F37A2D for ; Mon, 25 Apr 2022 07:55:39 -0700 (PDT) Received: from mail-wr1-f43.google.com ([209.85.221.43]) by mrelayeu.kundenserver.de (mreue009 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MwQKr-1nzhfA4937-00sJlc for ; Mon, 25 Apr 2022 16:55:38 +0200 Received: by mail-wr1-f43.google.com with SMTP id t6so17816901wra.4 for ; Mon, 25 Apr 2022 07:55:37 -0700 (PDT) X-Gm-Message-State: AOAM531jlykXCI2DhIgUPBTmaZjlj85zzciECToGvbPyIRQeGV2B4VKZ WK6qxjicDQH9i6jdITYotK7Lzxgxv++9X3yKNOQ= X-Received: by 2002:a5d:64a3:0:b0:20a:7931:5b84 with SMTP id m3-20020a5d64a3000000b0020a79315b84mr15049037wrp.407.1650898537609; Mon, 25 Apr 2022 07:55:37 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Arnd Bergmann Date: Mon, 25 Apr 2022 16:55:20 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: odd endianness toolchains for crosstool To: "Jason A. Donenfeld" Cc: Arnd Bergmann , Linux Kernel Mailing List , Nick Desaulniers Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:CThKNepJfnCLrWKWwSbgW6DUwvwCzaM1rGdoR0hVZiED2gwiEbJ UXUuLyxSRW0SEv15GCSprkO7dkQuHyMnHATL+DRqpNLrOaCO6Y4rC+DXns/kjx6nQhk8AyR vt61Qz4NldyFrXTG3IOH/y5Z2k4lDNoToJ6SKM1s4tjcYftvxqmVFqTxVQPk1wP255k+Pio gOVPlsjWy/IakSZG5ZKJw== X-UI-Out-Filterresults: notjunk:1;V03:K0:PiutwLZZgXI=:YDCFMKB/RO+hmpTDlYPeoS XCf/cj0cDveQAwDkXhpMIhxfee4OmPUwQnk4WhjO+G70MNookU60dk6RtfpCW++P6o+E5JrAG vsQqB+uYV+kE/+OpvNlGavLteH/rU0IsNZKkzon3HnpHZAV7aEVA1tJSSI0qiDUyuyRHHDIch Orehy3J4tD9/c2HY4ZCFZASaVWE9ypDpZ5UNpw/MSQtBOrBbuCe7u+2+KfnsLP6yaZVKKVIkQ 9RW0YUh6QTQKzb9P4dm71hAWtdix307jqBD8Vp17L2wRB/aLafe5qisFAZ8J6tEouZ0RZ67Xw DL+tOBz8YNG0gc43NZLwW6DIY539D/eUBbLpjeIm37ZMyc0B0Iggx8NTAc8rcknkMUv6nXXxF nWzAXd+sxa3eDqxkXyyTunr+W0yxfZR3bCffwx2ipkSy3XU1vvLjIyaMbdiYjY/jeyh/jL2N9 CC5KUKVf3MaB366F8s3SgnXGS3OtHKgyE7itfwmAGLtIQ7ucLerrVljLQ3Au36MNlkHU/sXlA KN+OvIPB3F5psF2/y9wLUcpKDbaAk3qG/nl01t+0CdPCvWAKOu21ePPomiaD1SB8FjQmAEp4p V0ZshMHxGmreCp4KDDZ6SOKFguqOsg897hKgW+hbY5FMv6qA8JFUBjrNSBpZlesO1H5OhriTP g7lBB/i/JxZX1qQLW+0hFvpWJyRuCKDkXES+OuRDQdQqwCnUPNFHTy8HYTjmjUsTYfBtN/yBP llcADMWzZfBY7Xprl+QrOPZRFsai94VZPj5Bzg== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 25, 2022 at 1:43 PM Jason A. Donenfeld wrote: > On Mon, Apr 25, 2022 at 10:46:45AM +0200, Arnd Bergmann wrote: > > The situation on my end is that I'm planning to migrate my main workstation > > (which I'm building the compilers on) to an arm64 machine soon, and > > will then need to set it all up again. I don't really want to change much before > > then to avoid changing things twice. > > Ahh, okay, so probably crosstool won't be viable for me for a while. Are > your existing scripts fairly reproducible and easy? I suppose I could > just build my own if I can't find another project supplying light > compilers. The scripts are fairly solid, but the original git tree is no longer available and my version has a couple of local changes with a bit of a dirty history from adding support for cross-compiling the compilers themselves to do the canadian-cross arm64 and ppc64le hosted ones. There is another fork of the same tree on https://github.com/nathanchance/buildall The main issue with building distributable binaries is to actually build them on an older rootfs to avoid linking against a newer glibc, and to ensure the dependencies for gcc are statically linked. Without that, the output is too distro specific. > > I've added Nick to Cc, as he's experimenting with a clang based toolchain > > that we can put on kernel.org along with the gcc toolchains, and that > > would probably include a musl based sysroot roughly the same set of > > architectures that you are testing on already. Possibly we could reuse the > > same user space between clang and gcc. > > I personally have no use for compilers with user spaces. My test harness > builds musl as part of it. It's really the quickest part of the entire > harness to build. I also probably won't switch things over to clang; > Google has the resources to do that themselves. Basically all I need is > the boring nolibc compilers for a few extra platforms, and for the ppc > one to build with the mentioned flags. I suppose the only thing you are missing is libgcc (or libcompiler-rt) for those platforms. I had a closer look into what is or can be included here, and I see that my builds include multiple versions on some of the architectures, but not on others: aarch64-linux/lib/gcc/aarch64-linux/11.1.0/libgcc.a alpha-linux/lib/gcc/alpha-linux/11.1.0/libgcc.a arc-linux/lib/gcc/arc-linux/11.1.0/libgcc.a arc-linux/lib/gcc/arc-linux/11.1.0/hs/libgcc.a arc-linux/lib/gcc/arc-linux/11.1.0/archs/libgcc.a arc-linux/lib/gcc/arc-linux/11.1.0/hs38/libgcc.a arc-linux/lib/gcc/arc-linux/11.1.0/hs38_linux/libgcc.a arc-linux/lib/gcc/arc-linux/11.1.0/arc700/libgcc.a arc-linux/lib/gcc/arc-linux/11.1.0/nps400/libgcc.a arm-linux-gnueabi/lib/gcc/arm-linux-gnueabi/11.1.0/libgcc.a ... powerpc-linux/lib/gcc/powerpc-linux/11.1.0/libgcc.a powerpc-linux/lib/gcc/powerpc-linux/11.1.0/64/libgcc.a powerpc-linux/lib/gcc/powerpc-linux/11.1.0/64/le/libgcc.a powerpc-linux/lib/gcc/powerpc-linux/11.1.0/le/libgcc.a powerpc-linux/lib/gcc/powerpc-linux/11.1.0/32/le/libgcc.a powerpc64-linux/lib/gcc/powerpc64-linux/11.1.0/libgcc.a powerpc64-linux/lib/gcc/powerpc64-linux/11.1.0/32/libgcc.a powerpc64-linux/lib/gcc/powerpc64-linux/11.1.0/32/le/libgcc.a powerpc64-linux/lib/gcc/powerpc64-linux/11.1.0/le/libgcc.a powerpc64-linux/lib/gcc/powerpc64-linux/11.1.0/64/le/libgcc.a mips-linux/lib/gcc/mips-linux/11.1.0/libgcc.a mips-linux/lib/gcc/mips-linux/11.1.0/n32/libgcc.a mips-linux/lib/gcc/mips-linux/11.1.0/64/libgcc.a mips64-linux/lib/gcc/mips64-linux/11.1.0/libgcc.a mips64-linux/lib/gcc/mips64-linux/11.1.0/32/libgcc.a mips64-linux/lib/gcc/mips64-linux/11.1.0/64/libgcc.a So on powerpc, there are already both big-endian and little-endian binaries, but arm and mips only have one of the two. I asked our local compiler experts, and they suggested that one can add further multiarch-configs like the one in gcc/config/arm/t-aprofile to allow building for a different subset of the hundreds of possible configurations. the t-aprofile builds libgcc for a couple of combinations of cpu architecture level and FPU ABIs, but they are all the same endianess. gcc/config/rs6000/t-linux64lebe is the corresponding file for powerpc that enables all combinations of 32/64 and be/le. > > I've also looked at other projects that do qemu based testing, everyone > > seems to be missing one or two architectures out of a common set, > > https://tinyurl.com/linux-architectures is where I keep my data. > > If the compilers are there, and they can build a working musl, and QEMU > will boot it, and I can work out a minimal kernel .config that doesn't > take a long time to compile, then it'll get included in the CI. So in > theory, I should be able to expand the portfolio of architectures I'm > using. Adding riscv and s390 should indeed be fairly simple to add, and you can probably just take a look at what ktest does for them. You have a good point about the minimal kernel config, which makes sense for testing a single thing, but of course others generally want to test a 'defconfig' build that is closer to what users would actually run. > > building and running the most common subset of these in one place > > in the kernel tree where at least wireguard, kunit and tuxrun can > > share the setup for qemu. > > I have little interest in that kind of abstraction unfortunately. Ok, fair enough. Arnd