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

2019-11-14 Thread Edward Jones via Phabricator via cfe-commits
edward-jones added a comment. If I set `-DCLANG_DEFAULT_RTLIB=compiler-rt` I see the following failure in `clang/test/Driver/cross-linux.c`: /home/ed/work/proj/riscv-testing/llvm/clang/test/Driver/cross-linux.c:62:26: error: CHECK-MULTI32-X86-64: expected string not found in input // CHECK-

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

2019-11-14 Thread Edward Jones via Phabricator via cfe-commits
edward-jones updated this revision to Diff 229273. edward-jones added a comment. It seems that the option `--rtlib=platform` exists to force the driver to ignore the `-DCLANG_DEFAULT_RTLIB` for testing purposes, so I've added this option to the tests that were broken. These tests now seem to pa

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

2019-11-14 Thread Edward Jones via Phabricator via cfe-commits
edward-jones added a comment. Okay. I'll see if I can find a way to test this when `CLANG_DEFAULT_RTLIB` is set, and then I'll resubmit Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68407/new/ https://reviews.llvm.org/D68407 ___

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

2019-11-13 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In D68407#1744486 , @leonardchan wrote: > Hi. I think this patch is causing some test failures for us: This is breaking us too, in the same way. The "problem" is that this makes the riscv64 target use the compiler-rt crtbegin / c

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

2019-11-13 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. Hi. I think this patch is causing some test failures for us: FAIL: Clang :: Driver/riscv64-toolchain.c (5479 of 16161) TEST 'Clang :: Driver/riscv64-toolchain.c' FAILED Script: -- : 'RUN: at line 3'; /b/s/w/ir/k/

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

2019-11-13 Thread Edward Jones via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG3289352e6bb9: [RISCV] Use compiler-rt if no GCC installation detected (authored by edward-jones). Changed prior to commit: https://reviews.llvm.org/D68407?vs=228268&id=229121#toc Repository: rG LLVM

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

2019-11-11 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/lib/Driver/ToolChains/RISCVToolchain.cpp:114 const char *LinkingOutput) const { - const ToolChain &ToolChain = getToolChain(); + const auto &ToolChain = getToolChain(); const Driver &D = ToolC

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

2019-11-11 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/lib/Driver/ToolChains/RISCVToolchain.cpp:49 + else +return ToolChain::RLT_CompilerRT; +} Ternary operator? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68407/new/ https://reviews.llvm.org/D68407

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

2019-11-11 Thread Sam Elliott via Phabricator via cfe-commits
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:

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

2019-11-07 Thread Edward Jones via Phabricator via cfe-commits
edward-jones updated this revision to Diff 228268. edward-jones added a comment. I've changed this to always return `ToolChain::UNW_None` from `RISCVToolChain::GetUnwindLibType` now. As a consequence we get the original behaviour of only `-lgcc` being added to the link command. CHANGES SINCE L

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

2019-11-07 Thread Edward Jones via Phabricator via cfe-commits
edward-jones added a comment. In D68407#1732685 , @lenary wrote: > This patch is looking much better, thanks for updating it. > > Please may you clarify what RISC-V gcc does for `-lgcc`, `-lgcc_s`, > `-lgcc_eh`? Is it different to what gcc does on other t

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

2019-11-04 Thread Sam Elliott via Phabricator via cfe-commits
lenary added a comment. This patch is looking much better, thanks for updating it. Please may you clarify what RISC-V gcc does for `-lgcc`, `-lgcc_s`, `-lgcc_eh`? Is it different to what gcc does on other targets? Being closer to matching the linker arguments that gcc provides to ld seems like

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

2019-11-04 Thread Edward Jones via Phabricator via cfe-commits
edward-jones added a comment. In D68407#1709235 , @lenary wrote: > Please can you add a test for riscv32 and riscv64 without libgcc? I'm not sure what you mean here; I believe the existing tests already cover riscv{32,64} without libgcc. CHANGES SINCE

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

2019-11-04 Thread Edward Jones via Phabricator via cfe-commits
edward-jones updated this revision to Diff 227722. edward-jones retitled this revision from "[RISCV] Use compiler-rt if no GCC installation detected" to "[WIP][RISCV] Use compiler-rt if no GCC installation detected". edward-jones edited the summary of this revision. edward-jones added a comment.

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

2019-10-03 Thread Edward Jones via Phabricator via cfe-commits
edward-jones added a comment. Work in progress because this needs tests (and probably clang-format too). My assumption is that libgcc should be used in preference if it is available. At the moment this either uses libgcc and libgcc's crtbegin/crtend, or the Clang equivalents. Potentially a user

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

2019-10-03 Thread Edward Jones via Phabricator via cfe-commits
edward-jones created this revision. edward-jones added a reviewer: asb. Herald added subscribers: cfe-commits, pzheng, simoncook, s.egerton, lenary, Jim, benna, psnobl, jocewei, PkmX, rkruppe, the_o, brucehoult, MartinMosbeck, rogfer01, zzheng, MaskRay, jrtc27, shiva0217, kito-cheng, niosHD, sabu