<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>I am trying to retarget my application to a Risc-V 64-bit core.</div><div><br></div><div>I downloaded LLVM 7.0.0 release today, and built LLVM+Clang for both x86_64 and Risc-V.<br></div><div><br></div><div>Alas, I have hit a snag: given a simple test program:</div><div><br></div><div><br></div><div>extern int foo;<br>int *getfoo() { return &foo; }<br></div><div><br></div><div>I try to compile:</div><div><br></div><div>/tools/llvm/7.0.0dbg/bin/clang test.c -c -o test.o --target=riscv64-unknown-elf<br></div><div><br></div><div>and I get:</div><div><br></div><div>fatal error: error in backend: Unable to lowerGlobalAddress<br>clang-7: error: clang frontend command failed with exit code 70 (use -v to see invocation)<br>clang version 7.0.0 (tags/RELEASE_700/final)<br>Target: riscv64-unknown--elf<br>Thread model: posix</div><div><br></div><div><br></div><div>Is the 64-bit Risc-V target stable? Or do I require a specific set of flags (e.g. relocation model)?</div><div><br></div><div><br></div><div><br></div></div></div></div></div>