I have been working on patches for compiling Swift 5.6 for RISCV64 with Buildroot. First I compiled the patched compiler (swift, llvm-project and swift-core-tools-support) and then use Buildroot with patched compiler to cross compiler the Swift Stdlib. I have gotten to the point where I can successfully compile libdispatch, the Swift StdLib and runtime's .c, .cpp and .swift files for RISCV64, but the linking stage for the StdLib fails.
https://bugs.swift.org/browse/SR-16005
ld.lld: error: stdlib/public/core/LINUX/riscv64/Swift.o: cannot link object files with different floating-point ABI
ld.lld: error: Swift.o.text+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax
I have tried a lot of Swift compiler flags based on Every Option and Flag /swift (1.2) Accepts Ever · GitHub and passing them via -DSWIFT_STDLIB_EXTRA_SWIFT_COMPILE_FLAGS
to cmake for cross compiling the StdLib but none seem to work.