[PATCH] D68407: [WIP][RISCV] Use compiler-rt if no GCC installation detected

Sam Elliott via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 11 04:26:21 PST 2019


lenary added a comment.

LGTM.

I looked at what `g++` and `gcc` do (my riscv64-unknown-elf toolchain):

- `gcc`: Passes `-lgcc --start-group -lc -lgloss --end-group -lgcc` to the linker
- `g++`: Passes `"-lstdc++" -lm -lgcc --start-group -lc -lgloss --end-group -lgcc` to the linker

This patch:

- `clang` passes `"--start-group" "-lc" "-lgloss" "--end-group" "-lgcc"` to the linker
- `clang++` passes `"-lstdc++" "--start-group" "-lc" "-lgloss" "--end-group" "-lgcc"` to the linker

I think these are all compatible. I'm not sure where the `-lm` is coming from in the g++ invocation vs the `clang++` invocation, but given we have TODOs in this driver code around C++, I don't think that needs to be fixed in this patch.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68407/new/

https://reviews.llvm.org/D68407





More information about the cfe-commits mailing list