[all-commits] [llvm/llvm-project] 6b00b3: [BareMetal] Ensure that sysroot always comes after...
Petr Hosek via All-commits
all-commits at lists.llvm.org
Fri May 7 13:22:03 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6b00b34b8a05896f79b18a1963811299b83d5b21
https://github.com/llvm/llvm-project/commit/6b00b34b8a05896f79b18a1963811299b83d5b21
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-sysroot.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