From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SB/dFQIAb2CLywAAgWs5BA (envelope-from ) for ; Thu, 08 Apr 2021 15:07:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id EEHvDwIAb2CMOAAAB5/wlQ (envelope-from ) for ; Thu, 08 Apr 2021 13:07:14 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B6B1BABE3 for ; Thu, 8 Apr 2021 15:07:13 +0200 (CEST) Received: from localhost ([::1]:49208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUUNM-0005Xr-UG for larch@yhetil.org; Thu, 08 Apr 2021 09:07:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUUNC-0005Xl-TZ for bug-guix@gnu.org; Thu, 08 Apr 2021 09:07:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34608) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lUUNC-0001BD-Ls for bug-guix@gnu.org; Thu, 08 Apr 2021 09:07:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lUUNC-0006Zr-EX for bug-guix@gnu.org; Thu, 08 Apr 2021 09:07:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#47325: [PATCH] gnu: newlib-nano: Fix nano lib and header paths References: <87ft0nnm7r.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> In-Reply-To: <87ft0nnm7r.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> Resent-From: Morgan.J.Smith@outlook.com Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 08 Apr 2021 13:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47325 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 47325@debbugs.gnu.org Received: via spool by 47325-submit@debbugs.gnu.org id=B47325.161788720625259 (code B ref 47325); Thu, 08 Apr 2021 13:07:02 +0000 Received: (at 47325) by debbugs.gnu.org; 8 Apr 2021 13:06:46 +0000 Received: from localhost ([127.0.0.1]:46154 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lUUMw-0006ZL-8G for submit@debbugs.gnu.org; Thu, 08 Apr 2021 09:06:46 -0400 Received: from mail-mw2nam08olkn2021.outbound.protection.outlook.com ([40.92.46.21]:44193 helo=NAM04-MW2-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lUUMs-0006Z5-2O for 47325@debbugs.gnu.org; Thu, 08 Apr 2021 09:06:45 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ajS9TLPAXYm44s78ZbqHukGF3zQ5iuxj5ZEzqaeg/4y/wB0u0MuZSKbdIV/1s89eylBUXv1ew4VKZMbXeD1XYQVO+4sMBCrog0sjCNxPy2tSS18OdE/ZPbv26SXb+OqOJR6gK74T9kk4Se6BGiPZtlIEe+3Y4x+TE47Xb0asArutV6zE70fYwtoKQVLkSL99oMypvQOUdeq40zsKqs+78Hlg3d4/QXou5Y+kmxpsjaN2PAwho+VSPiQ9X+G9fRGc26mmjtmStz4/E2draZLoT+UXozfYbxM1XIQSNq927M6WXVMWPAdSj/fchPZXKtOHpQwMZqWOumRQ/9GxdviyPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t9nGYTbxZYY7s5az2piBCyEGQOHXqW+F7ruJ7pAuOf8=; b=gzISQAK8tP9cQ3qBCyFXvP4h6IsbMCvXQmUQK1PB0tWITCm4NWOzpFifgVE1/AowcWNNmYmRlhtQYcBppGmyPz/nau81XUeWyMECkoPm4r5t3vJ0IV5Mcy1ZoHdFjiT15VGuImUmKuO6aebtz9x5yEkdDBDM93LFvk8eKw9UwPf483h1TnRtUxG7OcbkEM4k3S002+s2C7EuAyXRUN09Du04DyIDbimyF+yYQaBDzMNvSIshc+Z+H5AgGsh91I7oho++yQ51EXmbubBGeKQTfc/n2TX1FuxdGiIyQfG8ooc3sxbEkOhcMDd/AR+JRmvu8KvhQap8yTYQHGmBDaHksw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t9nGYTbxZYY7s5az2piBCyEGQOHXqW+F7ruJ7pAuOf8=; b=ZmFQjmjRbqQmS5OA9KC78BPnLorhQRDbfXMkpYHahVEv0b/Fa97B2zIUoXgku5PCHsncS6pfS6UBzswLhpF6FIQgddlHcqeXfATavFHUzNbYKxnTsZ4R5s6qUhCgg5wqt778Qp1dKEwWH9ln0an7ajOpLhYHl1J/pe6fSY/C0spZvtzdm9f/bcf9YpBEHRwmQX6tk38vmfPilTw3ZGJxPH8G33Uv04v50RIsN3cbOPxsjzvUtqoyMA5VYdgy+is55jTbbqMEPt9wEGvwDeLyHvvphpuGsPZTGrjQlkm7AtGxN7n91VoGcl71zYku09RvnQSOXgj1OTqzQ3zL4AesPw== Received: from SN1NAM04FT043.eop-NAM04.prod.protection.outlook.com (10.152.88.60) by SN1NAM04HT035.eop-NAM04.prod.protection.outlook.com (10.152.88.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28; Thu, 8 Apr 2021 13:06:35 +0000 Received: from BYAPR05MB4023.namprd05.prod.outlook.com (2a01:111:e400:7e4c::48) by SN1NAM04FT043.mail.protection.outlook.com (2a01:111:e400:7e4c::301) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28 via Frontend Transport; Thu, 8 Apr 2021 13:06:35 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:243EB5A5977880144E4FCB63562528FB6D8F4D077BF8E2853D18F199E15F7EDB; UpperCasedChecksum:8167A75F71F9068B0BBCB666116537229DCCBDAE6716C26D69F0DABF34CA5332; SizeAsReceived:8474; Count:45 Received: from BYAPR05MB4023.namprd05.prod.outlook.com ([fe80::b92f:829e:18e4:7ba9]) by BYAPR05MB4023.namprd05.prod.outlook.com ([fe80::b92f:829e:18e4:7ba9%2]) with mapi id 15.20.4020.016; Thu, 8 Apr 2021 13:06:35 +0000 From: Morgan.J.Smith@outlook.com Date: Thu, 8 Apr 2021 09:02:20 -0400 Message-ID: X-Mailer: git-send-email 2.31.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TMN: [ixJzm6jyo4Ix/mQ+hLYRXK6lRndvZDpw] X-ClientProxiedBy: YQBPR0101CA0064.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:1::41) To BYAPR05MB4023.namprd05.prod.outlook.com (2603:10b6:a02:87::30) X-Microsoft-Original-Message-ID: <20210408130219.15950-1-Morgan.J.Smith@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pancake.hitronhub.home (170.52.80.149) by YQBPR0101CA0064.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:1::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.32 via Frontend Transport; Thu, 8 Apr 2021 13:06:33 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 45 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 49715007-397c-44b8-171d-08d8fa8f225d X-MS-Exchange-SLBlob-MailProps: 7MJMDUNTCtyWy+F9uIfJ5haSOpcVXOGJxENfcsnPfwFxJNs4v6y+1DZ2HSrD6EJiqMUhk1KV8yApJoECkUELJl84YklBajJuhIlNbAAaNsVKQoR9cFwx8xGWhfarKJ//mb9f5tCWM3M02Rl5iroUSqwDjXbcX7mJHsr8NzA6Nh9rCroquWcs8DQrv7nQBjyTc4IU3sv34Ql/rFy7CFYUl8sJK3m5KsWZGgnfuzLb8WszzYvTGgfeHUXDqjbc8lJfqkVPbg34gxN0qvtGwiMye/K41p5gv5av0q1xfG9WfHurB1VDboTQQWgYQ5bRum4Ss8bzEPLWCa0Ds8wgfz6OuXnzH6Mt5D7/0l14lBkMfk24EUMd0lw9VNCMiMwc8soUbg/aCUrLOmA7pnsLJMCvgNr9oLWVJveAHJiGi5uRDKAi2PxbaPUIS5oVvldQHpQ/Vrmy6vQmPyBWmF3wPTLhvr/uhb0mkHfUI98T25nGytq+yGu4SiGRY61qJdohvp+fhjHocU6iMnvbD9++5YWYdh7RdJyHuuipfzJukICdM+ZDwscuHTUruS4B15A2Kbzy/I9mtWmq5RcIYFJaEVS+cFM6dBnr52XZDNWylCC2W2rhkFKaS5Qyrrm5zd42ir5xP5wrJbQy69csb5pXMZFpecyLbVPV+y6X0TLwD6/eO99wUiQClLU6CuxKvAansAMzx5cMDDlbAtf2mW9lHwZfaZKOU9RgDeu1dVf1NXbAXdNz0oJqT6NeMQ== X-MS-TrafficTypeDiagnostic: SN1NAM04HT035: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rH1wUIgaVilghAXjdCSUFFN7vKQ5IbX4eGzZWnky89fMCG4/uurWfhOpfbMOw6GH9lYxeI3aTO9nMAJyHa8eAUp4H9pX9QZp1T5NusMnpXeGHHyk/A6Oyj3x+ty2/LNAaAiqoObZ6FDJV1/56NBh70uduC4b2Lo+G/uNnJumZtR9BeF2jm1vQZPlukuEd/z/44muwRr3Wac/95a8eFZvUK7+u4mGj2Bz0D5b6KoDtUr+rpozCkkw3DqKmYAFviYsyQZeJkIIx0mOVZbUcn/Ytg+RY0D6bZ41rbBiAYNc6ynfpneyMOpe0IPkUJj6dqEnzTdrJadoAMbnvMBHSVu3cNw9q/vodDZMYS8pPfxbPLMLSVVjHP0e9RoiOqsRzdgzHkkLXWTmvC9TefesoB6o8Q== X-MS-Exchange-AntiSpam-MessageData: ZjgqJ1ZMw4wFHuT6OrU7t+w9I1Sl1ByGhtwFS48t5CKTxxjam9zW5XvJy5rB1ZCGQRs7ROapSYCYaytNlDZhgROuo5immGHVl5w7XFNjqtnzTn3m29R86L5lfFXYsrALuEllumaKKHjBDRLTRBA9Sg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49715007-397c-44b8-171d-08d8fa8f225d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2021 13:06:35.2579 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: SN1NAM04FT043.eop-NAM04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1NAM04HT035 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Morgan Smith , anothersms@gmail.com Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1617887233; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=qejNJGe/2YbCYrBEh8ZIqNmuZK6vbpQshp8f2/5qbnM=; b=Py/R8XaRyBwMgoP+rqX/tTbxXqTy23+LwQAphz8JgE7j5ZOhQN1KXToCe4ToOExut3Dcw4 42Ocz9R6jYTC6UdK3TegpnIBObED0koi0F2/yvxTlcUxlHu2cxj8z2bq4MYRTVLhqKyqsx rl7PZeKKm6lVWvFvAuUsIjyuHA+670vcv+68fIhowa3iFZR+dAYeIcJbZ9JROMtsfkvxPs cqtR4uWhs6PJlDtYvA6e5wEhsDOmgB3uESJ/qzFLiVgx/+jcwFsJu+BDBl87+TKjkr9WoF 1tLYNH4Is186LhanKfEIZiZIqs8ODTN6wcYZucZyfcxzWUu0DLtK5iffTh5mSQ== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1617887233; a=rsa-sha256; cv=fail; b=Pn43IPB/dCOgODMiuk2jVdpXz7QmtKeLSVh+M9NguNuQmeSmtRb+KcZxmtvC6G4T+qSrTE zwBCB1IFhbVef2bGECAc+hAj+B0sqOtLTcrlgF5XOrVvNXFoegXwaS/JuIsh0loJyjmc4r /i0zJ5sKp5rceqwpZFOo5Mc6hrvqvV/IAGvLBk+AScPlHRXNL7R0TsC0TEQalQZE8eMjCn HSIfvQsumEl5520BYsd1DdaVVh1GHFq0e3fUMSX31YLud31+l18WtpwNeYFHzZFbKH6j8B ZO19Vk5pfWRiJYAgK4Run9XaGe0e+JU6HtK0wI1wRiwjQZony1PW0pDVn/R++A== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=outlook.com header.s=selector1 header.b=ZmFQjmjR; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed)" header.from=outlook.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: 0.66 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=outlook.com header.s=selector1 header.b=ZmFQjmjR; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed)" header.from=outlook.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: B6B1BABE3 X-Spam-Score: 0.66 X-Migadu-Scanner: scn0.migadu.com X-TUID: w+Ev3PqCUGv+ From: Morgan Smith * gnu/packages/embedded.scm (newlib-nano-arm-none-eabi)[arguments]: Hard link library files from *.a to *_nano.a. Hard link newlib.h to a common location. --- I CC'd Efraim because they commited my last gcc-arm-none-eabi patch. I hope that's ok. I'm not really sure who is responsible for this toolchain. I successfully compiled some QMK firmware using this patch, something that failed previously. gnu/packages/embedded.scm | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm index a3f1d85580..ea5bfdbdd1 100644 --- a/gnu/packages/embedded.scm +++ b/gnu/packages/embedded.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2020 Marius Bakke ;;; Copyright © 2020 Björn Höfling ;;; Copyright © 2021 Julien Lepiller +;;; Copyright © 2021 Morgan Smith ;;; ;;; This file is part of GNU Guix. ;;; @@ -229,7 +230,40 @@ (define-public newlib-nano-arm-none-eabi "--enable-lite-exit" "--enable-newlib-global-atexit" "--enable-newlib-nano-formatted-io" - "--disable-nls")))) + "--disable-nls")) + ((#:phases phases) + `(modify-phases ,phases + ;; XXX: Most arm toolchains offer both *.a and *_nano.a as newlib + ;; and newlib-nano respectively. The headers 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 for each which works but + ;; is a little strange. + (add-after 'install 'hardlink-newlib + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + ;; The nano.specs file says that newlib-nano 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-length file) 2)) + ;; Add "_nano.a" onto the end + "_nano.a"))) + (find-files + out + "^(libc.a|libg.a|librdimon.a|libstdc\\+\\+.a|libsupc\\+\\+.a)$")) + + ;; newlib.h is usually in this location instead so both + ;; newlib and newlib-nano can be in the toolchain at the same + ;; time + (mkdir (string-append out "/arm-none-eabi/include/newlib-nano")) + (link (string-append out "/arm-none-eabi/include/newlib.h") + (string-append out "/arm-none-eabi/include/newlib-nano/newlib.h")) + #t))))))) (synopsis "Newlib variant for small systems with limited memory"))) -- 2.31.1