From patchwork Tue Nov 28 11:34:51 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: 56896 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 4CE3E27BBEC; Tue, 28 Nov 2023 11:37:20 +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 4A42A27BBE2 for ; Tue, 28 Nov 2023 11:37:19 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r7wOf-0006uH-UX; Tue, 28 Nov 2023 06:36:57 -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-0006tX-B6 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-0008AR-2Y 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 1r7wOk-0003Ns-TP for guix-patches@gnu.org; Tue, 28 Nov 2023 06:37:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#66263] [PATCH v1 08/22] gnu: cross-gcc: Handle target include paths. 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: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: moreinfo patch To: 66263@debbugs.gnu.org Cc: Jean-Pierre De Jesus DIAZ Received: via spool by 66263-submit@debbugs.gnu.org id=B66263.170117138812806 (code B ref 66263); Tue, 28 Nov 2023 11:37:02 +0000 Received: (at 66263) by debbugs.gnu.org; 28 Nov 2023 11:36:28 +0000 Received: from localhost ([127.0.0.1]:45612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7wNy-0003JS-F9 for submit@debbugs.gnu.org; Tue, 28 Nov 2023 06:36:28 -0500 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]:47133) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7wNv-0003In-S2 for 66263@debbugs.gnu.org; Tue, 28 Nov 2023 06:36:12 -0500 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2c9947f488fso41463151fa.2 for <66263@debbugs.gnu.org>; Tue, 28 Nov 2023 03:36:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundationdevices.com; s=google; t=1701171359; x=1701776159; 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=qxMLjpAmAd6yM1ybGyAfpCfIuBBG5N3X9CRt6q6Ehhs=; b=NFEjpzKDNYmv5MMcDxgWwpyQdmXCweixSSqnlFxXD4lmwBnqkJWcA9ydNiMwoZj6zG g41TgR5M2pDk+Pc27AVHvfiKnPz/JSCwMBqn3zQzcwd6f3ZzVcTCFR+nf6E1pldU9CeV ESwZo+2CZRhQWYSGMvwX/AMTR62VE9Pawe6G+XtgEpDR9Du5nAlOuNFJ4VYkuGFyDfhQ bgx4QWDk8W22DcG8VJMd/PziGVA+FGXwqMeJ9tc+sdVJ5CTIWkkg1FSK+0V3neJSA4Pn zokIN4X36zT1oisec+VVjMOSgQfTGPQWshKo4hQN0QjhZZbPg0BcUGpJCO4uLjsNq8yJ 3ezA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701171359; x=1701776159; 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=qxMLjpAmAd6yM1ybGyAfpCfIuBBG5N3X9CRt6q6Ehhs=; b=jjMHISzXXy7n2b28VJNaZl6SPGY4X/kAasadZ3sc1wO2OwkvPsA8XCrMROs3z6xhQW OPf8967RkBTTNQ8l5pZ6AXnG0FudYnWGblP1ln2MuVG7/ZDYfUYnvI4ScopmaO3TdaJw 4Qfvla1rK3t9eUSN6OzeJzbsFXxKHX7R4fXmrgVaWDmgcgU+2nhftGxkbx4wviBZtjdg hDUq+aZyfrH7Duisw3Hruj+o0jVi6fZmMLM6mPLzsiwFz4bXEOcfwzU1dNUSWXVGcOZE NPZd8NWlDBqhJk4bxHVhnKIKfO5ExvqFn9h9YGvg+5dUezdaSZ5oDZkJf5esF8z5FOlN C3vw== X-Gm-Message-State: AOJu0Yw+GPoVRy6uLdJlJB2HjG+r7oJIa2RpsbzvW3yaFXOgxDOt833m v8YE1NatvYD3wl2/9fEm5KuuabVfxRXQ08gG0zE= X-Google-Smtp-Source: AGHT+IFpdyjZIygGWXKjEsA1ZJrgb4u+vOcM/OV5KGq+8ZRFQ/0TPSIFYvZHFPnJvmPnO0a26dS4gQ== X-Received: by 2002:a2e:b744:0:b0:2c9:a022:63da with SMTP id k4-20020a2eb744000000b002c9a02263damr4908136ljo.19.1701171358946; Tue, 28 Nov 2023 03:35:58 -0800 (PST) Received: from jeandudey.home ([89.131.29.87]) by smtp.gmail.com with ESMTPSA id f7-20020a05600c154700b0040b4cb14d40sm1848769wmg.19.2023.11.28.03.35.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 03:35:58 -0800 (PST) Date: Tue, 28 Nov 2023 12:34:51 +0100 Message-ID: <20231128113510.11214-8-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/cross-base.scm (cross-gcc-search-paths): New procedure. * gnu/packages/cross-base.scm (cross-gcc) : Convert to and use cross-gcc-search-paths procedure. Change-Id: Id306782eaf928d05cd005b9539087ed631506b5b --- gnu/packages/cross-base.scm | 42 +++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index dcb1c3efa8..fe33770c2a 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -249,6 +249,31 @@ (define (cross-gcc-snippet target) "-DTOOLDIR_BASE_PREFIX=\\\"../../../../\\\"")) #t)) +(define (cross-gcc-search-paths target) + "Return list of GCC search path specifications needed for TARGET." + (cons (search-path-specification + (variable "CROSS_LIBRARY_PATH") + (files `("lib" "lib64" + ,@(list (string-append target "/lib") + (string-append target "/lib64"))))) + + (map (lambda (variable) + (search-path-specification + (variable variable) + + ;; Add 'include/c++' here so that 's + ;; "#include_next " finds GCC's + ;; , not libc's. + (files (match variable + ("CROSS_CPLUS_INCLUDE_PATH" + `("include/c++" "include" + ,@(list (string-append target "/include/c++") + (string-append target "/include")))) + (_ + `("include" + ,(string-append target "/include"))))))) + %gcc-cross-include-paths))) + (define* (cross-gcc target #:key (xgcc %xgcc) @@ -341,22 +366,7 @@ (define* (cross-gcc target (inputs '()) ;; Only search target inputs, not host inputs. - (search-paths (cons (search-path-specification - (variable "CROSS_LIBRARY_PATH") - (files '("lib" "lib64"))) - (map (lambda (variable) - (search-path-specification - (variable variable) - - ;; Add 'include/c++' here so that 's - ;; "#include_next " finds GCC's - ;; , not libc's. - (files (match variable - ("CROSS_CPLUS_INCLUDE_PATH" - '("include/c++" "include")) - (_ - '("include")))))) - %gcc-cross-include-paths))) + (search-paths (cross-gcc-search-paths target)) (native-search-paths '()))) (define* (cross-kernel-headers . args)