public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gcc-patches:master commit in: 14.1.0/gentoo/
Date: Fri, 23 Aug 2024 13:51:32 +0000 (UTC)	[thread overview]
Message-ID: <1724421080.8fbfe5c9a70d8e3cc3d77dbc0a24245b861d2330.sam@gentoo> (raw)

commit:     8fbfe5c9a70d8e3cc3d77dbc0a24245b861d2330
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  5 07:57:59 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 23 13:51:20 2024 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=8fbfe5c9

14.1.0: add 09_all_esysroot.patch

Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
Closes: https://github.com/gentoo/gcc-patches/pull/3
Signed-off-by: Sam James <sam <AT> gentoo.org>

 14.1.0/gentoo/09_all_esysroot.patch | 67 +++++++++++++++++++++++++++++++++++++
 14.1.0/gentoo/README.history        |  4 +++
 2 files changed, 71 insertions(+)

diff --git a/14.1.0/gentoo/09_all_esysroot.patch b/14.1.0/gentoo/09_all_esysroot.patch
new file mode 100644
index 0000000..8dcfd22
--- /dev/null
+++ b/14.1.0/gentoo/09_all_esysroot.patch
@@ -0,0 +1,67 @@
+From a2e98f3928a4bef1f9a027f8af22b019beff9600 Mon Sep 17 00:00:00 2001
+From: James Le Cuirot <chewi@gentoo.org>
+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 <chewi@gentoo.org>
+---
+ 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 f82f7d281..2f03b080d 100644
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -19027,6 +19027,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
+@@ -37409,6 +37413,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 728332b81..06d8c469b 100644
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -5501,6 +5501,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/14.1.0/gentoo/README.history b/14.1.0/gentoo/README.history
index 6f599c7..8c037d0 100644
--- a/14.1.0/gentoo/README.history
+++ b/14.1.0/gentoo/README.history
@@ -1,3 +1,7 @@
+5   ????
+
+	+ 09_all_esysroot.patch
+
 4	21 July 2024
 
 	- 76_all_ppc_PR97367-power7-cell-altivec.patch


             reply	other threads:[~2024-08-23 13:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-23 13:51 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-08-26  6:24 [gentoo-commits] proj/gcc-patches:master commit in: 14.1.0/gentoo/ Sam James
2024-07-21  0:35 Sam James
2024-06-27  8:44 Sam James
2024-06-10  2:08 Sam James
2024-06-08 17:01 Sam James
2024-06-08 17:01 Sam James
2024-05-07  9:57 Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1724421080.8fbfe5c9a70d8e3cc3d77dbc0a24245b861d2330.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox