From unknown Sun Jun 22 07:39:32 2025 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 From: Rutherther Message-ID: Feedback-ID: 8107604:user:proton X-Pm-Message-ID: 5e577786f5e9144a729278452848eae45bd95350 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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/l= ib inside of it. I think that the env var is correct, to allow using both c= ross 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 compil= ed 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 rem= ove 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 t= he 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 From unknown Sun Jun 22 07:39:32 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#73118] [PATCH 1/5] Fix native-search-paths of arm-none-eabi toolchains Resent-From: Rutherther Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 08 Sep 2024 07:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73118 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73118@debbugs.gnu.org Cc: Rutherther Received: via spool by 73118-submit@debbugs.gnu.org id=B73118.172578174815131 (code B ref 73118); Sun, 08 Sep 2024 07:50:02 +0000 Received: (at 73118) by debbugs.gnu.org; 8 Sep 2024 07:49:08 +0000 Received: from localhost ([127.0.0.1]:57930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snCfT-0003vz-Sa for submit@debbugs.gnu.org; Sun, 08 Sep 2024 03:49:08 -0400 Received: from mail-4322.protonmail.ch ([185.70.43.22]:51863) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snCfR-0003vR-Q7 for 73118@debbugs.gnu.org; Sun, 08 Sep 2024 03:49:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1725781738; x=1726040938; bh=0BPE7hP58P7kTLjSzDF4o4AO2v8bh+TSeSQjgScrFUc=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=l6BuvYh74015RT/eJ70VNhbNBi2A8M0/aQu7JUiSsrS2axsCJtp20Ch9AB+MqYLF0 1xE7BZnxZtT7PXK93Ca1ESdcHpvvLmvOqwKQeocNJwLHaQ/jXWQxb1Bm8B4qF+lTB2 1TO1GHJGIreYDaFtESkpj2TlwZnESz/IT1FKPVXQr2eBcSP5DIj+rotf30otEEXf7x 87RGKEya8M35hwEKcLXBvscCe7N3TZUy976mp4/QbTxG3f8B5ebqbLOxncWZbiA9rB Qm8Jz1719vG55qiJzKnfEey6kDIrPyDyTvQyEarZDfxgdyxEUS0czajenXdO/nnz8E /OaRk6NJIXV2Q== Date: Sun, 08 Sep 2024 07:48:52 +0000 From: Rutherther Message-ID: <03f0f03a1455f8d398e3e8e2be9319662a6cfd05.1725779196.git.rutherther@protonmail.com> In-Reply-To: References: Feedback-ID: 8107604:user:proton X-Pm-Message-ID: 45ecbd98d54f4e8b999710879c26f544b951d1b4 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) The toolchains CROSS_CPLUS_INCLUDE_PATH had C include directory first, and the C++ as second. Since does #include_next = , the toolchains could not build anything using . The C include has to come later than C++ one. This is already fixed in xgcc search-path. --- gnu/packages/embedded.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm index bee65663b6..a7ba9ebe98 100644 --- a/gnu/packages/embedded.scm +++ b/gnu/packages/embedded.scm @@ -201,9 +201,9 @@ (define make-gcc-arm-none-eabi-4.9 (files '("arm-none-eabi/include"))) (search-path-specification (variable "CROSS_CPLUS_INCLUDE_PATH") - (files '("arm-none-eabi/include" - "arm-none-eabi/include/c++" - "arm-none-eabi/include/c++/arm-none-eabi"))) + (files '("arm-none-eabi/include/c++" + "arm-none-eabi/include/c++/arm-none-eabi" + "arm-none-eabi/include"))) (search-path-specification (variable "CROSS_LIBRARY_PATH") (files '("arm-none-eabi/lib"))))))))) @@ -423,9 +423,9 @@ (define make-gcc-arm-none-eabi-7-2018-q2-update (files '("arm-none-eabi/include"))) (search-path-specification (variable "CROSS_CPLUS_INCLUDE_PATH") - (files '("arm-none-eabi/include" - "arm-none-eabi/include/c++" - "arm-none-eabi/include/c++/arm-none-eabi")= )) + (files '("arm-none-eabi/include/c++" + "arm-none-eabi/include/c++/arm-none-eabi" + "arm-none-eabi/include"))) (search-path-specification (variable "CROSS_LIBRARY_PATH") (files '("arm-none-eabi/lib"))))))))) --=20 2.45.2 From unknown Sun Jun 22 07:39:32 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#73118] [PATCH 2/5] Fix lib directory of arm-none-eabi libstdc++ Resent-From: Rutherther Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 08 Sep 2024 07:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73118 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73118@debbugs.gnu.org Cc: Rutherther Received: via spool by 73118-submit@debbugs.gnu.org id=B73118.172578175515151 (code B ref 73118); Sun, 08 Sep 2024 07:50:02 +0000 Received: (at 73118) by debbugs.gnu.org; 8 Sep 2024 07:49:15 +0000 Received: from localhost ([127.0.0.1]:57934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snCfb-0003wI-7B for submit@debbugs.gnu.org; Sun, 08 Sep 2024 03:49:15 -0400 Received: from mail-40134.protonmail.ch ([185.70.40.134]:40647) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snCfZ-0003vw-5e for 73118@debbugs.gnu.org; Sun, 08 Sep 2024 03:49:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1725781744; x=1726040944; bh=dqliHXTh1RC0/ToTR9dyiGqVysB9C8GFHqq3l7XV/Ak=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=ng9xA4+Gd9d1vvU7h3aDHUotpwOLSAk4UI3A/GxCGOK0n+acj0SeMaFWSnctu5xnr RT37DoEm3oyLnFdeKZXTnAyqwUpLMlfT0VyfrRXogBUiAH1rnmf1BIP3aIrTs75B7r lpV3uC19hECLNqIYkH8hOQZeFSABNAVcfoMEYKKJVwWtuRQVWfZzvSZaV0tS4ey53g aYn6wRd5B+g3kHxLEv3+A0PyKXj/FZOx+BLiH42sNpMOCDL8kzX2NqSaU2JQsCUtlM Rv4B2c14aDtIBc1j2bAFxKDtsNLpMZbu9FJIv279OCd4S0gdeEZU/IpG28BB+/XfJT G/hgYuvtCrl9Q== Date: Sun, 08 Sep 2024 07:49:02 +0000 From: Rutherther Message-ID: <6ede3b4f8ec273dc19e34f9e6d5942cf80b3c091.1725779196.git.rutherther@protonmail.com> In-Reply-To: References: Feedback-ID: 8107604:user:proton X-Pm-Message-ID: 44371c54b5dbd0c949ca8238933523949bd45f44 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) The libstdc++ made for arm-none-eabi puts the contents into "lib" folder, but that's unexpected when the resulting toolchain is a cross toolchain. The folder should be "arm-none-eabi/lib" --- gnu/packages/embedded.scm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm index a7ba9ebe98..59ffd9a661 100644 --- a/gnu/packages/embedded.scm +++ b/gnu/packages/embedded.scm @@ -481,6 +481,8 @@ (define make-libstdc++-arm-none-eabi (package (inherit libstdc++) (name "libstdc++-arm-none-eabi") + ; TODO When --libdir is specified, debug output is not produced. + (outputs '("out")) (arguments (substitute-keyword-arguments (package-arguments libstdc++) ((#:configure-flags _) @@ -493,6 +495,9 @@ (define make-libstdc++-arm-none-eabi "--disable-tls" "--disable-plugin" "--with-newlib" + ,(string-append "--libdir=3D" + (assoc-ref %outputs "out") + "/arm-none-eabi/lib") ,(string-append "--with-gxx-include-dir=3D" (assoc-ref %outputs "out") "/arm-none-eabi/include/c++"))))) --=20 2.45.2 From unknown Sun Jun 22 07:39:32 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#73118] [PATCH 3/5] Add libstdc++-nano for arm-none-eabi Resent-From: Rutherther Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 08 Sep 2024 07:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73118 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73118@debbugs.gnu.org Cc: Rutherther Received: via spool by 73118-submit@debbugs.gnu.org id=B73118.172578176015168 (code B ref 73118); Sun, 08 Sep 2024 07:50:02 +0000 Received: (at 73118) by debbugs.gnu.org; 8 Sep 2024 07:49:20 +0000 Received: from localhost ([127.0.0.1]:57938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snCff-0003wY-FX for submit@debbugs.gnu.org; Sun, 08 Sep 2024 03:49:19 -0400 Received: from mail-40134.protonmail.ch ([185.70.40.134]:58093) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snCfd-0003wA-RC for 73118@debbugs.gnu.org; Sun, 08 Sep 2024 03:49:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1725781750; x=1726040950; bh=TO1d8LAx4NBodzD/lsog50q7upsI+qRUCEZTW+3Z5vo=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=UaBhqppbwGjCfO/XYI9/T4Qsy4fV0HVxFM2Gp8uoSKWkU+TLCwQteq1pRyP+CQ4Ku pEL5fX+9SYoqKe6sT+jp7km1jMJbwDk2RLlJ3h/JV0fDM165yJ7oOm8XQ7A9OXsWnX zvaFeRwlodbVZM10oS2ZdM8ed5fHuIggieKTko6a7O6Zh0YuFoq4K7uQR9OMVlhqPN ebxVhXPW71bZ0m07eTKg8h+Yu25aih6BVMnNFJutiD729NeS3b/axHaXZ8Aowcnyfk bpxAPPJu2/oZhVudqldDtO1kIbdoALZvsTG/7WUMfYZq2zOJVTbo7F2EFgnpXnhPjk qnzHyxYhHxMpg== Date: Sun, 08 Sep 2024 07:49:06 +0000 From: Rutherther Message-ID: <8682f4da5b051491de57a27081d150fda7af9688.1725779196.git.rutherther@protonmail.com> In-Reply-To: References: Feedback-ID: 8107604:user:proton X-Pm-Message-ID: db7457a70345b80937e7b7bfb14d1191575638f8 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) The arm-none-eabi nano toolchain had same libstdc++ as the non-nano variant= . The libstdc++ should be compiled with -fno-exceptions to make a nano toolchain. Additionally, since the "_nano.a" variants were not present, it was impossi= ble to compile C++ programs with libstdc++ using --specs=3Dnano.specs, since libstdc++_nano.a was not found. --- gnu/packages/embedded.scm | 76 ++++++++++++++++++++++++++++++++------- 1 file changed, 64 insertions(+), 12 deletions(-) diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm index 59ffd9a661..1ea794724c 100644 --- a/gnu/packages/embedded.scm +++ b/gnu/packages/embedded.scm @@ -486,7 +486,14 @@ (define make-libstdc++-arm-none-eabi (arguments (substitute-keyword-arguments (package-arguments libstdc++) ((#:configure-flags _) - ``("--target=3Darm-none-eabi" + ``("CFLAGS=3D-ffunction-sections -fdata-sections" + "CXXFLAGS=3D-ffunction-sections -fdata-sections" + ; This is more of a hack. This option doesn't really seem + ; to change what subdir is used eventually, but without it = there is + ; error: Link tests are not allowed after GCC_NO_EXECUTABLE= S with + ; The 12.3 toolchain + "--with-target-subdir=3D\".\"" + "--target=3Darm-none-eabi" "--host=3Darm-none-eabi" "--disable-libstdcxx-pch" "--enable-multilib" @@ -506,21 +513,65 @@ (define make-libstdc++-arm-none-eabi ("xgcc" ,xgcc) ,@(package-native-inputs libstdc++))))))) =20 +(define make-libstdc++-nano-arm-none-eabi + (mlambda (xgcc newlib-nano) + (let ((base (make-libstdc++-arm-none-eabi xgcc newlib-nano))) + (package + (inherit base) + (name "libstdc++-nano-arm-none-eabi") + (arguments (substitute-keyword-arguments (package-arguments base) + ((#:configure-flags flags) + #~(cons* "CFLAGS=3D-ffunction-sections -fdata-sectio= ns -fno-exceptions" + "CXXFLAGS=3D-ffunction-sections -fdata-sect= ions -fno-exceptions" + (filter + (lambda (flag) + (not (or (string-prefix? "CFLAGS=3D" f= lag) + (string-prefix? "CXXFLAGS=3D"= flag)))) + #$flags))) + ((#:phases phases) + #~(modify-phases #$phases + (add-after 'install 'hardlink-libstdc++ + ;; XXX: Most arm toolchains offer both *.a and= *_nano.a as + ;; newlib and newlib-nano respectively. The h= eaders are + ;; usually arm-none-eabi/include/newlib.h for = newlib and + ;; arm-none-eabi/include/newlib-nano/newlib.h = for newlib-nano. + ;; We have two different toolchain packages fo= r each which + ;; works but is a little strange. + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + ;; The nano.specs file says that newlib-na= no files should + ;; end in "_nano.a" instead of just ".a". = Note that this + ;; applies to all the multilib folders too= . + (for-each + (lambda (file) + (link file + (string-append + ;; Strip ".a" off the end + (substring file 0 (- (string-len= gth file) 2)) + ;; Add "_nano.a" onto the end + "_nano.a"))) + (find-files + out "^(libstdc\\+\\+.a|libsupc\\+\\+.a)$= "))))))))))))) + (define make-arm-none-eabi-toolchain (mlambda (xgcc newlib) "Produce a cross-compiler toolchain package with the compiler XGCC and= the C library variant NEWLIB." - (let ((newlib-with-xgcc - (package - (inherit newlib) - (native-inputs - (alist-replace "xgcc" (list xgcc) - (package-native-inputs newlib)))))) + (let* ((nano? (string=3D? (package-name newlib) + "newlib-nano")) + (newlib-with-xgcc + (package + (inherit newlib) + (native-inputs + (alist-replace "xgcc" (list xgcc) + (package-native-inputs newlib))))) + (libstdc++ + (if nano? + (make-libstdc++-nano-arm-none-eabi xgcc newlib-with-xgcc) + (make-libstdc++-arm-none-eabi xgcc newlib-with-xgcc)))) (package (name (string-append "arm-none-eabi" - (if (string=3D? (package-name newlib-with-xgc= c) - "newlib-nano") - "-nano" "") + (if nano? "-nano" "") "-toolchain")) (version (package-version xgcc)) (source #f) @@ -537,9 +588,10 @@ (define make-arm-none-eabi-toolchain directories)))))) (propagated-inputs `(("binutils" ,(cross-binutils "arm-none-eabi")) - ("libstdc++" ,(make-libstdc++-arm-none-eabi xgcc newlib-with-xg= cc)) + ("libstdc++" ,libstdc++) ("gcc" ,xgcc) - ("newlib" ,newlib-with-xgcc))) + ("newlib" ,newlib-with-xgcc) + )) (synopsis "Complete GCC tool chain for ARM bare metal development"= ) (description "This package provides a complete GCC tool chain for = ARM bare metal development. This includes the GCC arm-none-eabi cross compile= r --=20 2.45.2 From unknown Sun Jun 22 07:39:32 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#73118] [PATCH 4/5] Fix arm-none-eabi 7 newlib nano variant Resent-From: Rutherther Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 08 Sep 2024 07:50:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73118 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73118@debbugs.gnu.org Cc: Rutherther Received: via spool by 73118-submit@debbugs.gnu.org id=B73118.172578176915192 (code B ref 73118); Sun, 08 Sep 2024 07:50:03 +0000 Received: (at 73118) by debbugs.gnu.org; 8 Sep 2024 07:49:29 +0000 Received: from localhost ([127.0.0.1]:57942 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snCfo-0003wy-VU for submit@debbugs.gnu.org; Sun, 08 Sep 2024 03:49:29 -0400 Received: from mail-4316.protonmail.ch ([185.70.43.16]:46297) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snCfm-0003wk-S1 for 73118@debbugs.gnu.org; Sun, 08 Sep 2024 03:49:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1725781757; x=1726040957; bh=yO4Yr1kacipCk1GYk7qpLy/OjMI03SnMa/STgHAP2Jg=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=D1KpV9m4b5sTyFhY+0rwvtNlR5gpr8AuisZgNnrIBYaLAodv54e/lrQtD98WMog/Y m2aINi/HoQjGW4UnJR8ohf90SRsiicdEDj2Afkh6hyVlsIMFzW6GfuQid6XpdMFRpT RnREnyg7dtpQ2SuPn9cCKqDgYNmz3lu6hDsVMaU1ZldjTfg+IKk60ECCMahteZu3nL QoAjco+JeM192Lbm4w7GLG6XD6S0T/3j1xi74jGc6V0/jPWpNdsPWziMz24OZZaKzh jmECkqCpNoSR0cjgr2KqmkUCrnUp75uivJffkAu31vu5+GGkP7cBmb3h1omEryZPAg jhDuuKrK0lnVg== Date: Sun, 08 Sep 2024 07:49:13 +0000 From: Rutherther Message-ID: In-Reply-To: References: Feedback-ID: 8107604:user:proton X-Pm-Message-ID: f9f913800369b7ec7b5a342db394ad8bf99477f7 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) The nano variant was not nano. It was just a copy of the original one with different name. This meant there were no _nano.a files present at all. --- gnu/packages/embedded.scm | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm index 1ea794724c..4093c10916 100644 --- a/gnu/packages/embedded.scm +++ b/gnu/packages/embedded.scm @@ -247,10 +247,7 @@ (define make-newlib-arm-none-eabi (modify-phases %standard-phases (add-after 'unpack 'fix-references-to-/bin/sh (lambda _ - (substitute* '("libgloss/arm/cpu-init/Makefile.in" - "libgloss/arm/Makefile.in" - "libgloss/libnosys/Makefile.in" - "libgloss/Makefile.in") + (substitute* (find-files "libgloss" "^Makefile\\.in$") (("/bin/sh") (which "sh"))) #t))))) (native-inputs @@ -430,12 +427,11 @@ (define make-gcc-arm-none-eabi-7-2018-q2-update (variable "CROSS_LIBRARY_PATH") (files '("arm-none-eabi/lib"))))))))) =20 -(define make-newlib-arm-none-eabi-7-2018-q2-update +(define make-base-newlib-arm-none-eabi-7-2018-q2-update ;; This is the same commit as used for the 7-2018-q2-update release ;; according to the release.txt. - (mlambda () - (let ((base (make-newlib-arm-none-eabi)) - (commit "3ccfb407af410ba7e54ea0da11ae1e40b554a6f4") + (mlambda (base) + (let ((commit "3ccfb407af410ba7e54ea0da11ae1e40b554a6f4") (revision "0")) (package (inherit base) @@ -464,15 +460,13 @@ (define make-newlib-arm-none-eabi-7-2018-q2-update ("xgcc" ,(make-gcc-arm-none-eabi-7-2018-q2-update)) ("texinfo" ,texinfo))))))) =20 -(define-public make-newlib-nano-arm-none-eabi-7-2018-q2-update +(define make-newlib-arm-none-eabi-7-2018-q2-update (mlambda () - (let ((base (make-newlib-arm-none-eabi-7-2018-q2-update))) - (package - (inherit base) - (name "newlib-nano") - (arguments - (package-arguments base)) - (synopsis "Newlib variant for small systems with limited memory"))= ))) + (make-base-newlib-arm-none-eabi-7-2018-q2-update (make-newlib-arm-none= -eabi)))) + +(define make-newlib-nano-arm-none-eabi-7-2018-q2-update + (mlambda () + (make-base-newlib-arm-none-eabi-7-2018-q2-update (make-newlib-nano-arm= -none-eabi)))) =20 =0C (define make-libstdc++-arm-none-eabi --=20 2.45.2 From unknown Sun Jun 22 07:39:32 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#73118] [PATCH 5/5] Introduce arm-none-eabi 12.3.rel1 toolchain Resent-From: Rutherther Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 08 Sep 2024 07:50:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73118 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73118@debbugs.gnu.org Cc: Rutherther Received: via spool by 73118-submit@debbugs.gnu.org id=B73118.172578177615213 (code B ref 73118); Sun, 08 Sep 2024 07:50:03 +0000 Received: (at 73118) by debbugs.gnu.org; 8 Sep 2024 07:49:36 +0000 Received: from localhost ([127.0.0.1]:57946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snCfv-0003xG-Bi for submit@debbugs.gnu.org; Sun, 08 Sep 2024 03:49:36 -0400 Received: from mail-40131.protonmail.ch ([185.70.40.131]:34229) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snCfs-0003wp-8H for 73118@debbugs.gnu.org; Sun, 08 Sep 2024 03:49:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1725781763; x=1726040963; bh=70q4MnaeFTT2Czhg0Rmf8wL34jXjaphkcLPrYWjzc/c=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=OLgE2gm9JYRbpw16qkuQ/k0px9DQz4vm9QnqfBEk/FYXxT8W5F+8G3lSpwt5DOsPQ CasK4ox60gxGsKsJ5vfPaIV5npvz3RMg0taLFtqMJQdVT9CfXOkj8oj9RqYcfsAqoo kqmoTzeF56V6XFj9h2yYqNtyaMn0UqksqJ10qTb2zQnCTZtX12T05ROsbHrG0Mf7QR vrOc5E5NrN40hcVSg+lLjFwZ2EO1j7zhxP5KQC+pjhciqRUfc4BEEjd78UjnLmmtPR 3DtSy+JNuOitXssIK56r997TbKQGBHgbP0a55chL+aMNqvXpgpXc7BUl40zwMUz/At SFqERjbszbFew== Date: Sun, 08 Sep 2024 07:49:19 +0000 From: Rutherther Message-ID: <2ff218480c1347aadfc7c976dcb8d89e8f0e5e89.1725779196.git.rutherther@protonmail.com> In-Reply-To: References: Feedback-ID: 8107604:user:proton X-Pm-Message-ID: 7c35af5cffe60b05dd531cb014dc3d10c6f0fde4 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) The arguments for this toolchain are taken mostly out of here https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads/12-3-rel1 Change-Id: I9921ab06bc4f2ce59afedb48775017b17e0fd144 --- gnu/local.mk | 1 + gnu/packages/embedded.scm | 110 +++++- gnu/packages/patches/newlib-getentropy.patch | 380 +++++++++++++++++++ 3 files changed, 490 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/newlib-getentropy.patch diff --git a/gnu/local.mk b/gnu/local.mk index cf42e2b6da..71db5ab2ca 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1800,6 +1800,7 @@ dist_patch_DATA =3D=09=09=09=09=09=09\ %D%/packages/patches/ngircd-handle-zombies.patch=09=09\ %D%/packages/patches/network-manager-plugin-path.patch=09\ %D%/packages/patches/network-manager-meson.patch=09=09\ + %D%/packages/patches/newlib-getentropy.patch=09=09=09\ %D%/packages/patches/nginx-socket-cloexec.patch=09=09\ %D%/packages/patches/nickle-man-release-date.patch=09=09\ %D%/packages/patches/nnpack-system-libraries.patch=09=09\ diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm index 4093c10916..677bf3f797 100644 --- a/gnu/packages/embedded.scm +++ b/gnu/packages/embedded.scm @@ -78,22 +78,27 @@ (define-module (gnu packages embedded) #:export (make-gcc-arm-none-eabi-4.9 make-gcc-arm-none-eabi-6 make-gcc-arm-none-eabi-7-2018-q2-update + make-gcc-arm-none-eabi-12.3.rel1 =20 make-gcc-vc4 =20 make-newlib-arm-none-eabi make-newlib-arm-none-eabi-7-2018-q2-update + make-newlib-arm-none-eabi-12.3.rel1 =20 make-newlib-nano-arm-none-eabi make-newlib-nano-arm-none-eabi-7-2018-q2-update + make-newlib-nano-arm-none-eabi-12.3.rel1 =20 make-arm-none-eabi-toolchain-4.9 make-arm-none-eabi-toolchain-6 make-arm-none-eabi-toolchain-7-2018-q2-update + make-arm-none-eabi-toolchain-12.3.rel1 =20 make-arm-none-eabi-nano-toolchain-4.9 make-arm-none-eabi-nano-toolchain-6 make-arm-none-eabi-nano-toolchain-7-2018-q2-update + make-arm-none-eabi-nano-toolchain-12.3.rel1 =20 make-gdb-arm-none-eabi =20 @@ -468,12 +473,103 @@ (define make-newlib-nano-arm-none-eabi-7-2018-q2-upd= ate (mlambda () (make-base-newlib-arm-none-eabi-7-2018-q2-update (make-newlib-nano-arm= -none-eabi)))) =20 +=0C +;;; The following definitions are for the "12.3.rel1" variant of the +;;; ARM cross toolchain as offered on https://developer.arm.com +(define-public make-gcc-arm-none-eabi-12.3.rel1 + (mlambda () + (let ((base (make-gcc-arm-none-eabi-7-2018-q2-update)) + (xgcc-base (cross-gcc "arm-none-eabi" + #:xgcc gcc-12 + #:xbinutils (cross-binutils "arm-none-eabi= ")))) + (package + (inherit base) + (version "12.3.rel1") + (source + (origin + (inherit (package-source xgcc-base)) + (method git-fetch) + (uri (git-reference + (url "git://gcc.gnu.org/git/gcc.git") + (commit "0f54a73b998b72f7c8452a63730ec3b16fc47854"))) + (sha256 + (base32 "0r6q0m3d8g3k3rkmnqjw8aw5fcnsrmywf4ispdkxmk1al3whk1vk"= )))) + (arguments + (substitute-keyword-arguments (package-arguments base) + ((#:phases phases) + #~(modify-phases #$phases + (replace 'expand-version-string + (lambda _ + (make-file-writable "gcc/DEV-PHASE") + (with-output-to-file "gcc/DEV-PHASE" + (lambda () + (display "12.3.rel1"))))))) + ((#:configure-flags flags) + #~(cons* "--with-multilib-list=3Daprofile,rmprofile" + "--with-headers=3Dyes" + "--enable-checking=3Drelease" + "--with-gnu-as" + "--with-gnu-ld" + (filter + (lambda (flag) + (not (member flag + '("--with-multilib-list=3Drmprofile" + "--enable-plugins" + "--disable-libffi")))) + #$flags))))))))) + +(define make-base-newlib-arm-none-eabi-12.3.rel1 + (mlambda (original-base) + (let ((base (make-base-newlib-arm-none-eabi-7-2018-q2-update original-= base)) + (commit "4c7d0dfec5793cbf5cf3930b91f930479126d8ce") + (revision "0")) + (package + (inherit base) + (version (git-version "4.3.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "http://sourceware.org/git/newlib-cygwin.git") + (commit commit))) + (sha256 + (base32 + "0drs9v8avh4y2h5bs0ixjn9x662jzkkikx8z034wgl41dxmn6786")))) + (arguments (substitute-keyword-arguments (package-arguments base) + ((#:configure-flags flags) + #~(cons* "--enable-newlib-mb" + "--enable-newlib-reent-check-verify" + "--enable-newlib-register-fini" + #$flags)))))))) + +(define make-newlib-arm-none-eabi-12.3.rel1 + (mlambda () + (make-base-newlib-arm-none-eabi-12.3.rel1 (make-newlib-arm-none-eabi))= )) + +(define make-newlib-nano-arm-none-eabi-12.3.rel1 + (mlambda () + (make-base-newlib-arm-none-eabi-12.3.rel1 (make-newlib-nano-arm-none-e= abi)))) + =0C (define make-libstdc++-arm-none-eabi (mlambda (xgcc newlib) - (let ((libstdc++ (make-libstdc++ xgcc))) + (let* ((libstdc++ (make-libstdc++ xgcc)) + (src (package-source libstdc++))) (package (inherit libstdc++) + (source + (origin + (inherit src) + (patches (append + ; libstdc++ cannot be linked with since the configure= phase + ; cannot detect properly the presence of getentropy f= unction. + ; The function is inside of a header, but it's not pr= esent in the resulting + ; newlib. configure will conclude getentropy is prese= nt, + ; random will use getentropy, and any linking with ra= ndom will fail. + (if (version>=3D? (package-version xgcc) "12.0") + (search-patches "newlib-getentropy.patch") + '()) + (origin-patches src))))) (name "libstdc++-arm-none-eabi") ; TODO When --libdir is specified, debug output is not produced. (outputs '("out")) @@ -626,6 +722,18 @@ (define make-arm-none-eabi-nano-toolchain-7-2018-q2-up= date (make-gcc-arm-none-eabi-7-2018-q2-update) (make-newlib-nano-arm-none-eabi-7-2018-q2-update)))) =20 +(define make-arm-none-eabi-toolchain-12.3.rel1 + (mlambda () + (make-arm-none-eabi-toolchain + (make-gcc-arm-none-eabi-12.3.rel1) + (make-newlib-arm-none-eabi-12.3.rel1)))) + +(define make-arm-none-eabi-nano-toolchain-12.3.rel1 + (mlambda () + (make-arm-none-eabi-toolchain + (make-gcc-arm-none-eabi-12.3.rel1) + (make-newlib-nano-arm-none-eabi-12.3.rel1)))) + (define make-gdb-arm-none-eabi (mlambda () (package diff --git a/gnu/packages/patches/newlib-getentropy.patch b/gnu/packages/pa= tches/newlib-getentropy.patch new file mode 100644 index 0000000000..a4137d81f0 --- /dev/null +++ b/gnu/packages/patches/newlib-getentropy.patch @@ -0,0 +1,380 @@ +Patch-Source: https://github.com/zephyrproject-rtos/gcc/pull/8 + +From 55addb0c0c5ff5e0aab85574aa26abf175af85c8 Mon Sep 17 00:00:00 2001 +From: Stephanos Ioannidis +Date: Mon, 25 Jul 2022 23:10:41 +0900 +Subject: [PATCH] libstdc++: Do not check getentropy and arc4random for cro= ss builds + +The "getentropy" and "arc4random" check may not yield a correct result +for the cross compile builds because linking is often not available for +them and the C library headers (notoriously, newlib) may still declare +these function prototypes even if they are not actually part of the +final library -- for this reason, this commit disables the "getentropy" +and "arc4random" checks for non-native builds. + +This effectively prevents the std::random_device from making use of +these functions when `--with-newlib` is specified, which is indeed a +correct behaviour because the newlib does not provide a default stub +for the "getentropy" function (also note that the newlib "arc4random" +implementation internally calls the missing "getentropy" function). + +For other C libraries, the `GLIBCXX_CROSSCONFIG` function may hard-code +the availability of these functions by manually defining +`HAVE_GETENTROPY` and `HAVE_ARC4RANDOM`, or by calling the +`GLIBCXX_CHECK_GETENTROPY` and `GLIBCXX_CHECK_ARC4RANDOM` functions. + +libstdc++-v3: +=09* configure.ac: Relocate GLIBCXX_CHECK_GETENTROPY and +=09GLIBCXX_CHECK_ARC4RANDOM +=09* configure: Regenerate. + +Signed-off-by: Stephanos Ioannidis +--- + libstdc++-v3/configure | 300 +++++++++++++++++++------------------- + libstdc++-v3/configure.ac | 8 +- + 2 files changed, 154 insertions(+), 154 deletions(-) + +diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure +index 0ce74e8202443..5d43b56b03ffa 100755 +--- a/libstdc++-v3/configure ++++ b/libstdc++-v3/configure +@@ -28088,6 +28088,156 @@ $as_echo "#define _GLIBCXX_USE_RANDOM_TR1 1" >>c= onfdefs.h +=20 +=20 +=20 ++ # Check for other random number APIs ++ ++ ++ ++ ac_ext=3Dcpp ++ac_cpp=3D'$CXXCPP $CPPFLAGS' ++ac_compile=3D'$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link=3D'$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS confte= st.$ac_ext $LIBS >&5' ++ac_compiler_gnu=3D$ac_cv_cxx_compiler_gnu ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getentropy" >&5 ++$as_echo_n "checking for getentropy... " >&6; } ++if ${glibcxx_cv_getentropy+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ++ if test x$gcc_no_link =3D xyes; then ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++unsigned i; ++=09 ::getentropy(&i, sizeof(i)); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_cxx_try_compile "$LINENO"; then : ++ glibcxx_cv_getentropy=3Dyes ++else ++ glibcxx_cv_getentropy=3Dno ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++else ++ if test x$gcc_no_link =3D xyes; then ++ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "= $LINENO" 5 ++fi ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++unsigned i; ++=09 ::getentropy(&i, sizeof(i)); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_cxx_try_link "$LINENO"; then : ++ glibcxx_cv_getentropy=3Dyes ++else ++ glibcxx_cv_getentropy=3Dno ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_getentropy" = >&5 ++$as_echo "$glibcxx_cv_getentropy" >&6; } ++ ++ if test $glibcxx_cv_getentropy =3D yes; then ++ ++$as_echo "#define HAVE_GETENTROPY 1" >>confdefs.h ++ ++ fi ++ ac_ext=3Dc ++ac_cpp=3D'$CPP $CPPFLAGS' ++ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.= $ac_ext $LIBS >&5' ++ac_compiler_gnu=3D$ac_cv_c_compiler_gnu ++ ++ ++ ++ ++ ++ ac_ext=3Dcpp ++ac_cpp=3D'$CXXCPP $CPPFLAGS' ++ac_compile=3D'$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link=3D'$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS confte= st.$ac_ext $LIBS >&5' ++ac_compiler_gnu=3D$ac_cv_cxx_compiler_gnu ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random" >&5 ++$as_echo_n "checking for arc4random... " >&6; } ++if ${glibcxx_cv_arc4random+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ++ if test x$gcc_no_link =3D xyes; then ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++unsigned i =3D ::arc4random(); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_cxx_try_compile "$LINENO"; then : ++ glibcxx_cv_arc4random=3Dyes ++else ++ glibcxx_cv_arc4random=3Dno ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++else ++ if test x$gcc_no_link =3D xyes; then ++ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "= $LINENO" 5 ++fi ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++unsigned i =3D ::arc4random(); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_cxx_try_link "$LINENO"; then : ++ glibcxx_cv_arc4random=3Dyes ++else ++ glibcxx_cv_arc4random=3Dno ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_arc4random" = >&5 ++$as_echo "$glibcxx_cv_arc4random" >&6; } ++ ++ if test $glibcxx_cv_arc4random =3D yes; then ++ ++$as_echo "#define HAVE_ARC4RANDOM 1" >>confdefs.h ++ ++ fi ++ ac_ext=3Dc ++ac_cpp=3D'$CPP $CPPFLAGS' ++ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.= $ac_ext $LIBS >&5' ++ac_compiler_gnu=3D$ac_cv_c_compiler_gnu ++ ++ ++ + # For TLS support. +=20 +=20 +@@ -75519,156 +75669,6 @@ $as_echo "#define _GLIBCXX_X86_RDSEED 1" >>confd= efs.h + fi +=20 +=20 +-# Check for other random number APIs +- +- +- +- ac_ext=3Dcpp +-ac_cpp=3D'$CXXCPP $CPPFLAGS' +-ac_compile=3D'$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link=3D'$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS confte= st.$ac_ext $LIBS >&5' +-ac_compiler_gnu=3D$ac_cv_cxx_compiler_gnu +- +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getentropy" >&5 +-$as_echo_n "checking for getentropy... " >&6; } +-if ${glibcxx_cv_getentropy+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- +- if test x$gcc_no_link =3D xyes; then +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main () +-{ +-unsigned i; +-=09 ::getentropy(&i, sizeof(i)); +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : +- glibcxx_cv_getentropy=3Dyes +-else +- glibcxx_cv_getentropy=3Dno +-fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-else +- if test x$gcc_no_link =3D xyes; then +- as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "= $LINENO" 5 +-fi +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main () +-{ +-unsigned i; +-=09 ::getentropy(&i, sizeof(i)); +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_cxx_try_link "$LINENO"; then : +- glibcxx_cv_getentropy=3Dyes +-else +- glibcxx_cv_getentropy=3Dno +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +-fi +- +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_getentropy" = >&5 +-$as_echo "$glibcxx_cv_getentropy" >&6; } +- +- if test $glibcxx_cv_getentropy =3D yes; then +- +-$as_echo "#define HAVE_GETENTROPY 1" >>confdefs.h +- +- fi +- ac_ext=3Dc +-ac_cpp=3D'$CPP $CPPFLAGS' +-ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.= $ac_ext $LIBS >&5' +-ac_compiler_gnu=3D$ac_cv_c_compiler_gnu +- +- +- +- +- +- ac_ext=3Dcpp +-ac_cpp=3D'$CXXCPP $CPPFLAGS' +-ac_compile=3D'$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link=3D'$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS confte= st.$ac_ext $LIBS >&5' +-ac_compiler_gnu=3D$ac_cv_cxx_compiler_gnu +- +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random" >&5 +-$as_echo_n "checking for arc4random... " >&6; } +-if ${glibcxx_cv_arc4random+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- +- if test x$gcc_no_link =3D xyes; then +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main () +-{ +-unsigned i =3D ::arc4random(); +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : +- glibcxx_cv_arc4random=3Dyes +-else +- glibcxx_cv_arc4random=3Dno +-fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-else +- if test x$gcc_no_link =3D xyes; then +- as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "= $LINENO" 5 +-fi +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main () +-{ +-unsigned i =3D ::arc4random(); +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_cxx_try_link "$LINENO"; then : +- glibcxx_cv_arc4random=3Dyes +-else +- glibcxx_cv_arc4random=3Dno +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +-fi +- +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_arc4random" = >&5 +-$as_echo "$glibcxx_cv_arc4random" >&6; } +- +- if test $glibcxx_cv_arc4random =3D yes; then +- +-$as_echo "#define HAVE_ARC4RANDOM 1" >>confdefs.h +- +- fi +- ac_ext=3Dc +-ac_cpp=3D'$CPP $CPPFLAGS' +-ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.= $ac_ext $LIBS >&5' +-ac_compiler_gnu=3D$ac_cv_c_compiler_gnu +- +- +- + # This depends on GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE. +=20 + # Do checks for resource limit functions. +diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac +index e59bcdb29441f..05cdfcddbc43b 100644 +--- a/libstdc++-v3/configure.ac ++++ b/libstdc++-v3/configure.ac +@@ -269,6 +269,10 @@ if $GLIBCXX_IS_NATIVE; then + # For /dev/random and /dev/urandom for std::random_device. + GLIBCXX_CHECK_DEV_RANDOM +=20 ++ # Check for other random number APIs ++ GLIBCXX_CHECK_GETENTROPY ++ GLIBCXX_CHECK_ARC4RANDOM ++ + # For TLS support. + GCC_CHECK_TLS +=20 +@@ -474,10 +478,6 @@ GLIBCXX_CHECK_X86_RDRAND + # Check if assembler supports rdseed opcode. + GLIBCXX_CHECK_X86_RDSEED +=20 +-# Check for other random number APIs +-GLIBCXX_CHECK_GETENTROPY +-GLIBCXX_CHECK_ARC4RANDOM +- + # This depends on GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE. + GLIBCXX_CONFIGURE_TESTSUITE +=20 --=20 2.45.2 From unknown Sun Jun 22 07:39:32 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#73118] [PATCH v2 0/5] Fix arm-none-eabi toolchains and introduce a newer version 12.3.rel1 References: In-Reply-To: Resent-From: Rutherther Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 13 Sep 2024 11:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73118 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73118@debbugs.gnu.org Cc: Rutherther Received: via spool by 73118-submit@debbugs.gnu.org id=B73118.172622773431692 (code B ref 73118); Fri, 13 Sep 2024 11:43:02 +0000 Received: (at 73118) by debbugs.gnu.org; 13 Sep 2024 11:42:14 +0000 Received: from localhost ([127.0.0.1]:42604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp4go-0008F6-8q for submit@debbugs.gnu.org; Fri, 13 Sep 2024 07:42:14 -0400 Received: from mail-4322.protonmail.ch ([185.70.43.22]:11861) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp4gl-0008Ek-MG for 73118@debbugs.gnu.org; Fri, 13 Sep 2024 07:42:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1726227715; x=1726486915; bh=aozW4MAiOFPkgLpRH0kg+0kEeGdjz3iF3EgPJuoNj6w=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=QJiRGj3KuabGMzO4Kj37tlE+6CTuJRAq6Cu85up5s4wHAGahC/TAZx/wkdq1f+V38 aM6JJ6dGMP22u3LXzkfYpa66gaPmCt6sYKhk7kFewo4xt+V4pFshS1EzYzmOJjS4xj AUmubrhvWDTVBsu1xAVYe4yUi+UXccs8KqpyArzC66zxuxDHz+RbDplhfP54bBZcqP 44RhjaxHtVyt9hACnsUax1nwZiA/ozbUX/u1lkRZgASUdsnqjB77qFHf7UwyPYlunh MMF9dmUATapEXc7iMqeTAn2QnhRMjZxsq2Qoo0KKllo8ol6LH5H+3gUAOtua0y3pZf DEkR9bTwn5E8g== Date: Fri, 13 Sep 2024 11:41:51 +0000 From: Rutherther Message-ID: Feedback-ID: 8107604:user:proton X-Pm-Message-ID: 6ac2ffd257b445e8171a878d848ad8e5827705cb MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello all, I've poked around the questions I raised last time. The debugging symbols are quite easy. The only thing missing was that I did not point strip-direc= tories to the correct directory with the libraries. I figured out the make flags I introduced did not really take any effect as= they were in the #:configure-flags and not in #:make-flags. So I fixed that as well. I also did another contribution where I learned a bit about chane log forma= t, and that it should be used with Guix. So I changed the commits to better re= flect this format. Sorry if it's still wrong, I have hard time wrapping my head a= round the exact rules of it. Regards, Rutherther Rutherther (5): gnu: make-gcc-arm-none-eabi: reorder C++ native search paths gnu: make-libstdc++-arm-none-eabi: output libstdc++ to arm-none-eabi. gnu: make-libstdc++-arm-none-eabi: add nano variant gnu: newlib arm-none-eabi-7-2018-q2-update: Add proper newlib-nano variant. gnu: arm-none-eabi toolchain 12.3.rel1 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: f977cb2b609f7122db2cf026cac5ab9d6d44a206 -- 2.46.0 From unknown Sun Jun 22 07:39:32 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#73118] [PATCH v2 1/5] gnu: make-gcc-arm-none-eabi: reorder C++ native search paths Resent-From: Rutherther Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 13 Sep 2024 11:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73118 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73118@debbugs.gnu.org Cc: Rutherther Received: via spool by 73118-submit@debbugs.gnu.org id=B73118.172622773931711 (code B ref 73118); Fri, 13 Sep 2024 11:43:02 +0000 Received: (at 73118) by debbugs.gnu.org; 13 Sep 2024 11:42:19 +0000 Received: from localhost ([127.0.0.1]:42608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp4gs-0008FP-Ii for submit@debbugs.gnu.org; Fri, 13 Sep 2024 07:42:18 -0400 Received: from mail-40134.protonmail.ch ([185.70.40.134]:18621) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp4gr-0008Ex-0o for 73118@debbugs.gnu.org; Fri, 13 Sep 2024 07:42:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1726227721; x=1726486921; bh=u9a7tmO2OQCa+j2f/z26Njg4BxVEv/gtyXgKJey4WJc=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=zM8EInemAmihmE0YCSdX615jipNTApB8Jz2bO8ikR6hKGr25s0Mf7bY7rgIIS4e7v PvO5+bwd7oENbhEMc38VGL7ZVrIobNaMDn5mfIqRiiqqm+ilfSjSiqn3yK5DFMmtli h/mnLNHkLIUuAUETCabvVipjUZr1ExYUFg6nWZ/4j8WkSWW06Wdo1lbRaaMC1ucuKV QiSt/izMvWevo3X7G36P33YXNeKO4iifxhCUAVddzSgnAWnNG2UXmKrOwJUARGGu57 uv6fYWaOoFNHaqZcLDYxPP9Q0QpV2J8/s1fk9k7wjM4p6IEREJtrItaowBFDBOXopM +BmuQPy1u/Jhg== Date: Fri, 13 Sep 2024 11:41:57 +0000 From: Rutherther Message-ID: In-Reply-To: References: Feedback-ID: 8107604:user:proton X-Pm-Message-ID: 95377a280749f52788ea634a3baaad8b13e31c0f MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This fixes native-search-paths of arm-none-eabi toolchains The toolchains CROSS_CPLUS_INCLUDE_PATH had C include directory first, and the C++ as second. Since does #include_next = , the toolchains could not build anything using . The C include has to come later than C++ one. This is already fixed in xgcc search-path. * gnu/packages/embedded.scm (make-gcc-arm-none-eabi-4.9, make-gcc-arm-none-eabi-7-2018-q2-update): [native-search-paths]: Put C incl= ude path as last. Change-Id: Ib7e36e57e510ac87960375cad40ff0b9e749101c --- gnu/packages/embedded.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm index bee65663b6..a7ba9ebe98 100644 --- a/gnu/packages/embedded.scm +++ b/gnu/packages/embedded.scm @@ -201,9 +201,9 @@ (define make-gcc-arm-none-eabi-4.9 (files '("arm-none-eabi/include"))) (search-path-specification (variable "CROSS_CPLUS_INCLUDE_PATH") - (files '("arm-none-eabi/include" - "arm-none-eabi/include/c++" - "arm-none-eabi/include/c++/arm-none-eabi"))) + (files '("arm-none-eabi/include/c++" + "arm-none-eabi/include/c++/arm-none-eabi" + "arm-none-eabi/include"))) (search-path-specification (variable "CROSS_LIBRARY_PATH") (files '("arm-none-eabi/lib"))))))))) @@ -423,9 +423,9 @@ (define make-gcc-arm-none-eabi-7-2018-q2-update (files '("arm-none-eabi/include"))) (search-path-specification (variable "CROSS_CPLUS_INCLUDE_PATH") - (files '("arm-none-eabi/include" - "arm-none-eabi/include/c++" - "arm-none-eabi/include/c++/arm-none-eabi")= )) + (files '("arm-none-eabi/include/c++" + "arm-none-eabi/include/c++/arm-none-eabi" + "arm-none-eabi/include"))) (search-path-specification (variable "CROSS_LIBRARY_PATH") (files '("arm-none-eabi/lib"))))))))) --=20 2.46.0 From unknown Sun Jun 22 07:39:32 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#73118] [PATCH v2 2/5] gnu: make-libstdc++-arm-none-eabi: output libstdc++ to arm-none-eabi. Resent-From: Rutherther Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 13 Sep 2024 11:43:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73118 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73118@debbugs.gnu.org Cc: Rutherther Received: via spool by 73118-submit@debbugs.gnu.org id=B73118.172622774831737 (code B ref 73118); Fri, 13 Sep 2024 11:43:03 +0000 Received: (at 73118) by debbugs.gnu.org; 13 Sep 2024 11:42:28 +0000 Received: from localhost ([127.0.0.1]:42612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp4h2-0008Fm-24 for submit@debbugs.gnu.org; Fri, 13 Sep 2024 07:42:28 -0400 Received: from mail-40134.protonmail.ch ([185.70.40.134]:26743) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp4h0-0008FY-38 for 73118@debbugs.gnu.org; Fri, 13 Sep 2024 07:42:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1726227731; x=1726486931; bh=qA4hs0GthMdQ1Un2d95javi0kmnE+aYlZjcfQSkbXlU=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Aa1sH7chLN476jvs3NTAnripyrTOLV3jXvKUnpuyd7EvP8sBDTobw4sf6Tpu/2OAq uCRMMom1OAwYsR0aAO/AAed8bodDXgcf3rDDC6PIpPnee03AfaPcdzTlegIkz1J4dM e4r8HY9bm8A2VlxpI1+SDehkJ4ST0ts8ljeJtubkFVG6krVj3lVmQFh0o7MIdwWUfN 5pxaUlp/lFJ/jBH5omV+yshcKVrA0HxhtAAZ3zqHn86PndipT9nHIG8MQLjeivMjYp sVWGPrUucwn8B8emhKkvDMIe4BVnivUJDnGgH++QvVIlq1IGKxAsHvQwaZppB9L09v nar89AWLeswIA== Date: Fri, 13 Sep 2024 11:42:04 +0000 From: Rutherther Message-ID: <9db92cc94fd199a5b640a30a1e62c5e2b023df66.1726227323.git.rutherther@protonmail.com> In-Reply-To: References: Feedback-ID: 8107604:user:proton X-Pm-Message-ID: 46a5523f9054c562a077edd9655659aec9950321 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) The libstdc++ made for arm-none-eabi puts the contents into "lib" folder, but that's unexpected when the resulting toolchain is a cross toolchain. The folder should be "arm-none-eabi/lib", that's the path added to CROSS_C_LIBRARY_PATH * gnu/packages/embedded.scm (make-libstdc++-arm-none-eabi): [arguments]<#:configure-flags>: Point --libdir to arm-none-eabi/lib. [arguments]<#:strip-directories>: Set to arm-none-eabi/lib. Change-Id: Ia8b867a1c6ebeedeae9564e0a6a1e0401b35bd5b --- gnu/packages/embedded.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm index a7ba9ebe98..2a482f7e52 100644 --- a/gnu/packages/embedded.scm +++ b/gnu/packages/embedded.scm @@ -493,9 +493,14 @@ (define make-libstdc++-arm-none-eabi "--disable-tls" "--disable-plugin" "--with-newlib" + ,(string-append "--libdir=3D" + (assoc-ref %outputs "out") + "/arm-none-eabi/lib") ,(string-append "--with-gxx-include-dir=3D" (assoc-ref %outputs "out") - "/arm-none-eabi/include/c++"))))) + "/arm-none-eabi/include/c++"))) + ((#:strip-directories _ #f) + ''("arm-none-eabi/lib")))) (native-inputs `(("newlib" ,newlib) ("xgcc" ,xgcc) --=20 2.46.0 From unknown Sun Jun 22 07:39:32 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#73118] [PATCH v2 3/5] gnu: make-libstdc++-arm-none-eabi: add nano variant Resent-From: Rutherther Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 13 Sep 2024 11:43:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73118 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73118@debbugs.gnu.org Cc: Rutherther Received: via spool by 73118-submit@debbugs.gnu.org id=B73118.172622775431755 (code B ref 73118); Fri, 13 Sep 2024 11:43:03 +0000 Received: (at 73118) by debbugs.gnu.org; 13 Sep 2024 11:42:34 +0000 Received: from localhost ([127.0.0.1]:42616 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp4h7-0008G6-Dd for submit@debbugs.gnu.org; Fri, 13 Sep 2024 07:42:33 -0400 Received: from mail-40133.protonmail.ch ([185.70.40.133]:57895) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp4h5-0008Ff-Vw for 73118@debbugs.gnu.org; Fri, 13 Sep 2024 07:42:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1726227736; x=1726486936; bh=udNLGGB43c/llyPSb0aRfTXB/VmsjqG9YagA65wfidk=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=OwBBoF9w9RwSPOYGanI53lly0gDHMP2Q3W37Y+0HrLZh1ogzhomP1+SZHkUVLmtL8 9nd/JnraJrXfk/4FNMgQBrsTL1+qUd7MPivv0k5pyg0apnK8H3zsP1Mj7J/oExc9ay cpdSywv141v7qh6WJYP+ju+niZf5sKsO5NO/UyH/PlthxwmkSo5ujEhMCdAHiYTlvd FlHXg804KyuQgez116pLqAtL6MkO9vBhbbPNYOjCY4lEoRarr+25M8laV6p0Q7E1fz OERkv0eaQcZaObSUVD/MQXTprmiY7iDC6/1GSN8V0TZ/EVbTO1Pxvo+qmAmxz5d+9L 5LWgXp+Qs42tA== Date: Fri, 13 Sep 2024 11:42:12 +0000 From: Rutherther Message-ID: <1b301413ec52ea11d7e2cc603b506966abd63b72.1726227323.git.rutherther@protonmail.com> In-Reply-To: References: Feedback-ID: 8107604:user:proton X-Pm-Message-ID: 9fb46bd22dfc3ec3b727c27345841ca8a245c7ae MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) The arm-none-eabi nano toolchain had same libstdc++ as the non-nano variant= . The libstdc++ should be compiled with -fno-exceptions to make a nano toolchain. Additionally, since the "_nano.a" variants were not present, it was impossi= ble to compile C++ programs with libstdc++ using --specs=3Dnano.specs, since libstdc++_nano.a was not found. The `--with-target-subdir=3D"."` flag is a preparation for gcc-12 introduct= ion since the libstdc++ doesn't build without that, failing on GCC_NO_EXECUTABL= ES error in configure stage. I have not been able to find out another workarou= nd. * gnu/packages/embedded.scm (make-libstdc++-arm-none-eabi): [arguments]<#:make-flags>: Add CFLAGS and CXXFLAGS. [arguments]<#:configure-flags>: Add --with-target-subdir. * gnu/packages/embedded.scm (make-libstdc++-nano-arm-none-eabi): Add variab= le. Change-Id: I06a507fef07352a4ec80d84e4d97065343fc2295 --- gnu/packages/embedded.scm | 74 +++++++++++++++++++++++++++++++++------ 1 file changed, 63 insertions(+), 11 deletions(-) diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm index 2a482f7e52..847eb8059c 100644 --- a/gnu/packages/embedded.scm +++ b/gnu/packages/embedded.scm @@ -483,8 +483,17 @@ (define make-libstdc++-arm-none-eabi (name "libstdc++-arm-none-eabi") (arguments (substitute-keyword-arguments (package-arguments libstdc++) + ((#:make-flags flags #f) + #~(cons* "CFLAGS=3D-g -O2 -fdata-sections -ffunction-sections" + "CXXFLAGS=3D-g -O2 -fdata-sections -ffunction-section= s" + (or #$flags '()))) ((#:configure-flags _) - ``("--target=3Darm-none-eabi" + ``(; This is more of a hack. This option doesn't really seem + ; to change what subdir is used eventually, but without it = there is + ; error: Link tests are not allowed after GCC_NO_EXECUTABLE= S with + ; The 12.3 toolchain + "--with-target-subdir=3D\".\"" + "--target=3Darm-none-eabi" "--host=3Darm-none-eabi" "--disable-libstdcxx-pch" "--enable-multilib" @@ -506,21 +515,64 @@ (define make-libstdc++-arm-none-eabi ("xgcc" ,xgcc) ,@(package-native-inputs libstdc++))))))) =20 +(define make-libstdc++-nano-arm-none-eabi + (mlambda (xgcc newlib-nano) + (let ((base (make-libstdc++-arm-none-eabi xgcc newlib-nano))) + (package + (inherit base) + (name "libstdc++-nano-arm-none-eabi") + (arguments (substitute-keyword-arguments (package-arguments base) + ((#:make-flags flags) + #~(map (lambda (flag) + (if (or (string-prefix? "CFLAGS=3D" flag) + (string-prefix? "CXXFLAGS=3D" flag)= ) + (string-append flag " -fno-exceptions") + flag)) + #$flags)) + ((#:phases phases) + #~(modify-phases #$phases + (add-after 'install 'hardlink-libstdc++ + ;; XXX: Most arm toolchains offer both *.a and= *_nano.a as + ;; newlib and newlib-nano respectively. The h= eaders are + ;; usually arm-none-eabi/include/newlib.h for = newlib and + ;; arm-none-eabi/include/newlib-nano/newlib.h = for newlib-nano. + ;; We have two different toolchain packages fo= r each which + ;; works but is a little strange. + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + ;; The nano.specs file says that newlib-na= no files should + ;; end in "_nano.a" instead of just ".a". = Note that this + ;; applies to all the multilib folders too= . + (for-each + (lambda (file) + (link file + (string-append + ;; Strip ".a" off the end + (substring file 0 (- (string-len= gth file) 2)) + ;; Add "_nano.a" onto the end + "_nano.a"))) + (find-files + out "^(libstdc\\+\\+.a|libsupc\\+\\+.a)$= "))))))))))))) + (define make-arm-none-eabi-toolchain (mlambda (xgcc newlib) "Produce a cross-compiler toolchain package with the compiler XGCC and= the C library variant NEWLIB." - (let ((newlib-with-xgcc - (package - (inherit newlib) - (native-inputs - (alist-replace "xgcc" (list xgcc) - (package-native-inputs newlib)))))) + (let* ((nano? (string=3D? (package-name newlib) + "newlib-nano")) + (newlib-with-xgcc + (package + (inherit newlib) + (native-inputs + (alist-replace "xgcc" (list xgcc) + (package-native-inputs newlib))))) + (libstdc++ + (if nano? + (make-libstdc++-nano-arm-none-eabi xgcc newlib-with-xgcc) + (make-libstdc++-arm-none-eabi xgcc newlib-with-xgcc)))) (package (name (string-append "arm-none-eabi" - (if (string=3D? (package-name newlib-with-xgc= c) - "newlib-nano") - "-nano" "") + (if nano? "-nano" "") "-toolchain")) (version (package-version xgcc)) (source #f) @@ -537,7 +589,7 @@ (define make-arm-none-eabi-toolchain directories)))))) (propagated-inputs `(("binutils" ,(cross-binutils "arm-none-eabi")) - ("libstdc++" ,(make-libstdc++-arm-none-eabi xgcc newlib-with-xg= cc)) + ("libstdc++" ,libstdc++) ("gcc" ,xgcc) ("newlib" ,newlib-with-xgcc))) (synopsis "Complete GCC tool chain for ARM bare metal development"= ) --=20 2.46.0 From unknown Sun Jun 22 07:39:32 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#73118] [PATCH v2 4/5] gnu: newlib arm-none-eabi-7-2018-q2-update: Add proper newlib-nano variant. Resent-From: Rutherther Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 13 Sep 2024 11:43:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73118 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73118@debbugs.gnu.org Cc: Rutherther Received: via spool by 73118-submit@debbugs.gnu.org id=B73118.172622776231783 (code B ref 73118); Fri, 13 Sep 2024 11:43:04 +0000 Received: (at 73118) by debbugs.gnu.org; 13 Sep 2024 11:42:42 +0000 Received: from localhost ([127.0.0.1]:42620 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp4hG-0008GZ-0y for submit@debbugs.gnu.org; Fri, 13 Sep 2024 07:42:42 -0400 Received: from mail-4316.protonmail.ch ([185.70.43.16]:43575) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp4hD-0008GE-Mc for 73118@debbugs.gnu.org; Fri, 13 Sep 2024 07:42:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1726227744; x=1726486944; bh=KpKZ0skQugrRbPEV570E1FIljw3H/AHNGpR/HHlv+Ig=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=o/rcFGTmlV9rqvZMMVNOaGJrcLk9nO3MYZRjDB7B+4p7j2PaiUwkJv6d4V0Yoq9vB 7Kbmx5cuMCvPoMEVGE1yhRkXAAmyi+UczqQpGcKhEAawTOyhFhS/+v0PWxdtIZC70v 18F70F0CwXYLI6F7apjVGzfOBOYVGVypYU8c01vXKcIMX+6381hmACionqtNHoVm1s m5ag72JqVav5X3WeKwx3XKANwTgXvfm/PKVjjcj3SEcYJdYJa6k5vjFRdrt/ZILaDC X3pPFwOCpHzbYeeIxI6jHy3MG3wGGnbIB5bBw4PJfcJErnBzKVPLMGZPK6oicUceSM wy8dkXYCuGHOQ== Date: Fri, 13 Sep 2024 11:42:19 +0000 From: Rutherther Message-ID: In-Reply-To: References: Feedback-ID: 8107604:user:proton X-Pm-Message-ID: 010e5a775c7143f7969a38871d0352cd84632895 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) The nano variant for was not nano. It was just a copy of the original one with different name. This meant there were no _nano.a files present at all, and the flags were the same, not producing a smaller library. * gnu/packages/embedded.scm (make-base-newlib-arm-none-eabi-7-2018-q2-updat= e): Rename variable from make-newlib-arm-none-eabi-7-2018-q2-update. * gnu/packages/embedded.scm (make-newlib-nano-arm-none-eabi-7-2018-q2-updat= e): Add variable. * gnu/packages/embedded.scm (make-newlib-arm-none-eabi-7-2018-q2-update): Inherit from make-base-newlib-arm-none-eabi-7-2018-q2-update. Change-Id: I01517ed860dfb2b6a9c7e912fd724832f5a0500a --- gnu/packages/embedded.scm | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm index 847eb8059c..4b9da1f529 100644 --- a/gnu/packages/embedded.scm +++ b/gnu/packages/embedded.scm @@ -247,10 +247,7 @@ (define make-newlib-arm-none-eabi (modify-phases %standard-phases (add-after 'unpack 'fix-references-to-/bin/sh (lambda _ - (substitute* '("libgloss/arm/cpu-init/Makefile.in" - "libgloss/arm/Makefile.in" - "libgloss/libnosys/Makefile.in" - "libgloss/Makefile.in") + (substitute* (find-files "libgloss" "^Makefile\\.in$") (("/bin/sh") (which "sh"))) #t))))) (native-inputs @@ -430,12 +427,11 @@ (define make-gcc-arm-none-eabi-7-2018-q2-update (variable "CROSS_LIBRARY_PATH") (files '("arm-none-eabi/lib"))))))))) =20 -(define make-newlib-arm-none-eabi-7-2018-q2-update +(define make-base-newlib-arm-none-eabi-7-2018-q2-update ;; This is the same commit as used for the 7-2018-q2-update release ;; according to the release.txt. - (mlambda () - (let ((base (make-newlib-arm-none-eabi)) - (commit "3ccfb407af410ba7e54ea0da11ae1e40b554a6f4") + (mlambda (base) + (let ((commit "3ccfb407af410ba7e54ea0da11ae1e40b554a6f4") (revision "0")) (package (inherit base) @@ -464,15 +460,13 @@ (define make-newlib-arm-none-eabi-7-2018-q2-update ("xgcc" ,(make-gcc-arm-none-eabi-7-2018-q2-update)) ("texinfo" ,texinfo))))))) =20 -(define-public make-newlib-nano-arm-none-eabi-7-2018-q2-update +(define make-newlib-arm-none-eabi-7-2018-q2-update (mlambda () - (let ((base (make-newlib-arm-none-eabi-7-2018-q2-update))) - (package - (inherit base) - (name "newlib-nano") - (arguments - (package-arguments base)) - (synopsis "Newlib variant for small systems with limited memory"))= ))) + (make-base-newlib-arm-none-eabi-7-2018-q2-update (make-newlib-arm-none= -eabi)))) + +(define make-newlib-nano-arm-none-eabi-7-2018-q2-update + (mlambda () + (make-base-newlib-arm-none-eabi-7-2018-q2-update (make-newlib-nano-arm= -none-eabi)))) =20 =0C (define make-libstdc++-arm-none-eabi --=20 2.46.0 From unknown Sun Jun 22 07:39:32 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#73118] [PATCH v2 5/5] gnu: arm-none-eabi toolchain 12.3.rel1 Resent-From: Rutherther Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 13 Sep 2024 11:43:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73118 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73118@debbugs.gnu.org Cc: Rutherther Received: via spool by 73118-submit@debbugs.gnu.org id=B73118.172622776931808 (code B ref 73118); Fri, 13 Sep 2024 11:43:04 +0000 Received: (at 73118) by debbugs.gnu.org; 13 Sep 2024 11:42:49 +0000 Received: from localhost ([127.0.0.1]:42624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp4hM-0008Gv-FV for submit@debbugs.gnu.org; Fri, 13 Sep 2024 07:42:49 -0400 Received: from mail-40131.protonmail.ch ([185.70.40.131]:24443) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sp4hJ-0008GO-Sr for 73118@debbugs.gnu.org; Fri, 13 Sep 2024 07:42:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1726227750; x=1726486950; bh=dQfOtroz/cKOcxKYujls6p9M94cFfNe+0KsuIwtG7lo=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=OKmX0f7gZxg6WDiqzlGZeHEVzI8yAX+Dk/zTDqbVnysPGlxix5e1xBPheuppRMVTY fV00UCnvbm0sTjbOTdV5rjhvgSNxy2JdUw+wC8BYwPSFgA9gGEZrkfmggiq4ICyf8w SL1GuZDqNIiiEiaoocJFqH5eTY27p10IhTrTJJfpWSChuvAEdNYj5J+A0MqNLB9gXD 7ciNhsAHkt1fXaq7vr7RuH9qjqv/4UShisvbWjZo9d4Swn47oN/nEcDRvqVX+K2SPa PAluuXA917JXsXEE5rr1dF6UNTK/SmjjqDO75to8JdqrP9J+IOM4qv6f5HNOk4me91 iI23BRbMAwbqw== Date: Fri, 13 Sep 2024 11:42:26 +0000 From: Rutherther Message-ID: <19457873ffa7dc65eef642a8e791fa37a4ba16c4.1726227323.git.rutherther@protonmail.com> In-Reply-To: References: Feedback-ID: 8107604:user:proton X-Pm-Message-ID: 4a93e7b4bcab4960833702400869b524a5829211 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Introduces arm-none-eabi 12.3.rel1 toolchain The arguments for this toolchain are taken mostly out of here https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads/12-3-rel1 * gnu/packages/patches/newlib-getentropy.patch: Add a patch. * gnu/local.mk: Register it. * gnu/packages/embedded.scm (make-gcc-arm-none-eabi-12.3.rel1): Add variabl= e. * gnu/packages/embedded.scm (make-newlib-arm-none-eabi-12.3.rel1): Add vari= able. * gnu/packages/embedded.scm (make-newlib-nano-arm-none-eabi-12.3.rel1): Add= variable. * gnu/packages/embedded.scm (make-arm-none-eabi-toolchain-12.3.rel1): Add v= ariable. * gnu/packages/embedded.scm (make-arm-none-eabi-toolchain-nano-12.3.rel1): = Add variable. Change-Id: If4220c6bc7b1def240cbb9d5d245758f7c51a8a0 --- gnu/local.mk | 1 + gnu/packages/embedded.scm | 110 +++++- gnu/packages/patches/newlib-getentropy.patch | 380 +++++++++++++++++++ 3 files changed, 490 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/newlib-getentropy.patch diff --git a/gnu/local.mk b/gnu/local.mk index ed630041ff..ce40b7e28b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1800,6 +1800,7 @@ dist_patch_DATA =3D=09=09=09=09=09=09\ %D%/packages/patches/ngircd-handle-zombies.patch=09=09\ %D%/packages/patches/network-manager-plugin-path.patch=09\ %D%/packages/patches/network-manager-meson.patch=09=09\ + %D%/packages/patches/newlib-getentropy.patch=09=09=09\ %D%/packages/patches/nginx-socket-cloexec.patch=09=09\ %D%/packages/patches/nickle-man-release-date.patch=09=09\ %D%/packages/patches/nnpack-system-libraries.patch=09=09\ diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm index 4b9da1f529..cc999d35f8 100644 --- a/gnu/packages/embedded.scm +++ b/gnu/packages/embedded.scm @@ -78,22 +78,27 @@ (define-module (gnu packages embedded) #:export (make-gcc-arm-none-eabi-4.9 make-gcc-arm-none-eabi-6 make-gcc-arm-none-eabi-7-2018-q2-update + make-gcc-arm-none-eabi-12.3.rel1 =20 make-gcc-vc4 =20 make-newlib-arm-none-eabi make-newlib-arm-none-eabi-7-2018-q2-update + make-newlib-arm-none-eabi-12.3.rel1 =20 make-newlib-nano-arm-none-eabi make-newlib-nano-arm-none-eabi-7-2018-q2-update + make-newlib-nano-arm-none-eabi-12.3.rel1 =20 make-arm-none-eabi-toolchain-4.9 make-arm-none-eabi-toolchain-6 make-arm-none-eabi-toolchain-7-2018-q2-update + make-arm-none-eabi-toolchain-12.3.rel1 =20 make-arm-none-eabi-nano-toolchain-4.9 make-arm-none-eabi-nano-toolchain-6 make-arm-none-eabi-nano-toolchain-7-2018-q2-update + make-arm-none-eabi-nano-toolchain-12.3.rel1 =20 make-gdb-arm-none-eabi =20 @@ -468,12 +473,103 @@ (define make-newlib-nano-arm-none-eabi-7-2018-q2-upd= ate (mlambda () (make-base-newlib-arm-none-eabi-7-2018-q2-update (make-newlib-nano-arm= -none-eabi)))) =20 +=0C +;;; The following definitions are for the "12.3.rel1" variant of the +;;; ARM cross toolchain as offered on https://developer.arm.com +(define-public make-gcc-arm-none-eabi-12.3.rel1 + (mlambda () + (let ((base (make-gcc-arm-none-eabi-7-2018-q2-update)) + (xgcc-base (cross-gcc "arm-none-eabi" + #:xgcc gcc-12 + #:xbinutils (cross-binutils "arm-none-eabi= ")))) + (package + (inherit base) + (version "12.3.rel1") + (source + (origin + (inherit (package-source xgcc-base)) + (method git-fetch) + (uri (git-reference + (url "git://gcc.gnu.org/git/gcc.git") + (commit "0f54a73b998b72f7c8452a63730ec3b16fc47854"))) + (sha256 + (base32 "0r6q0m3d8g3k3rkmnqjw8aw5fcnsrmywf4ispdkxmk1al3whk1vk"= )))) + (arguments + (substitute-keyword-arguments (package-arguments base) + ((#:phases phases) + #~(modify-phases #$phases + (replace 'expand-version-string + (lambda _ + (make-file-writable "gcc/DEV-PHASE") + (with-output-to-file "gcc/DEV-PHASE" + (lambda () + (display "12.3.rel1"))))))) + ((#:configure-flags flags) + #~(cons* "--with-multilib-list=3Daprofile,rmprofile" + "--with-headers=3Dyes" + "--enable-checking=3Drelease" + "--with-gnu-as" + "--with-gnu-ld" + (filter + (lambda (flag) + (not (member flag + '("--with-multilib-list=3Drmprofile" + "--enable-plugins" + "--disable-libffi")))) + #$flags))))))))) + +(define make-base-newlib-arm-none-eabi-12.3.rel1 + (mlambda (original-base) + (let ((base (make-base-newlib-arm-none-eabi-7-2018-q2-update original-= base)) + (commit "4c7d0dfec5793cbf5cf3930b91f930479126d8ce") + (revision "0")) + (package + (inherit base) + (version (git-version "4.3.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "http://sourceware.org/git/newlib-cygwin.git") + (commit commit))) + (sha256 + (base32 + "0drs9v8avh4y2h5bs0ixjn9x662jzkkikx8z034wgl41dxmn6786")))) + (arguments (substitute-keyword-arguments (package-arguments base) + ((#:configure-flags flags) + #~(cons* "--enable-newlib-mb" + "--enable-newlib-reent-check-verify" + "--enable-newlib-register-fini" + #$flags)))))))) + +(define make-newlib-arm-none-eabi-12.3.rel1 + (mlambda () + (make-base-newlib-arm-none-eabi-12.3.rel1 (make-newlib-arm-none-eabi))= )) + +(define make-newlib-nano-arm-none-eabi-12.3.rel1 + (mlambda () + (make-base-newlib-arm-none-eabi-12.3.rel1 (make-newlib-nano-arm-none-e= abi)))) + =0C (define make-libstdc++-arm-none-eabi (mlambda (xgcc newlib) - (let ((libstdc++ (make-libstdc++ xgcc))) + (let* ((libstdc++ (make-libstdc++ xgcc)) + (src (package-source libstdc++))) (package (inherit libstdc++) + (source + (origin + (inherit src) + (patches (append + ; libstdc++ cannot be linked with since the configure= phase + ; cannot detect properly the presence of getentropy f= unction. + ; The function is inside of a header, but it's not pr= esent in the resulting + ; newlib. configure will conclude getentropy is prese= nt, + ; random will use getentropy, and any linking with ra= ndom will fail. + (if (version>=3D? (package-version xgcc) "12.0") + (search-patches "newlib-getentropy.patch") + '()) + (origin-patches src))))) (name "libstdc++-arm-none-eabi") (arguments (substitute-keyword-arguments (package-arguments libstdc++) @@ -626,6 +722,18 @@ (define make-arm-none-eabi-nano-toolchain-7-2018-q2-up= date (make-gcc-arm-none-eabi-7-2018-q2-update) (make-newlib-nano-arm-none-eabi-7-2018-q2-update)))) =20 +(define make-arm-none-eabi-toolchain-12.3.rel1 + (mlambda () + (make-arm-none-eabi-toolchain + (make-gcc-arm-none-eabi-12.3.rel1) + (make-newlib-arm-none-eabi-12.3.rel1)))) + +(define make-arm-none-eabi-nano-toolchain-12.3.rel1 + (mlambda () + (make-arm-none-eabi-toolchain + (make-gcc-arm-none-eabi-12.3.rel1) + (make-newlib-nano-arm-none-eabi-12.3.rel1)))) + (define make-gdb-arm-none-eabi (mlambda () (package diff --git a/gnu/packages/patches/newlib-getentropy.patch b/gnu/packages/pa= tches/newlib-getentropy.patch new file mode 100644 index 0000000000..a4137d81f0 --- /dev/null +++ b/gnu/packages/patches/newlib-getentropy.patch @@ -0,0 +1,380 @@ +Patch-Source: https://github.com/zephyrproject-rtos/gcc/pull/8 + +From 55addb0c0c5ff5e0aab85574aa26abf175af85c8 Mon Sep 17 00:00:00 2001 +From: Stephanos Ioannidis +Date: Mon, 25 Jul 2022 23:10:41 +0900 +Subject: [PATCH] libstdc++: Do not check getentropy and arc4random for cro= ss builds + +The "getentropy" and "arc4random" check may not yield a correct result +for the cross compile builds because linking is often not available for +them and the C library headers (notoriously, newlib) may still declare +these function prototypes even if they are not actually part of the +final library -- for this reason, this commit disables the "getentropy" +and "arc4random" checks for non-native builds. + +This effectively prevents the std::random_device from making use of +these functions when `--with-newlib` is specified, which is indeed a +correct behaviour because the newlib does not provide a default stub +for the "getentropy" function (also note that the newlib "arc4random" +implementation internally calls the missing "getentropy" function). + +For other C libraries, the `GLIBCXX_CROSSCONFIG` function may hard-code +the availability of these functions by manually defining +`HAVE_GETENTROPY` and `HAVE_ARC4RANDOM`, or by calling the +`GLIBCXX_CHECK_GETENTROPY` and `GLIBCXX_CHECK_ARC4RANDOM` functions. + +libstdc++-v3: +=09* configure.ac: Relocate GLIBCXX_CHECK_GETENTROPY and +=09GLIBCXX_CHECK_ARC4RANDOM +=09* configure: Regenerate. + +Signed-off-by: Stephanos Ioannidis +--- + libstdc++-v3/configure | 300 +++++++++++++++++++------------------- + libstdc++-v3/configure.ac | 8 +- + 2 files changed, 154 insertions(+), 154 deletions(-) + +diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure +index 0ce74e8202443..5d43b56b03ffa 100755 +--- a/libstdc++-v3/configure ++++ b/libstdc++-v3/configure +@@ -28088,6 +28088,156 @@ $as_echo "#define _GLIBCXX_USE_RANDOM_TR1 1" >>c= onfdefs.h +=20 +=20 +=20 ++ # Check for other random number APIs ++ ++ ++ ++ ac_ext=3Dcpp ++ac_cpp=3D'$CXXCPP $CPPFLAGS' ++ac_compile=3D'$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link=3D'$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS confte= st.$ac_ext $LIBS >&5' ++ac_compiler_gnu=3D$ac_cv_cxx_compiler_gnu ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getentropy" >&5 ++$as_echo_n "checking for getentropy... " >&6; } ++if ${glibcxx_cv_getentropy+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ++ if test x$gcc_no_link =3D xyes; then ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++unsigned i; ++=09 ::getentropy(&i, sizeof(i)); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_cxx_try_compile "$LINENO"; then : ++ glibcxx_cv_getentropy=3Dyes ++else ++ glibcxx_cv_getentropy=3Dno ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++else ++ if test x$gcc_no_link =3D xyes; then ++ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "= $LINENO" 5 ++fi ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++unsigned i; ++=09 ::getentropy(&i, sizeof(i)); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_cxx_try_link "$LINENO"; then : ++ glibcxx_cv_getentropy=3Dyes ++else ++ glibcxx_cv_getentropy=3Dno ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_getentropy" = >&5 ++$as_echo "$glibcxx_cv_getentropy" >&6; } ++ ++ if test $glibcxx_cv_getentropy =3D yes; then ++ ++$as_echo "#define HAVE_GETENTROPY 1" >>confdefs.h ++ ++ fi ++ ac_ext=3Dc ++ac_cpp=3D'$CPP $CPPFLAGS' ++ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.= $ac_ext $LIBS >&5' ++ac_compiler_gnu=3D$ac_cv_c_compiler_gnu ++ ++ ++ ++ ++ ++ ac_ext=3Dcpp ++ac_cpp=3D'$CXXCPP $CPPFLAGS' ++ac_compile=3D'$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link=3D'$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS confte= st.$ac_ext $LIBS >&5' ++ac_compiler_gnu=3D$ac_cv_cxx_compiler_gnu ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random" >&5 ++$as_echo_n "checking for arc4random... " >&6; } ++if ${glibcxx_cv_arc4random+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ++ if test x$gcc_no_link =3D xyes; then ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++unsigned i =3D ::arc4random(); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_cxx_try_compile "$LINENO"; then : ++ glibcxx_cv_arc4random=3Dyes ++else ++ glibcxx_cv_arc4random=3Dno ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++else ++ if test x$gcc_no_link =3D xyes; then ++ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "= $LINENO" 5 ++fi ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++unsigned i =3D ::arc4random(); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_cxx_try_link "$LINENO"; then : ++ glibcxx_cv_arc4random=3Dyes ++else ++ glibcxx_cv_arc4random=3Dno ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_arc4random" = >&5 ++$as_echo "$glibcxx_cv_arc4random" >&6; } ++ ++ if test $glibcxx_cv_arc4random =3D yes; then ++ ++$as_echo "#define HAVE_ARC4RANDOM 1" >>confdefs.h ++ ++ fi ++ ac_ext=3Dc ++ac_cpp=3D'$CPP $CPPFLAGS' ++ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.= $ac_ext $LIBS >&5' ++ac_compiler_gnu=3D$ac_cv_c_compiler_gnu ++ ++ ++ + # For TLS support. +=20 +=20 +@@ -75519,156 +75669,6 @@ $as_echo "#define _GLIBCXX_X86_RDSEED 1" >>confd= efs.h + fi +=20 +=20 +-# Check for other random number APIs +- +- +- +- ac_ext=3Dcpp +-ac_cpp=3D'$CXXCPP $CPPFLAGS' +-ac_compile=3D'$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link=3D'$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS confte= st.$ac_ext $LIBS >&5' +-ac_compiler_gnu=3D$ac_cv_cxx_compiler_gnu +- +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getentropy" >&5 +-$as_echo_n "checking for getentropy... " >&6; } +-if ${glibcxx_cv_getentropy+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- +- if test x$gcc_no_link =3D xyes; then +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main () +-{ +-unsigned i; +-=09 ::getentropy(&i, sizeof(i)); +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : +- glibcxx_cv_getentropy=3Dyes +-else +- glibcxx_cv_getentropy=3Dno +-fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-else +- if test x$gcc_no_link =3D xyes; then +- as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "= $LINENO" 5 +-fi +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main () +-{ +-unsigned i; +-=09 ::getentropy(&i, sizeof(i)); +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_cxx_try_link "$LINENO"; then : +- glibcxx_cv_getentropy=3Dyes +-else +- glibcxx_cv_getentropy=3Dno +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +-fi +- +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_getentropy" = >&5 +-$as_echo "$glibcxx_cv_getentropy" >&6; } +- +- if test $glibcxx_cv_getentropy =3D yes; then +- +-$as_echo "#define HAVE_GETENTROPY 1" >>confdefs.h +- +- fi +- ac_ext=3Dc +-ac_cpp=3D'$CPP $CPPFLAGS' +-ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.= $ac_ext $LIBS >&5' +-ac_compiler_gnu=3D$ac_cv_c_compiler_gnu +- +- +- +- +- +- ac_ext=3Dcpp +-ac_cpp=3D'$CXXCPP $CPPFLAGS' +-ac_compile=3D'$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link=3D'$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS confte= st.$ac_ext $LIBS >&5' +-ac_compiler_gnu=3D$ac_cv_cxx_compiler_gnu +- +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random" >&5 +-$as_echo_n "checking for arc4random... " >&6; } +-if ${glibcxx_cv_arc4random+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- +- if test x$gcc_no_link =3D xyes; then +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main () +-{ +-unsigned i =3D ::arc4random(); +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : +- glibcxx_cv_arc4random=3Dyes +-else +- glibcxx_cv_arc4random=3Dno +-fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-else +- if test x$gcc_no_link =3D xyes; then +- as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "= $LINENO" 5 +-fi +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main () +-{ +-unsigned i =3D ::arc4random(); +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_cxx_try_link "$LINENO"; then : +- glibcxx_cv_arc4random=3Dyes +-else +- glibcxx_cv_arc4random=3Dno +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +-fi +- +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_arc4random" = >&5 +-$as_echo "$glibcxx_cv_arc4random" >&6; } +- +- if test $glibcxx_cv_arc4random =3D yes; then +- +-$as_echo "#define HAVE_ARC4RANDOM 1" >>confdefs.h +- +- fi +- ac_ext=3Dc +-ac_cpp=3D'$CPP $CPPFLAGS' +-ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.= $ac_ext $LIBS >&5' +-ac_compiler_gnu=3D$ac_cv_c_compiler_gnu +- +- +- + # This depends on GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE. +=20 + # Do checks for resource limit functions. +diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac +index e59bcdb29441f..05cdfcddbc43b 100644 +--- a/libstdc++-v3/configure.ac ++++ b/libstdc++-v3/configure.ac +@@ -269,6 +269,10 @@ if $GLIBCXX_IS_NATIVE; then + # For /dev/random and /dev/urandom for std::random_device. + GLIBCXX_CHECK_DEV_RANDOM +=20 ++ # Check for other random number APIs ++ GLIBCXX_CHECK_GETENTROPY ++ GLIBCXX_CHECK_ARC4RANDOM ++ + # For TLS support. + GCC_CHECK_TLS +=20 +@@ -474,10 +478,6 @@ GLIBCXX_CHECK_X86_RDRAND + # Check if assembler supports rdseed opcode. + GLIBCXX_CHECK_X86_RDSEED +=20 +-# Check for other random number APIs +-GLIBCXX_CHECK_GETENTROPY +-GLIBCXX_CHECK_ARC4RANDOM +- + # This depends on GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE. + GLIBCXX_CONFIGURE_TESTSUITE +=20 --=20 2.46.0 From unknown Sun Jun 22 07:39:32 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Rutherther Subject: bug#73118: closed (Re: [bug#73118] [PATCH v2 0/5] Fix arm-none-eabi toolchains and introduce a newer version 12.3.rel1) Message-ID: References: <87h69hrzd9.fsf@gnu.org> X-Gnu-PR-Message: they-closed 73118 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 73118@debbugs.gnu.org Date: Sat, 12 Oct 2024 17:44:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1728755042-28881-1" This is a multi-part message in MIME format... ------------=_1728755042-28881-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #73118: [PATCH 0/5] Fix arm-none-eabi toolchains and introduce a newer vers= ion 12.3.rel1 which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 73118@debbugs.gnu.org. --=20 73118: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D73118 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1728755042-28881-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 73118-done) by debbugs.gnu.org; 12 Oct 2024 17:43:42 +0000 Received: from localhost ([127.0.0.1]:54736 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szg9V-0007Uo-Ml for submit@debbugs.gnu.org; Sat, 12 Oct 2024 13:43:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szg9U-0007UX-2S for 73118-done@debbugs.gnu.org; Sat, 12 Oct 2024 13:43:41 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1szg96-0001WJ-VH; Sat, 12 Oct 2024 13:43:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=MEx0xyyCTjYK+FdG+1lD/hnbfqpKIE3WFVfIUdVRFT0=; b=bDGcyQQwhfQP11FLhoFV T5RIvsj2kaBjqvsgEx2qqNgvh2IXBIz+WRNx1JAkbhXsRi+MLD4V+Zph0eBGjyKgx6gtdBhYDXuAj 0EBKb3kBOFbuZKrGcZpFecxwEo1Y9HvV4S6xvzsPVJjXK4U4uadubGCpaFPWn8akdeRC8h9Q5Xos5 dt0mF5VlVRlXNUhFK2Tkcdr9HG0JkZGmVEigE1Bgrk6Pr2PgRTfGAFVLA66yjLZaocnVC849plmMN 76zRDzzHZsZyGY7Hns5GV3NVWRl2raoJGJF/L+pjxR2MlRLij7K020CcWQYThYSao4xdm1EBkSzt/ jgdnR4VB5I/Uxw==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Rutherther Subject: Re: [bug#73118] [PATCH v2 0/5] Fix arm-none-eabi toolchains and introduce a newer version 12.3.rel1 In-Reply-To: (rutherther@protonmail.com's message of "Fri, 13 Sep 2024 11:41:51 +0000") References: Date: Sat, 12 Oct 2024 19:43:14 +0200 Message-ID: <87h69hrzd9.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73118-done Cc: Vagrant Cascadian , 73118-done@debbugs.gnu.org, Efraim Flashner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Rutherther skribis: > I also did another contribution where I learned a bit about chane log for= mat, > and that it should be used with Guix. So I changed the commits to better = reflect > this format. Sorry if it's still wrong, I have hard time wrapping my head= around > the exact rules of it. It=E2=80=99s good. :-) > gnu: make-gcc-arm-none-eabi: reorder C++ native search paths > gnu: make-libstdc++-arm-none-eabi: output libstdc++ to arm-none-eabi. > gnu: make-libstdc++-arm-none-eabi: add nano variant > gnu: newlib arm-none-eabi-7-2018-q2-update: Add proper newlib-nano > variant. > gnu: arm-none-eabi toolchain 12.3.rel1 I went ahead and applied it, thanks! Cc=E2=80=99ing the Embedded team. Efraim, Vagrant: should we added gnu/packages/embedded.scm to the team=E2=80=99s scope? Thanks, Ludo=E2=80=99. ------------=_1728755042-28881-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit 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 To: guix-patches@gnu.org From: Rutherther Subject: [PATCH 0/5] Fix arm-none-eabi toolchains and introduce a newer version 12.3.rel1 Message-ID: Feedback-ID: 8107604:user:proton X-Pm-Message-ID: 5e577786f5e9144a729278452848eae45bd95350 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: Rutherther X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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/l= ib inside of it. I think that the env var is correct, to allow using both c= ross 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 compil= ed 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 rem= ove 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 t= he 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 ------------=_1728755042-28881-1--