From patchwork Sun Sep 8 07:42:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rutherther X-Patchwork-Id: 2825 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 91E3F27BBE9; Sun, 8 Sep 2024 08:46:27 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 57EAA27BBE2 for ; Sun, 8 Sep 2024 08:46:25 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1snCcW-0000vR-7R; Sun, 08 Sep 2024 03:46:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1snCcU-0000uz-E6 for guix-patches@gnu.org; Sun, 08 Sep 2024 03:46:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1snCcT-000357-1h for guix-patches@gnu.org; Sun, 08 Sep 2024 03:46:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:From:Date:To:Subject; bh=Mgt1Sx8zKt5EDGDFmGWK/0BYNcX8fjczkEbjG1QtOA0=; b=glLBlmwjwEglqwyMFu9uXYFZjlORoSqPevN8hPJs27gNNVlm7au2MeuJq+U5TMpleJwDz5eo8eoAsqeMDcpkSDbE7MppShI4jXsmwXmjfvurRAz8FG3VrvFwRREp/a4+TbXUh8f9hYeNihvUBzdXOKkYEfdnt96sAs+SJn1feJQmNO/zsaqVbmwMTg974pLYuIAG9OISdfq2LK3GOkBbL2L/W0vDp3kKiY+7P+goDIB+4VqD88ErJdygH73X1cPk7Fumc+w8B+TWIDaOTtbfGClxT5BhwELKXbWc+R/B2qRb4PjsUzLtz1heVHHZM25zZiCJMgkDFlgRl7i8yVDbVg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1snCcU-0003qt-Ej for guix-patches@gnu.org; Sun, 08 Sep 2024 03:46:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73118] [PATCH 0/5] Fix arm-none-eabi toolchains and introduce a newer version 12.3.rel1 Resent-From: Rutherther Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 08 Sep 2024 07:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73118 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73118@debbugs.gnu.org Cc: Rutherther X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.172578151114737 (code B ref -1); Sun, 08 Sep 2024 07:46:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Sep 2024 07:45:11 +0000 Received: from localhost ([127.0.0.1]:57923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snCbc-0003m7-U4 for submit@debbugs.gnu.org; Sun, 08 Sep 2024 03:45:11 -0400 Received: from lists.gnu.org ([209.51.188.17]:60496) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snCbK-0003gi-S1 for submit@debbugs.gnu.org; Sun, 08 Sep 2024 03:45:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1snCZC-0008Us-1a for guix-patches@gnu.org; Sun, 08 Sep 2024 03:42:38 -0400 Received: from mail-4322.protonmail.ch ([185.70.43.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1snCZ9-0002gN-Bg for guix-patches@gnu.org; Sun, 08 Sep 2024 03:42:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1725781350; x=1726040550; bh=Mgt1Sx8zKt5EDGDFmGWK/0BYNcX8fjczkEbjG1QtOA0=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=hdoe7Ic0yPlAnyuip8TiLtRlANKHqrmdss3j6F9nBwEWb7PRHTiuFZIQbhlIWD0oP Qsv2jVSysuJNP2vAOBw79rGX1LhoUoeJdfjY+lIqoLKYjMvkq3vhBWflfJm/7Yzynk wpW7IUDyPqmsY4Da5R5gKqytSzTCj7WNOLJjlfVaPi8zPgf98yFzcyV3gH7eh7v4oA M4pxJtgIgHViJfvob3KUewTYXYyEzPeqGOOM750TnpROzEPHiZ1MsQlc5kqBmw84fB VTJrW8QPEG5Xv7LjAF5i59S1UCorIVGFfD3dE+n4AtUbja68ba//1CvO0TVlzsuChg NYfsOaf1jxRlQ== Date: Sun, 08 Sep 2024 07:42:27 +0000 Message-ID: Feedback-ID: 8107604:user:proton X-Pm-Message-ID: 5e577786f5e9144a729278452848eae45bd95350 MIME-Version: 1.0 Received-SPF: pass client-ip=185.70.43.22; envelope-from=rutherther@protonmail.com; helo=mail-4322.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Reply-to: Rutherther X-ACL-Warn: , Rutherther via Guix-patches X-Patchwork-Original-From: Rutherther via Guix-patches via From: Rutherther Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Hello everyone, the aim of this patch series is to fix the arm ebedded toolchains that had a few issues, some of those have been reported already, but didn't get much attention. The issues: - CROSS_CPLUS_INCLUDE_PATH had C include first, C++ second. Since uses include_next for stdlib.h, stdlib.h was not found - libstdc++ outputted files to /lib, but cross lib path has arm-none-eabi/lib inside of it. I think that the env var is correct, to allow using both cross toolchain and normal one in a profile. But then the path of libstdc++ is wrong - libstdc++ didn't provide nano variant. This meant that even with the nano toolchain it was impossible to use nano.specs with C++ - the 7-2018-q2-update toolchain didn't provide nano variant of newlib, its newlib-nano was just a copy of newlib with name modified Apart from that, I've also made 12.3.rel1 toolchain available. At first I wanted to try the latest, but I was having some issues with it, so decided to try one major version back, and that worked fine. The problem with the older toolchains is that I cannot get them to compile stuff like qmk or pico-sdk that rely on newer gcc features. There was one issue with this toolchain, namely that libstdc++ thought getentropy function was present, but getentropy is not present in the resulting library, only in headers. I've found it's an issue in gcc and foun a patch published on GitHub repo of Zephyr project. Unanswered questions: - Since the libraries go onto small embedded targets, should they be compiled with more optimization flags? This doesn't have to be solved as part of this issue. - How does the debug output work internally in Guix ecosystem? I had to remove the debug output after changing "--libdir" of the libstdc++, since the debug output was not produced. I am not sure if this is a blocker for merge. I think it would be good to refactor the embedded arm toolchains a bit in the future, to provide variants that would accept arbitrary gcc, newlib and libstdc++ and when compiling these, decide on the flags based on the major versions. (Something like the avr toolchain has, though they don't modify the flags, it's probably simpler for the avr toolchain in some ways) Then provide a few preselected toolchains with gcc, newlib, libstdc++ with the versions supported by developer.arm.com. I would be willing to do this work, but I didn't want to have it part of this issue, because I can imagine there will be some discussion about it, whereas I hope this issue could be merged without much discussion. PS: Sorry if you see this cover letter, and not the rest of the patches. I have an issue with sending e-mails from protonmail where they appear only after a few hours. So after I get id of this issue after few hours from sending this cover letter, there will be another few-hour wait for the patches to apper... :/ Rutherther (5): Fix native-search-paths of arm-none-eabi toolchains Fix lib directory of arm-none-eabi libstdc++ Add libstdc++-nano for arm-none-eabi Fix arm-none-eabi 7 newlib nano variant Introduce arm-none-eabi 12.3.rel1 toolchain gnu/local.mk | 1 + gnu/packages/embedded.scm | 223 +++++++++-- gnu/packages/patches/newlib-getentropy.patch | 380 +++++++++++++++++++ 3 files changed, 572 insertions(+), 32 deletions(-) create mode 100644 gnu/packages/patches/newlib-getentropy.patch base-commit: 8485eb6e96dc2f539bac0298e12b07392da1e49e --- 2.45.2