forked from yoctoproject/poky
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gcc: Fix wrong order of gcc include paths on musl systems
musl does not use gcc private system headers, however, the path gets prepended since gcc driver passes -iprefix option to cc1 based on its installation location. This starts to prefer these headers instead of musl provided equivalent system headers which is not as per musl's design. This patch switches prepend to append for musl systems. Signed-off-by: Khem Raj <[email protected]>
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
.../recipes-devtools/gcc/gcc/0027-Append-GCC-private-include-paths-on-musl-instead-of-.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
From 636cb6e700856c3d0f8b86ab408032ceeb7e5d2a Mon Sep 17 00:00:00 2001 | ||
From: Khem Raj <[email protected]> | ||
Date: Wed, 5 Jun 2024 22:56:12 -0700 | ||
Subject: [PATCH] Append GCC private include paths on musl instead of | ||
prepending | ||
|
||
Musl does not need gcc private compiler headers, therefore use them | ||
after standard system header search paths. | ||
|
||
This fixes packages like python builds to detect the musl systems | ||
correclty, as it looks for musl specific stuff in stdarg.h system | ||
header, which is wrongly picked from gcc private headers in OE | ||
|
||
Upstream-Status: Submitted [https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115368] | ||
Signed-off-by: Khem Raj <[email protected]> | ||
--- | ||
gcc/gcc.cc | 6 +++++- | ||
1 file changed, 5 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/gcc/gcc.cc b/gcc/gcc.cc | ||
index 01968001c44..f0fcaebc3ae 100644 | ||
--- a/gcc/gcc.cc | ||
+++ b/gcc/gcc.cc | ||
@@ -6589,7 +6589,11 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part) | ||
|
||
if (gcc_exec_prefix) | ||
{ | ||
- do_spec_1 ("-iprefix", 1, NULL); | ||
+ if (OPTION_MUSL) | ||
+ do_spec_1 ("-idirafter", 1, NULL); | ||
+ else | ||
+ do_spec_1 ("-iprefix", 1, NULL); | ||
+ | ||
/* Make this a separate argument. */ | ||
do_spec_1 (" ", 0, NULL); | ||
do_spec_1 (gcc_exec_prefix, 1, NULL); |