public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: sunilkumar.dora@windriver.com
To: openembedded-core@lists.openembedded.org
Cc: Randy.MacLeod@windriver.com, Sundeep.Kokkonda@windriver.com
Subject: [PATCH] gcc: poison-system-directories patch updated for missing paths
Date: Thu, 16 Jan 2025 01:09:44 -0800	[thread overview]
Message-ID: <20250116090944.1194383-1-sunilkumar.dora@windriver.com> (raw)

From: Sunil Dora <sunilkumar.dora@windriver.com>

Modified logic in gcc/incpath.cc to ensure that non-existing host system paths are
not deleted during cross-compilation. If the build system attempts to search a host
path, gcc will now issue a warning instead of silently ignoring it.

Fixes [YOCTO #15672]
https://bugzilla.yoctoproject.org/show_bug.cgi?id=15672

Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
---
 .../0002-gcc-poison-system-directories.patch  | 22 +++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc/0002-gcc-poison-system-directories.patch b/meta/recipes-devtools/gcc/gcc/0002-gcc-poison-system-directories.patch
index ca75d08f59..367c9e3821 100644
--- a/meta/recipes-devtools/gcc/gcc/0002-gcc-poison-system-directories.patch
+++ b/meta/recipes-devtools/gcc/gcc/0002-gcc-poison-system-directories.patch
@@ -14,6 +14,7 @@ wants this to be a failure, they can add "-Werror=poison-system-directories".
 Upstream-Status: Inappropriate [OE configuration]
 Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: sunil dora <sunilkumar.dora@windriver.com>
 ---
  gcc/common.opt      |  4 ++++
  gcc/config.in       | 10 ++++++++++
@@ -21,8 +22,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
  gcc/configure.ac    | 16 ++++++++++++++++
  gcc/doc/invoke.texi |  9 +++++++++
  gcc/gcc.cc          |  9 +++++++--
- gcc/incpath.cc      | 21 +++++++++++++++++++++
- 7 files changed, 86 insertions(+), 2 deletions(-)
+ gcc/incpath.cc      | 25 +++++++++++++++++++++++++
+ 7 files changed, 90 insertions(+), 2 deletions(-)
 
 diff --git a/gcc/common.opt b/gcc/common.opt
 index ad348844775..df3992b420d 100644
@@ -186,7 +187,7 @@ index 728332b8153..343e4915097 100644
  /* Pass -d* flags, possibly modifying -dumpdir, -dumpbase et al.
  
 diff --git a/gcc/incpath.cc b/gcc/incpath.cc
-index 64cdd2f4a1b..e572d98ab17 100644
+index 64cdd2f4a..89f42900d 100644
 --- a/gcc/incpath.cc
 +++ b/gcc/incpath.cc
 @@ -26,6 +26,7 @@
@@ -197,7 +198,18 @@ index 64cdd2f4a1b..e572d98ab17 100644
  
  /* Microsoft Windows does not natively support inodes.
     VMS has non-numeric inodes.  */
-@@ -399,6 +400,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
+@@ -273,6 +274,10 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head,
+			     cur->name, xstrerror (errno));
+	      reason = REASON_NOENT;
+	    }
++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
++	  pcur = &cur->next;
++	  continue;
++#endif
+	}
+       else if (!S_ISDIR (st.st_mode))
+	cpp_error_with_line (pfile, CPP_DL_WARNING, 0, 0,
+@@ -399,6 +404,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
  	}
        fprintf (stderr, _("End of search list.\n"));
      }
@@ -224,3 +236,5 @@ index 64cdd2f4a1b..e572d98ab17 100644
  }
  
  /* Use given -I paths for #include "..." but not #include <...>, and
+--
+2.34.1
-- 
2.43.0



                 reply	other threads:[~2025-01-16  9:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20250116090944.1194383-1-sunilkumar.dora@windriver.com \
    --to=sunilkumar.dora@windriver.com \
    --cc=Randy.MacLeod@windriver.com \
    --cc=Sundeep.Kokkonda@windriver.com \
    --cc=openembedded-core@lists.openembedded.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