Message ID | 2c3ac4542621ddc4b2cab006ae8e3a7b709921f1.1691259983.git.falcon@tinylab.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp612534vqr; Sat, 5 Aug 2023 12:55:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGlx+42yT/QoBZE4e4J7/sOOYplngBWhj/+/lMbPbs2pNG7/CQpY2QYZPGd27lkBKezr+bL X-Received: by 2002:a19:915c:0:b0:4fc:3756:754e with SMTP id y28-20020a19915c000000b004fc3756754emr3235172lfj.56.1691265342840; Sat, 05 Aug 2023 12:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691265342; cv=none; d=google.com; s=arc-20160816; b=zbzr16VCBiV3IsflWUZqd3jVSala/bzimnXsErVhvCEmdyITpYQcyz2gH3qEOZf9eo ZIEPRC1ajX1Bc6EwSnmCWwq2Nw1npz1YONPtC3L7kcy/8ajRLnTWqhfEBFLgtmdcK5N/ FQyZ5TBnYJRqG5QJZFmsYSbQCORqxsyejaQ3VhNIbVMs8fBlJ2zu6Q1srGdd9+RgzlOg HqROFXpTOgmD707GbYQzmQepLGldIKpdYlz0J/iAS1tpIE/FtMStzl4lB6TPUg06GgBv wNZx3ST5uz06B4wQTPSpZKQBVNf3p3sn/rKbERwDEy7oZoQ8In/8VYgjTGk/eJ1GEt/a KlMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=L9HB5rL0JQJNyd0hIyFZbK/IKYHiO6F6eQgdSy/U/UU=; fh=W7bimvGvo0lTWlwz0fu1fcegkvlIQ1MGOcj/f5qtBos=; b=Tuz726CdzomSCILRlJFDBZu0gFZpO3zFjPOTVyAa/P5GEfuWOCxRgACsWMRen6l7cm Wi+sgWuoRvN3zLYSQE9R6nUMz6anBxtY5XI2/Q8rjyQTAFUCOK4Y67UFW681zrPCrJDD 9AAPIU17tx6S+tiRKjXvn6YhAiBGOuRbV6rh2148wsNgsq7MO7mCyjZHkwoExLbFx7zb XFuWWY9hf+xBCH7tR36ee04+Dyu+cYpxHFiFDbHZXsjmJjFH1WUpHnRrAr1+Hn/ZuoVy MSHDaUuTdWlyTBTFsGfoFYlFDzAUxm7o6Gsz/AofCA/6X+QggtYCiofTh75iIMiNi7H2 LTRw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o18-20020aa7c512000000b005230d2fde4bsi3321057edq.639.2023.08.05.12.55.19; Sat, 05 Aug 2023 12:55:42 -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 S229708AbjHESr2 (ORCPT <rfc822;david.simonyants@gmail.com> + 99 others); Sat, 5 Aug 2023 14:47:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229662AbjHESr0 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 5 Aug 2023 14:47:26 -0400 Received: from smtpbgau1.qq.com (smtpbgau1.qq.com [54.206.16.166]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 670622D72; Sat, 5 Aug 2023 11:47:22 -0700 (PDT) X-QQ-mid: bizesmtp82t1691261231ty7dc1hm Received: from linux-lab-host.localdomain ( [116.30.131.233]) by bizesmtp.qq.com (ESMTP) with id ; Sun, 06 Aug 2023 02:47:10 +0800 (CST) X-QQ-SSF: 01200000000000E0X000B00A0000000 X-QQ-FEAT: IflLXxRcVR1gTGRr2ilcxmRzcus46IF74wtKQ1oFpYWF072KtLJW0K9dIyVlQ tohiSan5e61KVmLF1i837mkqkFeEpBoKGRNFKxoJR7iO7LtaKY504LrTMtnCdLw3BYmNgR0 uAi3fjj2iGvwuTi3rX88NGC8qRmaNrQaKg1Z9XcDF7Lj0ZJrxsHLZIh4VM2TT+i3H1cW0y7 qcJ+At/jX0gv6Djuqg7s54+B6Il6vJ24id4luOv9ZOxNwnxIXbeIPQr5OH2x0C04z0ga7vt Hxy0/9GCxzQbl2AlPzJ6lKTqHblp+b1WlhabeplbLHHAzCY/Vvi5tTAuJrvo/1ny6BZSttY kHzK8vCDkB0l2k6jjCiaTu9GUsveogjLy9M0n/VrT6raAe5sFlMMbf46ftfwEgLPzuxUDYw X-QQ-GoodBg: 0 X-BIZMAIL-ID: 2403698746126952363 From: Zhangjin Wu <falcon@tinylab.org> To: w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, tanyuan@tinylab.org, thomas@t-8ch.de Subject: [PATCH v6 8/8] selftests/nolibc: customize CROSS_COMPILE for 32/64-bit powerpc Date: Sun, 6 Aug 2023 02:47:09 +0800 Message-Id: <2c3ac4542621ddc4b2cab006ae8e3a7b709921f1.1691259983.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <cover.1691259983.git.falcon@tinylab.org> References: <cover.1691259983.git.falcon@tinylab.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773420248114744498 X-GMAIL-MSGID: 1773420248114744498 |
Series |
tools/nolibc: add 32/64-bit powerpc support
|
|
Commit Message
Zhangjin Wu
Aug. 5, 2023, 6:47 p.m. UTC
The little-endian powerpc64le compilers provided by Ubuntu and Fedora
are able to compile big endian kernel and big endian nolibc-test [1].
These default CROSS_COMPILE settings allow to test target architectures
with:
$ cd /path/to/tools/testing/selftests/nolibc/
$ for arch in ppc ppc64 ppc64le; do \
make run-user XARCH=$arch | grep "status: "; \
done
If want to use another cross compiler, please simply pass CROSS_COMPILE
or CC as before.
For example, it is able to build 64-bit nolibc-test with the big endian
powerpc64-linux-gcc crosstool from [2]:
$ wget -c https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/13.1.0/x86_64-gcc-13.1.0-nolibc-powerpc64-linux.tar.xz
$ tar xvf x86_64-gcc-13.1.0-nolibc-powerpc64-linux.tar.xz
$ export PATH=$PWD/gcc-13.1.0-nolibc/powerpc64-linux/bin/:$PATH
$ export CROSS_COMPILE_ppc=powerpc64-linux-
$ export CROSS_COMPILE_ppc64=powerpc64-linux-
$ export CROSS_COMPILE_ppc64le=powerpc64-linux-
$ for arch in ppc ppc64 ppc64le; do \
make run-user XARCH=$arch | grep "status: "; \
done
Or specify CC directly with full path:
$ export CC=$PWD/gcc-13.1.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc
$ for arch in ppc ppc64 ppc64le; do \
make run-user XARCH=$arch | grep "status: "; \
done
[1]: https://github.com/open-power/skiboot
[2]: https://mirrors.edge.kernel.org/pub/tools/crosstool/
Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
---
tools/testing/selftests/nolibc/Makefile | 3 +++
1 file changed, 3 insertions(+)
Comments
On Sun, Aug 06, 2023 at 02:47:09AM +0800, Zhangjin Wu wrote: > The little-endian powerpc64le compilers provided by Ubuntu and Fedora > are able to compile big endian kernel and big endian nolibc-test [1]. FWIW I'm wondering why focusing on these ones which have a different naming from the other ones, when I think that most users rely on the ones maintained by Arnd there: https://mirrors.edge.kernel.org/pub/tools/crosstool/ Yours is called powerpc64le while the one above is "powerpc64", it requires to make an exception for this one, I find this a bit odd. If someone wants to use their distro's cross toolchain, that's fine, but I think that it will depend on distros anyway and some may not even be provided (like loongarch) so I think it would make more sense to adopt the canonical naming from Arnd's toolchains above. It's not critical, but as you showed below, it makes building for ppc a little bit cumbersome: those "export" lines could be dropped when using the default names, and that's what we should document as the recommended way to test: > For example, it is able to build 64-bit nolibc-test with the big endian > powerpc64-linux-gcc crosstool from [2]: > > $ wget -c https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/13.1.0/x86_64-gcc-13.1.0-nolibc-powerpc64-linux.tar.xz > $ tar xvf x86_64-gcc-13.1.0-nolibc-powerpc64-linux.tar.xz > $ export PATH=$PWD/gcc-13.1.0-nolibc/powerpc64-linux/bin/:$PATH > > $ export CROSS_COMPILE_ppc=powerpc64-linux- > $ export CROSS_COMPILE_ppc64=powerpc64-linux- > $ export CROSS_COMPILE_ppc64le=powerpc64-linux- > $ for arch in ppc ppc64 ppc64le; do \ > make run-user XARCH=$arch | grep "status: "; \ > done Any opinion on this ? Thanks, Willy
Hi, Willy > On Sun, Aug 06, 2023 at 02:47:09AM +0800, Zhangjin Wu wrote: > > The little-endian powerpc64le compilers provided by Ubuntu and Fedora > > are able to compile big endian kernel and big endian nolibc-test [1]. > > FWIW I'm wondering why focusing on these ones which have a different > naming from the other ones, when I think that most users rely on the > ones maintained by Arnd there: > > https://mirrors.edge.kernel.org/pub/tools/crosstool/ > Arnd's toolchains may be a more distribution independent ones. > Yours is called powerpc64le while the one above is "powerpc64", it > requires to make an exception for this one, I find this a bit odd. > Yes, one is little endian output by default, another may be big endian output by default. > If someone wants to use their distro's cross toolchain, that's fine, > but I think that it will depend on distros anyway and some may not > even be provided (like loongarch) so I think it would make more sense > to adopt the canonical naming from Arnd's toolchains above. > Agree very much, let's switch to Arnd's toolchains. > It's not critical, but as you showed below, it makes building for ppc > a little bit cumbersome: those "export" lines could be dropped when > using the default names, and that's what we should document as the > recommended way to test: > > > For example, it is able to build 64-bit nolibc-test with the big endian > > powerpc64-linux-gcc crosstool from [2]: > > > > $ wget -c https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/13.1.0/x86_64-gcc-13.1.0-nolibc-powerpc64-linux.tar.xz > > $ tar xvf x86_64-gcc-13.1.0-nolibc-powerpc64-linux.tar.xz > > $ export PATH=$PWD/gcc-13.1.0-nolibc/powerpc64-linux/bin/:$PATH > > > > $ export CROSS_COMPILE_ppc=powerpc64-linux- > > $ export CROSS_COMPILE_ppc64=powerpc64-linux- > > $ export CROSS_COMPILE_ppc64le=powerpc64-linux- > > $ for arch in ppc ppc64 ppc64le; do \ > > make run-user XARCH=$arch | grep "status: "; \ > > done > > Any opinion on this ? > Ok, let's go this way, if the others are ok for you, could you please drop the last two CROSS_COMPILE patches from this v6 ppc series? Thanks. I will send v2 CROSS_COMPILE series with them, with Arnd's toolchains, the whole CROSS_COMPILE series will be unified and become very simple, although they need to download the toolchains manually one by one, but it is possible to write a common script, but that is another requirement. BR, Zhangjin --- [1]: https://lore.kernel.org/lkml/cover.1691259983.git.falcon@tinylab.org/ [2]: https://lore.kernel.org/lkml/cover.1691263493.git.falcon@tinylab.org/ > Thanks, > Willy
On Sun, Aug 06, 2023 at 11:11:25AM +0800, Zhangjin Wu wrote: > > If someone wants to use their distro's cross toolchain, that's fine, > > but I think that it will depend on distros anyway and some may not > > even be provided (like loongarch) so I think it would make more sense > > to adopt the canonical naming from Arnd's toolchains above. > > > > Agree very much, let's switch to Arnd's toolchains. Fine! > Ok, let's go this way, if the others are ok for you, could you please > drop the last two CROSS_COMPILE patches from this v6 ppc series? Thanks. Will do. > I will send v2 CROSS_COMPILE series with them, with Arnd's toolchains, the > whole CROSS_COMPILE series will be unified and become very simple, although > they need to download the toolchains manually one by one, but it is possible to > write a common script, but that is another requirement. Or even wget -r or any such thing. Cheers, Willy
diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile index 45d231b9c5c2..b4171a754eb2 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -56,6 +56,9 @@ IMAGE = $(IMAGE_$(XARCH)) IMAGE_NAME = $(notdir $(IMAGE)) # CROSS_COMPILE: cross toolchain prefix by architecture +CROSS_COMPILE_ppc ?= powerpc-linux-gnu- +CROSS_COMPILE_ppc64 ?= powerpc64le-linux-gnu- +CROSS_COMPILE_ppc64le ?= powerpc64le-linux-gnu- CROSS_COMPILE ?= $(CROSS_COMPILE_$(XARCH)) # make sure CC is prefixed with CROSS_COMPILE