[all-commits] [llvm/llvm-project] 167906: [BareMetal] Ensure that sysroot always comes after...
Petr Hosek via All-commits
all-commits at lists.llvm.org
Fri May 7 14:43:36 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 167906c10932f5eda97b480ee084b17746c362e7
https://github.com/llvm/llvm-project/commit/167906c10932f5eda97b480ee084b17746c362e7
Author: Petr Hosek <phosek at google.com>
Date: 2021-05-07 (Fri, 07 May 2021)
Changed paths:
M clang/lib/Driver/ToolChains/BareMetal.cpp
M clang/test/Driver/baremetal.cpp
Log Message:
-----------
[BareMetal] Ensure that sysroot always comes after library paths
This addresses an issue introduced in D91559. We would invoke the
compiler with -Lpath/to/lib --sysroot=path/to/sysroot where both
locations contain libraries with the same name, but we expect linker
to pick up the library in path/to/lib since that version is more
specialized. This was the case before D91559 where the sysroot path
would be ignored, but after that change linker would now pick up the
library from the sysroot which resulted in unexpected behavior.
The sysroot path should always come after any user provided library
paths, followed by compiler runtime paths. We want for libraries in user
provided library paths to always take precedence over sysroot libraries.
This matches the behavior of other toolchains used with other targets.
Differential Revision: https://reviews.llvm.org/D102049
More information about the All-commits
mailing list