From patchwork Tue Nov 28 11:34:52 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: 56904 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 4455427BBEA; Tue, 28 Nov 2023 11:37:58 +0000 (GMT) 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 4B07927BBE2 for ; Tue, 28 Nov 2023 11:37:57 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r7wOg-0006uc-Dt; Tue, 28 Nov 2023 06:36:58 -0500 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 1r7wOe-0006tp-OL for guix-patches@gnu.org; Tue, 28 Nov 2023 06:36:56 -0500 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 1r7wOe-0008Ai-Fm for guix-patches@gnu.org; Tue, 28 Nov 2023 06:36:56 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r7wOl-0003Nz-AE for guix-patches@gnu.org; Tue, 28 Nov 2023 06:37:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#66263] [PATCH v1 09/22] gnu: cross-libc: Add AVR Libc support. References: <20230929091333.7623-1-jean@foundationdevices.com> In-Reply-To: <20230929091333.7623-1-jean@foundationdevices.com> Resent-From: Jean-Pierre De Jesus DIAZ Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 28 Nov 2023 11:37:03 +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: moreinfo patch To: 66263@debbugs.gnu.org Cc: Jean-Pierre De Jesus DIAZ Received: via spool by 66263-submit@debbugs.gnu.org id=B66263.170117138912825 (code B ref 66263); Tue, 28 Nov 2023 11:37:03 +0000 Received: (at 66263) by debbugs.gnu.org; 28 Nov 2023 11:36:29 +0000 Received: from localhost ([127.0.0.1]:45622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7wOC-0003KV-KI for submit@debbugs.gnu.org; Tue, 28 Nov 2023 06:36:29 -0500 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]:45244) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7wNx-0003Ir-Pd for 66263@debbugs.gnu.org; Tue, 28 Nov 2023 06:36:14 -0500 Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2c9b5c12898so5437771fa.2 for <66263@debbugs.gnu.org>; Tue, 28 Nov 2023 03:36:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundationdevices.com; s=google; t=1701171360; x=1701776160; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Qzsgh1m64MMSYXEL7UcAU8mX8DT/3+2cA+G7YFVGhGo=; b=ASNfJp10unFL+ZvXvvXoldmbwQbmNIfaHZwDk0tG/86AzL7z+B46KW/0eQbcSkHJ3P b5u6tGnT8PY9u8C6W4/czjoeo9SVEEAP3evDrbh+tzx6lHrAmmTqfFtppV8pgjbWJ67+ ZFL2R6+Cp2XtQhVkFMTsmEjqqp+tLhj/c4qZnT62neRny9D1o6maXqlKRBci9n7noGhL SvEZw8RchDzwVPjRQ+o1Ivso8du1vrD9NC1P6hqvkk1qlWgLLWx8sm9CPUpyutBkmSt3 aKA/FMPBJURwEdlQbvoXch9/6S1U49qvficVMKsRDuqfc/LlNptOvLB91Ld0c1dLz0UT dQKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701171360; x=1701776160; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Qzsgh1m64MMSYXEL7UcAU8mX8DT/3+2cA+G7YFVGhGo=; b=N0nImwi5F5pRTtc/ReH74qwBVYO9Plnv3KjZPJGBX1CptgPKquFo/SpwSga/1cue2q XUXqelGgZAWD0dQtDJt60+oSEbT9gWPNstKv8wSNWrh+mlltKvbiqRzwy8WosYxoUnpY iQdFH7PlCD5lhzUvyzW14Ni5NNf/oGI8YNR57In7hR9vnthtZjmwmGzxCm+VW2LfTwyu EFMuf9Yf61nKMeqGdHBJA8Iqq0NXlFVQa0Kr9KFama51eEtfTibPshsA7ozkHwsojtOA O/BSeXPAEl79q69ZkvipbjviElrc9OhUCIJkztaaTwVRO+9Lk7P5oZDgH4yYjbGwe8uF FDTg== X-Gm-Message-State: AOJu0YwfHlrqdS1CKh8Fju38LPuNncuZp++bcXIMGrqTZnZ/mVL1bFpS +Et4BE2FoTaNBu1EeBKBO3FWnfCgMSxDqwjZ/M0= X-Google-Smtp-Source: AGHT+IHfLMlhdTV5lDlzAliuj3JZM70VvSu/fsXDWTyegxGslBlsgZnP/HR9SA/gZj6JKnmsnYRQVg== X-Received: by 2002:a2e:1416:0:b0:2c9:98fd:9981 with SMTP id u22-20020a2e1416000000b002c998fd9981mr6070168ljd.42.1701171360761; Tue, 28 Nov 2023 03:36:00 -0800 (PST) Received: from jeandudey.home ([89.131.29.87]) by smtp.gmail.com with ESMTPSA id f7-20020a05600c154700b0040b4cb14d40sm1848769wmg.19.2023.11.28.03.36.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 03:36:00 -0800 (PST) Date: Tue, 28 Nov 2023 12:34:52 +0100 Message-ID: <20231128113510.11214-9-jean@foundationdevices.com> X-Mailer: git-send-email 2.41.0 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/avr.scm (make-avr-libc/implementation) : Add avr target parameter and disable implicit cross inputs. : Rename avr-gcc and avr-binutils to cross-gcc and cross-binutils to keep consistency with gnu-build-system. * gnu/packages/cross-base.scm (cross-libc) [target-avr?]: Return AVR Libc package from `make-avr-libc`. Change-Id: I6b087946d1287a82fac61c48c513e7f2d2184794 --- gnu/packages/avr.scm | 21 ++++++++++++++------- gnu/packages/cross-base.scm | 4 ++++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/gnu/packages/avr.scm b/gnu/packages/avr.scm index ac09b799f3..fc87e4ea13 100644 --- a/gnu/packages/avr.scm +++ b/gnu/packages/avr.scm @@ -40,7 +40,8 @@ (define-module (gnu packages avr) #:use-module (gnu packages gcc) #:use-module (gnu packages llvm) #:use-module (gnu packages vim) - #:export (make-avr-toolchain)) + #:export (make-avr-libc + make-avr-toolchain)) ;;; Commentary: ;;; @@ -108,7 +109,10 @@ (define* (make-avr-gcc/implementation #:key (xgcc gcc)) (define make-avr-gcc (memoize make-avr-gcc/implementation)) -(define* (make-avr-libc/implementation #:key (xgcc gcc)) +(define* (make-avr-libc/implementation #:key + (xbinutils (cross-binutils "avr")) + (xgcc (cross-gcc "avr" + #:xbinutils xbinutils))) (package (name "avr-libc") (version "2.0.0") @@ -121,10 +125,13 @@ (define* (make-avr-libc/implementation #:key (xgcc gcc)) "15svr2fx8j6prql2il2fc0ppwlv50rpmyckaxx38d3gxxv97zpdj")))) (build-system gnu-build-system) (arguments - '(#:out-of-source? #t - #:configure-flags '("--host=avr"))) - (native-inputs `(("avr-binutils" ,(make-avr-binutils)) - ("avr-gcc" ,(make-avr-gcc #:xgcc xgcc)))) + '(#:target "avr" + #:out-of-source? #t + ;; Avoid including itself as this package is a target input and cannot + ;; use the normal cross compilation inputs. + #:implicit-cross-inputs? #f)) + (native-inputs `(("cross-binutils" ,xbinutils) + ("cross-gcc" ,xgcc))) (home-page "https://www.nongnu.org/avr-libc/") (synopsis "AVR C Library") (description @@ -138,7 +145,7 @@ (define make-avr-libc (define* (make-avr-toolchain/implementation #:key (xgcc gcc)) (let ((avr-binutils (make-avr-binutils)) - (avr-libc (make-avr-libc #:xgcc xgcc)) + (avr-libc (make-avr-libc #:xgcc (cross-gcc "avr" #:xgcc xgcc))) (avr-gcc (make-avr-gcc #:xgcc xgcc))) ;; avr-libc checks the compiler version and passes "--enable-device-lib" ;; for avr-gcc > 5.1.0. It wouldn't install the library for atmega32u4 diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index fe33770c2a..d4a0de6f90 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -28,6 +28,7 @@ (define-module (gnu packages cross-base) #:use-module (gnu packages) + #:use-module (gnu packages avr) #:use-module (gnu packages gcc) #:use-module (gnu packages base) #:use-module (gnu packages linux) @@ -699,6 +700,9 @@ (define* (cross-libc* target '()) ,@(package-inputs libc) ;FIXME: static-bash ,@(package-native-inputs libc))))) + ((? target-avr?) + (make-avr-libc #:xbinutils xbinutils + #:xgcc xgcc)) (else #f)))