David Jones via llvm-dev
2018-Sep-21 01:06 UTC
[llvm-dev] Risc-V 64: unable to lowerGlobalAddress
I am trying to retarget my application to a Risc-V 64-bit core. I downloaded LLVM 7.0.0 release today, and built LLVM+Clang for both x86_64 and Risc-V. Alas, I have hit a snag: given a simple test program: extern int foo; int *getfoo() { return &foo; } I try to compile: /tools/llvm/7.0.0dbg/bin/clang test.c -c -o test.o --target=riscv64-unknown-elf and I get: fatal error: error in backend: Unable to lowerGlobalAddress clang-7: error: clang frontend command failed with exit code 70 (use -v to see invocation) clang version 7.0.0 (tags/RELEASE_700/final) Target: riscv64-unknown--elf Thread model: posix Is the 64-bit Risc-V target stable? Or do I require a specific set of flags (e.g. relocation model)? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180920/a21b809a/attachment.html>
Bruce Hoult via llvm-dev
2018-Sep-21 01:29 UTC
[llvm-dev] Risc-V 64: unable to lowerGlobalAddress
Upstream LLVM does not yet have support for rv64. There is support for rv64 in the patches at https://github.com/lowRISC/riscv-llvm but if you follow the instructions there you'll be missing six months of other important and useful improvements to RISC-V LLVM. On Thu, Sep 20, 2018 at 6:06 PM, David Jones via llvm-dev < llvm-dev at lists.llvm.org> wrote:> I am trying to retarget my application to a Risc-V 64-bit core. > > I downloaded LLVM 7.0.0 release today, and built LLVM+Clang for both > x86_64 and Risc-V. > > Alas, I have hit a snag: given a simple test program: > > > extern int foo; > int *getfoo() { return &foo; } > > I try to compile: > > /tools/llvm/7.0.0dbg/bin/clang test.c -c -o test.o > --target=riscv64-unknown-elf > > and I get: > > fatal error: error in backend: Unable to lowerGlobalAddress > clang-7: error: clang frontend command failed with exit code 70 (use -v to > see invocation) > clang version 7.0.0 (tags/RELEASE_700/final) > Target: riscv64-unknown--elf > Thread model: posix > > > Is the 64-bit Risc-V target stable? Or do I require a specific set of > flags (e.g. relocation model)? > > > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180920/2c16b85b/attachment.html>
Alex Bradbury via llvm-dev
2018-Sep-21 10:28 UTC
[llvm-dev] Risc-V 64: unable to lowerGlobalAddress
On 21 September 2018 at 02:06, David Jones via llvm-dev <llvm-dev at lists.llvm.org> wrote:> I am trying to retarget my application to a Risc-V 64-bit core. > > I downloaded LLVM 7.0.0 release today, and built LLVM+Clang for both x86_64 > and Risc-V. > > Alas, I have hit a snag: given a simple test program: > > > extern int foo; > int *getfoo() { return &foo; } > > I try to compile: > > /tools/llvm/7.0.0dbg/bin/clang test.c -c -o test.o > --target=riscv64-unknown-elf > > and I get: > > fatal error: error in backend: Unable to lowerGlobalAddress > clang-7: error: clang frontend command failed with exit code 70 (use -v to > see invocation) > clang version 7.0.0 (tags/RELEASE_700/final) > Target: riscv64-unknown--elf > Thread model: posix > > > Is the 64-bit Risc-V target stable? Or do I require a specific set of flags > (e.g. relocation model)?Hi David. The 64-bit target is not stable, though basically "just works" with some simple patching due to the use of parameterised register classes in the design of the backend. Your email is well timed, as I'm currently cleaning up that support ready for review. Not much work has been done in evaluating generating code quality though. In summary: things are about to start moving much more quickly in regards to RV64, but you're likely to see codegen oddities or bugs for a little while. Best, Alex