From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id OJv6HZKWFmUbeAAAG6o9tA:P1 (envelope-from ) for ; Fri, 29 Sep 2023 11:19:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id OJv6HZKWFmUbeAAAG6o9tA (envelope-from ) for ; Fri, 29 Sep 2023 11:19:14 +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 5239C5C2D6 for ; Fri, 29 Sep 2023 11:19:14 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=foundationdevices.com header.s=google header.b=T2xqI+cK; 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=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1695979154; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=v8cpt2jTu38Jk6y5Yzrz2fJnsovdFNlpDLG20zKhlEM=; b=Jmc3fGpyUHeeH8hRWB7wL9mbapv+gxTqy+rJL/t512FvCHwmkMpahdyrj77O8nD/XJcDoq sSpCkNlAPZlqa2YP7PBtv5A61MC24vp0Tzg+/xoYA0IEPAOfIQW7ApKMnTG2LLJYi/qnq1 gYfecuD4X/eOTYg9frpN2aKqO2R85pHBGdmKYaTcmV8e6dUK1kCbfUkojUVnl11U2un1Kg U5fkRrpgIkqor5yL0oKThQK+A+s3JDTlnVb4NPIBP79y/yGNdN94zy+S47F1ufZYRnU1Ih hUbsJp0uav4ptEAXhghu4uKHY2xTcmm8RlKN0XSNw4xfscQR/lr15V7o6cYMjg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1695979154; a=rsa-sha256; cv=none; b=QaaCb8IeIZP2YavVS0oVmAVItLiHS0l0dfI/y4K0ipP0KPigJOdO0kL24DdG9OVAIV3vDV KF/ZC9m2AcGiYGyYyE4jGb+Rd+ghpEEnuDkiLFxj8THidNsNMJrF3zTT0r6rP0Z4fLIhag 8fBF6sQzfxFkwfuP36JRDpMGse71gN9Kgkx98x4JmkMsEXoNRMDpZA1C4olkWruf6STbrc 1pdypHe0ohQNL0a66FQrGLUF/WJGH82IXgdZAfy+KNag4WerHvswAGiXOLWLlVinqAphEQ IrLUxhVRUyPqWjB6VRnXyl1J59HVuLLKqlJkqU6yIKqh9m0KgvZDfHXlp89qQg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=foundationdevices.com header.s=google header.b=T2xqI+cK; 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=pass (policy=none) header.from=gnu.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9ds-0005xX-6Q; Fri, 29 Sep 2023 05:18:36 -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 1qm9dH-0005Ui-VE 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 1qm9d8-0003uT-U1 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 1qm9dN-0004m9-Bq; Fri, 29 Sep 2023 05:18:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66263] [PATCH 07/23] gnu: Add AVR phases to cross-gcc-build-phases. 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:05 +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.169597904918124 (code B ref 66263); Fri, 29 Sep 2023 09:18:05 +0000 Received: (at 66263) by debbugs.gnu.org; 29 Sep 2023 09:17:29 +0000 Received: from localhost ([127.0.0.1]:55199 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qm9cm-0004i8-KC for submit@debbugs.gnu.org; Fri, 29 Sep 2023 05:17:28 -0400 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]:55575) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qm9cN-0004dy-7f for 66263@debbugs.gnu.org; Fri, 29 Sep 2023 05:17:11 -0400 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2c00e1d4c08so224297401fa.3 for <66263@debbugs.gnu.org>; Fri, 29 Sep 2023 02:16:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundationdevices.com; s=google; t=1695979002; x=1696583802; 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=v8cpt2jTu38Jk6y5Yzrz2fJnsovdFNlpDLG20zKhlEM=; b=T2xqI+cKggZ1I6slqxY/StL7p5UX9l0oYxorG8TI2/LbmcvCotZzcJuxU7yk72h38L yJRqc2nZINcCpNZlLWg4b6m65EWmasuhoIvIa7a2U8/AyL4g5pQWVnttXvpOkfDrp/vH 6ZlSbf2wQfc9P8B0ygI0QD3NP91KE09UXYSGr3i2a9EhKZ6Zei7LljQoU3+mjWQ1iDtq vE29FACP4v+FNSWG7iCUehFLoY/Xs2hjXdOJe8a03z7M7aNDRKtS3U6ij6Dxri825HRF LMeNr9vFDW98DTkUOUizNlDi8JOJaNGk6m8PTXSWTqQgOr3FnYi7dNa3EywFgtHBgvLq yvgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695979002; x=1696583802; 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=v8cpt2jTu38Jk6y5Yzrz2fJnsovdFNlpDLG20zKhlEM=; b=SsIYXvR/BvjnYAwHXGEgcSzdxr7ysRWyKNhAVacYyyGqzVSYmM9U9H1VHP7tdyxccP vwJH79uy6XOI49XEAY2vdLMF4T9FYLufmmiCP0r9jc0nBEehGZQHGmwRyDIsH3uiBMYM 9sK9d1eNZ6JbVMclTs4eXwIshQlv0J0lDZ20mMH0pyZdWpiwGIf511fYAm362fg+uojr Gmv6vWpEJz715kVBAP5uBSkPrKoWG5ZphsyjqLR5bia5Q+ssnD72PttRUrfqSFuBkAnt kxNt1uFbMCovEC/Z1yq9XCH/G4E5iOXSWDxFUEYPxk3Bc3GClJT4d2n9MY93unjYrhsQ hueA== X-Gm-Message-State: AOJu0YxqeJfk3ecCtlNCWg9zAU2/91EIAfo3bp8vTWcRPIYJty6XWcRx 6s7d9O0lpQTGhEKsNCcd1Hwq2ZtJRVx3ijbZ9J4FsQ== X-Google-Smtp-Source: AGHT+IEUlgd6IIt9k0Xf0IV0NpVgOxI2UYp5EBhkjcJYgy2OR+kJq28yqKdqhfRRrk4xFVqp4sNi4g== X-Received: by 2002:a05:6512:10cd:b0:503:5d8:da33 with SMTP id k13-20020a05651210cd00b0050305d8da33mr3496990lfg.20.1695979002409; Fri, 29 Sep 2023 02:16:42 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 02:16:42 -0700 (PDT) Date: Fri, 29 Sep 2023 11:16:11 +0200 Message-Id: <20230929091627.7820-7-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 Content-Transfer-Encoding: 8bit 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 From: Jean-Pierre De Jesus DIAZ via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -4.76 X-Migadu-Spam-Score: -4.76 X-Migadu-Scanner: mx1.migadu.com X-Migadu-Queue-Id: 5239C5C2D6 X-TUID: pXxaAlkZWPZo * gnu/build/cross-toolchain.scm (set-cross-path/avr): New procedure. * gnu/build/cross-toolchain.scm (cross-gcc-build-phases): Add case for AVR target. --- gnu/build/cross-toolchain.scm | 41 +++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/gnu/build/cross-toolchain.scm b/gnu/build/cross-toolchain.scm index 9746be3e50..8de62be593 100644 --- a/gnu/build/cross-toolchain.scm +++ b/gnu/build/cross-toolchain.scm @@ -97,6 +97,31 @@ (define (cross? x) ;; We're building the sans-libc cross-compiler, so nothing to do. #t))) +(define* (set-cross-path/avr #:key inputs #:allow-other-keys) + (match (assoc-ref inputs "libc") + ((? string? libc) + (define (cross? x) + ;; Return #t if X is a cross-libc. + (string-prefix? libc x)) + + (let ((cpath (string-append libc "/avr/include"))) + (for-each (cut setenv <> cpath) + %gcc-cross-include-paths)) + + (setenv "CROSS_LIBRARY_PATH" + (string-append libc "/avr/lib")) + + (for-each (lambda (var) + (and=> (getenv var) + (lambda (value) + (let* ((path (search-path-as-string->list value)) + (native-path (list->search-path-as-string + (remove cross? path) ":"))) + (setenv var native-path))))) + (cons "LIBRARY_PATH" %gcc-include-paths))) + ;; AVR sans-libc cross-compiler. + (else #t))) + (define* (set-cross-path/mingw #:key inputs target #:allow-other-keys) "Add the cross MinGW headers to CROSS_C_*_INCLUDE_PATH, and remove them from C_*INCLUDE_PATH." @@ -174,13 +199,15 @@ (define* (cross-gcc-build-phases target a target triplet." (modify-phases phases (add-before 'configure 'set-cross-path - ;; This mingw32 target checking logic should match that of target-mingw? - ;; in (guix utils), but (guix utils) is too large too copy over to the - ;; build side entirely and for now we have no way to select variables to - ;; copy over. See (gnu packages cross-base) for more details. - (if (string-suffix? "-mingw32" target) - (cut set-cross-path/mingw #:target target <...>) - set-cross-path)) + (cond + ;; This mingw32 target checking logic should match that of target-mingw? + ;; in (guix utils), but (guix utils) is too large too copy over to the + ;; build side entirely and for now we have no way to select variables to + ;; copy over. See (gnu packages cross-base) for more details. + ((string-suffix? "-mingw32" target) + (cut set-cross-path/mingw #:target target <...>)) + ((string-prefix? "avr" target) set-cross-path/avr) + (else set-cross-path))) (add-after 'install 'make-cross-binutils-visible (cut make-cross-binutils-visible #:target target <...>)) (replace 'install install-strip))) -- 2.34.1