From 56700e937903969a4a95f68c59e38e35daaaa1ea Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sat, 20 Mar 2021 21:32:55 -0700 Subject: [PATCH] [Driver] Gnu.cpp: drop an unneeded special rule related to sysroot Seem unnecessary to diverge from GCC here. Beside, lib/../$OSLibDir can be considered closer to the GCC installation then the system root. The comment should not apply. --- clang/lib/Driver/ToolChains/Gnu.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp index bd14bbb..39be774 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp @@ -2834,17 +2834,7 @@ void Generic_GCC::AddMultilibPaths(const Driver &D, SelectedMultilib.osSuffix(), Paths); - // If the GCC installation we found is inside of the sysroot, we want to - // prefer libraries installed in the parent prefix of the GCC installation. - // It is important to *not* use these paths when the GCC installation is - // outside of the system root as that can pick up unintended libraries. - // This usually happens when there is an external cross compiler on the - // host system, and a more minimal sysroot available that is the target of - // the cross. Note that GCC does include some of these directories in some - // configurations but this seems somewhere between questionable and simply - // a bug. - if (StringRef(LibPath).startswith(SysRoot)) - addPathIfExists(D, LibPath + "/../" + OSLibDir, Paths); + addPathIfExists(D, LibPath + "/../" + OSLibDir, Paths); } } -- 2.7.4