llvm-project
20859e26 - [Clang][Driver] Move -T option after -L in BareMetal driver (#183055)

Commit
67 days ago
[Clang][Driver] Move -T option after -L in BareMetal driver (#183055) `-L` option affects linker script search paths when `-T` is specified. For lld the order of `-L` and `-T` flags does not matter and paths provided with the `-L` option will be used. E.g. for the command `ld.lld -T script -L dir`, `ld.lld` uses `dir` to find `script`. However, for GNU ld the order matters and only the paths provided before the `-T` option will be used. This change reorders the flags in BareMetal driver to ensure compatibility with both GNU ld and lld. It restores the behavior clang-20 and earlier drivers have for RISC-V. (before merging RISCVToolchain.cpp to Baremetal.cpp). GCC (both Linux and baremetal) and Clang Linux drivers do the same reordering.
Author
Parents
Loading