From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id AH4ZIuPPHmU39AAA9RJhRA:P1 (envelope-from ) for ; Thu, 05 Oct 2023 17:01:55 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id AH4ZIuPPHmU39AAA9RJhRA (envelope-from ) for ; Thu, 05 Oct 2023 17:01:55 +0200 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 783F440839 for ; Thu, 5 Oct 2023 17:01:48 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=BBNVpioI; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1696518108; 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: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=XdUAksVC3psNA+AjVdMC9yWGnF/tboTPAuOyPe5ShnQ=; b=SEV0lgE9e7dDt/xjZuwWK7eEK5ER/yvZY8a8s9R4AsBEv4bgtfj4hCc7rhpAnoR334YtVb qr6fFwGkYuQ8tVIoFcYEybcmjBXh2C5oWzpKGYx44l6lyxmpNAD8KXmdXKXAptMowvxaFC 8gJC8Fptx0pXuU7/gFEwk0tDbR75w0JmhvFMkl66x0THEClVW5OL18JM3u/Q5sZZnzjTFT tuE3w7wNxYjV8nM3zrKxl7Syhp0YTTt44Ge7eeJFAS3nrP6So0Ar1JN1Dup0EwpBYljXul PleVzlxIBBwZ6sQfWFtiLih38TJ9uxYRXoVP9EAfhokUH/IBzkmFGpqCLIjB6A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1696518108; a=rsa-sha256; cv=none; b=Lru7EyiB2YxBjtrKbOs2Rv8LPxfsQ3fg5wBBtTxXWoHm/SzLa9SC/j2L9lCd+OaHVVfNvE esJEedWA+JXVOUBPjrCda8HjDO35+0XhJNYk2GRGafsnF3uFLjtVGh5Nmf+C3SbqV3fdZg n3kasHIdN2uHyol1gJcpMvO5Em4NFhnFS76U00Tub2jAa08IGJJ9J2GS6CPo1HOax+uhJj qKpqph2jUcXMRjjJ8i4By2OdHXxkB3NMPKgON+OVSHrRUOBZsnQOwoj8l53Kw/pYOwy5hf WLF78r4/HpxhW99yTq+cAen10J/Jd7LqzNkMJ3LCmjLPKYlhffQZLssu/fo8QQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=BBNVpioI; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoPqr-0003sE-Av; Thu, 05 Oct 2023 11:01:22 -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 1qoPqY-0003js-Oq for guix-patches@gnu.org; Thu, 05 Oct 2023 11:01:03 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qoPqG-0005XZ-C6 for guix-patches@gnu.org; Thu, 05 Oct 2023 11:01:00 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qoPqY-0000qB-Hr for guix-patches@gnu.org; Thu, 05 Oct 2023 11:01:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66263] [PATCH 14/23] gnu: cross-gcc-arguments: Handle AVR target. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 05 Oct 2023 15:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66263 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Jean-Pierre De Jesus DIAZ Cc: 66263@debbugs.gnu.org, vagrant@debian.org, efraim@flashner.co.il Received: via spool by 66263-submit@debbugs.gnu.org id=B66263.16965180163157 (code B ref 66263); Thu, 05 Oct 2023 15:01:02 +0000 Received: (at 66263) by debbugs.gnu.org; 5 Oct 2023 15:00:16 +0000 Received: from localhost ([127.0.0.1]:48134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoPpn-0000or-Rf for submit@debbugs.gnu.org; Thu, 05 Oct 2023 11:00:16 -0400 Received: from mail-vk1-xa29.google.com ([2607:f8b0:4864:20::a29]:58582) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoPpd-0000mW-5E for 66263@debbugs.gnu.org; Thu, 05 Oct 2023 11:00:14 -0400 Received: by mail-vk1-xa29.google.com with SMTP id 71dfb90a1353d-49abb53648aso432100e0c.0 for <66263@debbugs.gnu.org>; Thu, 05 Oct 2023 07:59:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696517981; x=1697122781; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=XdUAksVC3psNA+AjVdMC9yWGnF/tboTPAuOyPe5ShnQ=; b=BBNVpioIJBoNbaZ/IKcuE5jPNr017lvDNN79AiRIQ0jrzYKtoHwi4VGNyJsT8j8qyZ WnCgOVeH6cNxJjM/MSrtC6IVIHawPpw4vgf5j0Z8vysDXuouaCrNuweSqTw4ybCmXdeN gPUtdKlsnlR3sr5i+r6ojOdMwl3tL+MFF28pQ07XNdKbBzsTXt/ayU4XSsxPWiKxRwW7 NouM+GK7BUkS8hSFboS0IiO+V/SPU47IohHeI1aoJk2bhImOQ+Uqw8YnIYuxHVEOaV5w BZWAlloNB39zfoAtwyOA0Amm41+uDNXDC27qpzSPsoTNMlqtg8S5hLM6/HkNfvR28tgX tESg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696517981; x=1697122781; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=XdUAksVC3psNA+AjVdMC9yWGnF/tboTPAuOyPe5ShnQ=; b=Li/15EtQ8DNivamUi/9Um+CY51rtMqOcK4QnrGw6eyH5p9uvoRSoOT/QqbW7XDRE9f hBccWN3BRQE+ByNCXOSyrE8LhMbJ9XARN3iTUmfsmLtRrf45RG/BVF5PsmDBO1KMg+oW Drba9qm033ElECn1mgq8dnky/vbaw0Y21LCzM0uaSi+lprKo2JwcAdjBVI4xGALFluIz KAOUfJKL8PONhvjT/KFH5rp3HIMsTaFChkmyiO07i7sCzxdt4QASU9uDppcFPTaWs9ww r8Wdo+/tXTzsiyRU6vSWDSQonCmyMGVhmmfzunivFsHhfkWp071Gf32qp//ScFsHT5yW TFhQ== X-Gm-Message-State: AOJu0Yxd5Zg3F1VKmZEP9d1OIgWAwgCdM/Oy4ch4fh+jteF2LxRGzKF/ qwejP3wT/MCrOGM3YtQdqmDZmAASAtE= X-Google-Smtp-Source: AGHT+IFUTimHNQCRe0OJaqxBIgHGJKt54m81N0R3OnWV9bog2mGSwogsbrp3dVq2gRvITO44AC1jDQ== X-Received: by 2002:a1f:48c7:0:b0:49d:9916:5740 with SMTP id v190-20020a1f48c7000000b0049d99165740mr3949020vka.9.1696517981187; Thu, 05 Oct 2023 07:59:41 -0700 (PDT) Received: from hurd (dsl-151-116.b2b2c.ca. [66.158.151.116]) by smtp.gmail.com with ESMTPSA id d2-20020a05620a158200b00767d4a3f4d9sm547409qkk.29.2023.10.05.07.59.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 07:59:40 -0700 (PDT) From: Maxim Cournoyer In-Reply-To: <20230929091627.7820-14-jean@foundationdevices.com> (Jean-Pierre De Jesus DIAZ's message of "Fri, 29 Sep 2023 11:16:18 +0200") References: <20230929091627.7820-1-jean@foundationdevices.com> <20230929091627.7820-14-jean@foundationdevices.com> Date: Thu, 05 Oct 2023 10:59:39 -0400 Message-ID: <87o7hdqfms.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -5.12 X-Spam-Score: -5.12 X-Migadu-Queue-Id: 783F440839 X-TUID: QHZ0KkfyWbbD Hi, Jean-Pierre De Jesus DIAZ writes: > * gnu/packages/cross-base.scm (cross-gcc-arguments): Handle AVR target. > --- > gnu/packages/cross-base.scm | 25 ++++++++++++++++++++----- > 1 file changed, 20 insertions(+), 5 deletions(-) > > diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm > index fc21e7c4fd..10d912b755 100644 > --- a/gnu/packages/cross-base.scm > +++ b/gnu/packages/cross-base.scm > @@ -204,23 +204,38 @@ (define (cross-gcc-arguments target xgcc libc) > #~("--enable-multilib") > #~()) > > + #$@(if (and libc (target-avr? target)) > + #~("--enable-languages=c,c++" > + (string-append "--with-native-system-header-dir=" > + #$libc "/avr/include" )) > #~())) > > (remove > (lambda (flag) > (or (and (string-match "--enable-languages.*" flag) > #$libc) > + (and (string-match "--with-native-system-header-dir.*" > + flag) > + #$libc > + #$(target-avr? target)) > (and (string-match "--disable-multilib" flag) > #$(target-avr? target)))) > #$flags))) > ((#:make-flags flags) > - (if libc > - #~(let ((libc (assoc-ref %build-inputs "libc"))) > + (cond > + ((and (target-avr? target) libc) > + #~(let ((libc (assoc-ref %build-inputs "libc"))) While at it, you may want to use the more modern #$(this-package-input "libc") > ;; FLAGS_FOR_TARGET are needed for the target libraries to receive > ;; the -Bxxx for the startfiles. > - (cons (string-append "FLAGS_FOR_TARGET=-B" libc "/lib") > - #$flags)) > - flags)) > + (cons (string-append "FLAGS_FOR_TARGET=-B" libc "/avr/lib") > + #$flags))) > + (libc > + #~(let ((libc (assoc-ref %build-inputs "libc"))) > + ;; FLAGS_FOR_TARGET are needed for the target libraries to receive > + ;; the -Bxxx for the startfiles. > + (cons (string-append "FLAGS_FOR_TARGET=-B" libc "/lib") > + #$flags))) > + (else flags))) The only thing that needs to be made conditional here is the "/lib" vs "/avr/lib" prefix, so you could let-bind a LIB-PREFIX variable conditionally and keep the rest shared. -- Thanks, Maxim