From patchwork Fri Sep 29 09:16:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Pierre De Jesus DIAZ X-Patchwork-Id: 54406 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5E02327BBEC; Fri, 29 Sep 2023 10:19:19 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4760427BBE2 for ; Fri, 29 Sep 2023 10:19:18 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9dr-0005wm-Kp; Fri, 29 Sep 2023 05:18:35 -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 1qm9dG-0005Uh-Ty for guix-patches@gnu.org; Fri, 29 Sep 2023 05:18:00 -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 1qm9dA-0003uj-KK for guix-patches@gnu.org; Fri, 29 Sep 2023 05:17:53 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qm9dO-0004mU-D5; Fri, 29 Sep 2023 05:18:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66263] [PATCH 14/23] gnu: cross-gcc-arguments: Handle AVR target. Resent-From: Jean-Pierre De Jesus DIAZ Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, vagrant@debian.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Fri, 29 Sep 2023 09:18:06 +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: 66263@debbugs.gnu.org Cc: Jean-Pierre De Jesus DIAZ , efraim@flashner.co.il, vagrant@debian.org, maxim.cournoyer@gmail.com X-Debbugs-Original-Xcc: efraim@flashner.co.il, vagrant@debian.org, maxim.cournoyer@gmail.com Received: via spool by 66263-submit@debbugs.gnu.org id=B66263.169597905418147 (code B ref 66263); Fri, 29 Sep 2023 09:18:06 +0000 Received: (at 66263) by debbugs.gnu.org; 29 Sep 2023 09:17:34 +0000 Received: from localhost ([127.0.0.1]:55206 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qm9co-0004iT-5Z for submit@debbugs.gnu.org; Fri, 29 Sep 2023 05:17:34 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:55601) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qm9cU-0004eZ-Rx for 66263@debbugs.gnu.org; Fri, 29 Sep 2023 05:17:12 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-40528376459so142574965e9.3 for <66263@debbugs.gnu.org>; Fri, 29 Sep 2023 02:16:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundationdevices.com; s=google; t=1695979010; x=1696583810; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZRQJVpelh3QbJW9lwGQ4hvwsLadwfndLJJ4N+/M+z04=; b=H4hbKZ2CdQB/e1BxRkdFj71D2YIHGwI8ZmDKJibHK3NRt1GWdP9BBFnH16OwmAvvpa oODjy7U5FffaSUed8WwrPI9ttlprqZUf5w0aZEjAhnXaK7TFLvzoZNQ2sX8Io23Qnj3K +qGjQyJXQAOgx8sm25yW2/o4H8v8IqBmaTz/kKzYPloN3DRcnJ28P8HBUy0s6aqaVRon 7xm+Vv5hZe3ArSQpXpdKvwJto2U5VB8R3hsdNFOZXvXa5JcyNurRfh3ryonnaTPxEk43 D39GhalubgzthrBxhIpdpikYAJB+F+GAFR1mlK77VmCXaHfkwHCIul8torc1/l3vAXUW f1zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695979010; x=1696583810; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZRQJVpelh3QbJW9lwGQ4hvwsLadwfndLJJ4N+/M+z04=; b=mnsiBcrRLLQqpr1IsmCPU7yR7/bhPOL1emtfc41cy1FJFrFjeDCTdS1x8USeKqo3Ft NrcBRoau15Q6E+Ab0yJ53ONzpfT+1cXZ2Kpo4SRiuuvqBgoZRSDv6GerQtTW+clmp7T/ 5SstmJI5WwQmcL+D3m+0ZmZ+N7vEn5QGBn2DiSoFjyE5SFAVUaeLgXV2j31uZJJUI/LP rB8N9YYFmybgX5veTCatf/3F3UtsU08bqMBu2MZm/FacwBXVrei+iq85FwA5fyTJrlfh M4v9y2rOzvt4dBVi7KYY4Iajh7nRTx3LSnW++isNms6ljkpRAGoulJvSWkpBd2nydGyR KyQg== X-Gm-Message-State: AOJu0YxZ+WvzlAuYc1u8quVLnsxgmk6eimatex17DgUAVIAzrDLWdI/E uC/artS+VX4pZ8eanMaF10umbvB+2OyWlFjVA9Fm6g== X-Google-Smtp-Source: AGHT+IHSwXfY6cgznAYtEaobAnfRRahfcY9x1t6+MW9Ju6JZpt6GeEZAlZEz38XkCC3vm05Hhgms7w== X-Received: by 2002:a05:600c:22d1:b0:405:3251:47a1 with SMTP id 17-20020a05600c22d100b00405325147a1mr3358192wmg.40.1695979010317; Fri, 29 Sep 2023 02:16:50 -0700 (PDT) Received: from omen15.home ([89.131.29.87]) by smtp.gmail.com with ESMTPSA id k15-20020a7bc40f000000b004013797efb6sm1020933wmi.9.2023.09.29.02.16.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 02:16:50 -0700 (PDT) Date: Fri, 29 Sep 2023 11:16:18 +0200 Message-Id: <20230929091627.7820-14-jean@foundationdevices.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230929091627.7820-1-jean@foundationdevices.com> References: <20230929091627.7820-1-jean@foundationdevices.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Jean-Pierre De Jesus DIAZ X-ACL-Warn: , Jean-Pierre De Jesus DIAZ via Guix-patches X-Patchwork-Original-From: Jean-Pierre De Jesus DIAZ via Guix-patches via From: Jean-Pierre De Jesus DIAZ Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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"))) ;; 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))) ((#:phases phases) #~(cross-gcc-build-phases #$target #$phases))))))