From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id F38YLeTQZWUzhwAAG6o9tA:P1 (envelope-from ) for ; Tue, 28 Nov 2023 12:37:08 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id F38YLeTQZWUzhwAAG6o9tA (envelope-from ) for ; Tue, 28 Nov 2023 12:37:08 +0100 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 5D1DA601AA for ; Tue, 28 Nov 2023 12:37:08 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=foundationdevices.com header.s=google header.b=Jj+ciL2z; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1701171428; a=rsa-sha256; cv=none; b=UXhHDmDoApmGKhO4xsqAS8iAy3MQvzVk0Z1K4XLjy8zEPyVieACRD//RXW3wLtWjFvcc64 Lb1ky4EyEMw/hiP7eKZxNU92R51qTX54MHshWchKWu2v40o9S0U+WgE5S32DDSKQ6jCgYT sjc6PMzkOGdlpUmo5uOXYzVYlUTMSC9U1rttW2ePuWOfJKQXiy8vzFGbQ507sTz6tNVt91 spZWy45zJxs7KJN75hELViPpsNZ0NH2FDFBM94jv0GvzAfm+pX8e7cAAt/7iFeDfQ8iqXw M2LiUcuk5uyKz6znrOaGMJA9D95JHHF5E3FgU295EWM0E8YQHxwtmOPXQegPpg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=foundationdevices.com header.s=google header.b=Jj+ciL2z; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1701171428; 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=SDcAjDE+JRIcWSFKW2WQRLdBfQCIGmenM+35bV5+iUU=; b=o2KLYOFCGujFIq9XcgRxpiqY02MqmFtPz2Ufln0D4B3zj14mR6ieh5/X3QUq0J3Rnu95Hz mo6vMfrxUZMtAfd7fadUTwChnE960Ym1OpbtWSCGKBxCO7l/Nvixt/IGzPuiBNWUb/AMeZ 8AtEu/lb58pke/8VTx1nY0/85M0D8xHmPaHSTXx4+qxnUXVsJ9OAKqXC/2x2p0S5gPkqtx dPT1g/MF+VXVO6FzOfAEggu/SNZ6HEkqHl6nBrd7zrN33HHUSKs4ufAd6g9aF+PsUHqoJs mz1PizpgYQz4hmvAboapA6jj0RZ8yL020pZzCI2LiLuTaHZOGqVjfg2qjmwQpg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r7wOi-0006wk-Tv; Tue, 28 Nov 2023 06:37:00 -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 1r7wOg-0006uM-4A for guix-patches@gnu.org; Tue, 28 Nov 2023 06:36:58 -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 1r7wOf-0008BY-Rf for guix-patches@gnu.org; Tue, 28 Nov 2023 06:36:57 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r7wOl-0003O6-M9 for guix-patches@gnu.org; Tue, 28 Nov 2023 06:37:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#66263] [PATCH v1 11/22] gnu: cross-toolchain: Add set-cross-path for AVR. 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 , Jean-Pierre De Jesus DIAZ Received: via spool by 66263-submit@debbugs.gnu.org id=B66263.170117139012833 (code B ref 66263); Tue, 28 Nov 2023 11:37:03 +0000 Received: (at 66263) by debbugs.gnu.org; 28 Nov 2023 11:36:30 +0000 Received: from localhost ([127.0.0.1]:45624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7wOD-0003Ko-HZ for submit@debbugs.gnu.org; Tue, 28 Nov 2023 06:36:29 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:57785) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7wO1-0003JG-2F for 66263@debbugs.gnu.org; Tue, 28 Nov 2023 06:36:17 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40b472f98b1so14155685e9.3 for <66263@debbugs.gnu.org>; Tue, 28 Nov 2023 03:36:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundationdevices.com; s=google; t=1701171364; x=1701776164; 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=SDcAjDE+JRIcWSFKW2WQRLdBfQCIGmenM+35bV5+iUU=; b=Jj+ciL2zgz/g8s9lrfRudUdVCxaiNmdYB6x5V6p0VWtjv0I3a1AhHaC4+qWoLoCMaJ SxX1k3dLBDAFwUyncpY42YBUaGyxDCLewtaYId/gloA4/31TJrf0dE6l09sKamvikrs2 qwNOmfiY1xp4B/GcDITQyhBZlWC5FbgL7FTsmsFT927+D+tGf+XC0Zkr0vvJ/yy3IsSm bIJ6fwLZz+Cii2krn33II/B6F7vt1VE5xUqRx5B68JpgdWC4OVj2QGWVD6vPRx+Q56VA edWXs+WXStsAQ8rWNeiZlGoKBZxR5D5oIZ1HSDXFrXqHMbk40xVDo4TMdV7pOvQdSuN3 zDTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701171364; x=1701776164; 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=SDcAjDE+JRIcWSFKW2WQRLdBfQCIGmenM+35bV5+iUU=; b=cX2qcPI0SytzDPVCwoZqRdHzLVa0bKbAT5oXJNl+jOOB3/nZpy9SLpTIh2saEnsnqu d+OmX37G4Dw7OETDQqkknZcrcItTJ1QXIZxS47l8O7XK/giGSulapkxrG8tC5ZDU2Ky3 FKRyfTXYs6bj6wcTr/wXgxx5gHzbnIV1QsxekslvQlQg9gTWwFxMTHLyp4h3qDrjCFlf Sf2BYG1SaNfao39a+FTPNZ175KDcNOsasZAII6qMc4m0vOv41/hoSNOpodhgCdYDCOqZ MVsd6SGfydaP3E0Nb5UkUtz27WvatOmlcRNj0fFxui1yEvt29ALL0lr2mxOnG/lapUlj 2Wfg== X-Gm-Message-State: AOJu0YyKFK0O4mB0DwX9k9fSQgRGzGLP2tFqTGwKhMeo/c1yz6qBVoaQ vAxS5ZWJX+y9o7cM1NZW9OIohCi3ee0Ph641FKw= X-Google-Smtp-Source: AGHT+IH47aNWYwt5PRGsN9xmB0L7fg40tQI9eo2swmWDthbegwykWNyl6VZP9EIvNWgRTGCKH2QxoQ== X-Received: by 2002:a05:600c:5118:b0:3f6:9634:c8d6 with SMTP id o24-20020a05600c511800b003f69634c8d6mr10900305wms.18.1701171364023; Tue, 28 Nov 2023 03:36:04 -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.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 03:36:03 -0800 (PST) Date: Tue, 28 Nov 2023 12:34:54 +0100 Message-ID: <20231128113510.11214-11-jean@foundationdevices.com> X-Mailer: git-send-email 2.41.0 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-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -6.13 X-Spam-Score: -6.13 X-Migadu-Queue-Id: 5D1DA601AA X-TUID: 24S/mDaJ7xcC * gnu/build/cross-toolchain.scm (set-cross-path/avr): New procedure. * gnu/build/cross-toolchain.scm (cross-gcc-build-phases) [string-prefix? "avr"]: Return set-cross-path/avr procedure. Signed-off-by: Jean-Pierre De Jesus DIAZ Change-Id: I00bd39236ac2e31fef02164a7fffc8b56a166f0d --- gnu/build/cross-toolchain.scm | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/gnu/build/cross-toolchain.scm b/gnu/build/cross-toolchain.scm index 085b88a2c3..6f5e3b0f57 100644 --- a/gnu/build/cross-toolchain.scm +++ b/gnu/build/cross-toolchain.scm @@ -170,6 +170,31 @@ (define (unpacked-mingw-dir) (cons "LIBRARY_PATH" %gcc-include-paths)) #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 (install-strip . _) "Install a stripped GCC." ;; Unlike our 'strip' phase, this will do the right thing for @@ -188,9 +213,11 @@ (define* (cross-gcc-build-phases target ;; 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 + ((string-suffix? "-mingw32" target) + (cut set-cross-path/mingw #:target target <...>)) + ((string-prefix? "avr" target) set-cross-path/avr) + (#t set-cross-path))) (add-after 'install 'make-cross-binutils-visible (cut make-cross-binutils-visible #:target target <...>)) (replace 'install install-strip))) -- 2.41.0