From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C8A9015852A for ; Fri, 23 Aug 2024 13:51:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8019FE29AC; Fri, 23 Aug 2024 13:51:35 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 65873E29AC for ; Fri, 23 Aug 2024 13:51:35 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 41CC2342FA7 for ; Fri, 23 Aug 2024 13:51:34 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A52501EF2 for ; Fri, 23 Aug 2024 13:51:32 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1724421079.fec800d970afa89845479d5d6ad58140eaae5035.sam@gentoo> Subject: [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/ X-VCS-Repository: proj/gcc-patches X-VCS-Files: 15.0.0/gentoo/09_all_esysroot.patch 15.0.0/gentoo/README.history X-VCS-Directories: 15.0.0/gentoo/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: fec800d970afa89845479d5d6ad58140eaae5035 X-VCS-Branch: master Date: Fri, 23 Aug 2024 13:51:32 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 1528a298-2df3-4551-982a-e5e10b81c55a X-Archives-Hash: b9929c6e13a4c0908bdf896a780d781c commit: fec800d970afa89845479d5d6ad58140eaae5035 Author: James Le Cuirot gentoo org> AuthorDate: Mon Aug 5 07:57:11 2024 +0000 Commit: Sam James gentoo org> CommitDate: Fri Aug 23 13:51:19 2024 +0000 URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=fec800d9 15.0.0: add 09_all_esysroot.patch Signed-off-by: James Le Cuirot gentoo.org> Signed-off-by: Sam James gentoo.org> 15.0.0/gentoo/09_all_esysroot.patch | 67 +++++++++++++++++++++++++++++++++++++ 15.0.0/gentoo/README.history | 1 + 2 files changed, 68 insertions(+) diff --git a/15.0.0/gentoo/09_all_esysroot.patch b/15.0.0/gentoo/09_all_esysroot.patch new file mode 100644 index 0000000..80e0561 --- /dev/null +++ b/15.0.0/gentoo/09_all_esysroot.patch @@ -0,0 +1,67 @@ +From 71e048084d32811f6e17e73b6ebadfe550ef1193 Mon Sep 17 00:00:00 2001 +From: James Le Cuirot +Date: Sun, 4 Aug 2024 17:02:06 +0100 +Subject: [PATCH] Allow setting target sysroot with ESYSROOT env var for + cross-compilers + +The variable is ignored for native compilers. The --sysroot command line +option takes precedence. + +Signed-off-by: James Le Cuirot +--- + gcc/doc/invoke.texi | 10 ++++++++++ + gcc/gcc.cc | 10 ++++++++++ + 2 files changed, 20 insertions(+) + +diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi +index 0fe99ca8e..434cf30e2 100644 +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -19230,6 +19230,10 @@ for this option. If your linker does not support this option, the + header file aspect of @option{--sysroot} still works, but the + library aspect does not. + ++On Gentoo Linux, this option can also be set for cross-compilers using the ++@env{ESYSROOT} environmnent variable. The variable is ignored for native ++compilers. The command line option takes precedence. ++ + @opindex no-sysroot-suffix + @item --no-sysroot-suffix + For some targets, a suffix is added to the root directory specified +@@ -37657,6 +37661,12 @@ using GCC also uses these directories when searching for ordinary + libraries for the @option{-l} option (but directories specified with + @option{-L} come first). + ++@vindex ESYSROOT ++@item ESYSROOT ++On Gentoo Linux, this variable sets the logical root directory for headers and ++libraries for cross-compilers. It is ignored for native compilers. The ++@option{--sysroot} option takes precedence. ++ + @vindex LANG + @cindex locale definition + @item LANG +diff --git a/gcc/gcc.cc b/gcc/gcc.cc +index abdb40bfe..956363ddb 100644 +--- a/gcc/gcc.cc ++++ b/gcc/gcc.cc +@@ -5516,6 +5516,16 @@ process_command (unsigned int decoded_options_count, + "BINUTILS", PREFIX_PRIORITY_LAST, 0, 1); + free (tooldir_prefix); + ++ if (*cross_compile == '1' && !target_system_root_changed) ++ { ++ const char *esysroot = env.get("ESYSROOT"); ++ if (esysroot && esysroot[0] != '\0' && strcmp(esysroot, "/") != 0 && (!target_system_root || strcmp(esysroot, target_system_root) != 0)) ++ { ++ target_system_root = esysroot; ++ target_system_root_changed = 1; ++ } ++ } ++ + #if defined(TARGET_SYSTEM_ROOT_RELOCATABLE) && !defined(VMS) + /* If the normal TARGET_SYSTEM_ROOT is inside of $exec_prefix, + then consider it to relocate with the rest of the GCC installation +-- +2.45.2 + diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history index 82e55aa..76096c4 100644 --- a/15.0.0/gentoo/README.history +++ b/15.0.0/gentoo/README.history @@ -2,6 +2,7 @@ - 32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch - 33_all_phiopt-Reject-non-gimple-val-inside-factor_out_condi.patch + + 09_all_esysroot.patch 10 19 August 2024