forked from felixonmars/archriscv-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gcc delibrately filters out default library paths when invoking linkers, causing some linkers like mold fails to find libraries. This patch is a workaround and will be proposed for upstream soon. See-also: rui314/mold#358 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104707
- Loading branch information
Showing
2 changed files
with
53 additions
and
27 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
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,22 @@ | ||
diff --git a/gcc/gcc.cc b/gcc/gcc.cc | ||
index 16bb07f2cdc..1beb23ba279 100644 | ||
--- a/gcc/gcc.cc | ||
+++ b/gcc/gcc.cc | ||
@@ -7904,17 +7904,6 @@ is_directory (const char *path1, bool linker) | ||
*cp++ = '.'; | ||
*cp = '\0'; | ||
|
||
- /* Exclude directories that the linker is known to search. */ | ||
- if (linker | ||
- && IS_DIR_SEPARATOR (path[0]) | ||
- && ((cp - path == 6 | ||
- && filename_ncmp (path + 1, "lib", 3) == 0) | ||
- || (cp - path == 10 | ||
- && filename_ncmp (path + 1, "usr", 3) == 0 | ||
- && IS_DIR_SEPARATOR (path[4]) | ||
- && filename_ncmp (path + 5, "lib", 3) == 0))) | ||
- return 0; | ||
- | ||
return (stat (path, &st) >= 0 && S_ISDIR (st.st_mode)); | ||
} | ||
|