New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-16005] RFE: RISCV64 Support #58266
[SR-16005] RFE: RISCV64 Support #58266
Comments
Attached Swift 5.6 patches for RISCV64. |
Failing to build StdLib due to being unable to pass `-mno-relax` to the Swift compiler / linker. ld.lld: error: stdlib/public/core/LINUX/riscv64/Swift.o: cannot link object files with different floating-point ABI |
@buttaface Do you have any suggestions? Everything from the compiler to the StdLib is building, but its failing at the linking stage. Passing `-mno-relax` to the Cmake C Flags fixes all C and C++ linking (e.g. libdispatch and Swift Runtime) but not sure how to pass to C compiler. |
CodaFi (JIRA User) I have tried a lot of options based on your document https://gist.github.com/CodaFi/b1e0d0f37cd2890c07c5 and passing them via ` |
There is a function in the CMake configuration for the stdlib where we add platform-specific link flags when needed, you could try adding it there. |
@buttaface Your suggestion helped me overcome the linking issue. Now my issue is that my C nd C++ code is being compiled with hard float (double) but the Swift code is not. Swift doesn't have the `-march`, `-mabi` `-mcpu` flags that Clang does. To my knowledge, based on review of Clang's code, when targeting Linux and RISCV64, if none of that is specified, it will default to |
I can attempt to build the Linux image with Soft Float ABI, but there will be a significant performance penalty. Also pretty much all RISC64 cores available to buy have double Float support, hence why Buildroot makes it the default. |
(bullseye)root@mac-mini:/home/coleman/Developer/buildroot# /usr/sbin/chroot ./output/target/ /usr/bin/qemu-riscv64-static /usr/bin/hello |
I got the RISCV64 Soft Float build working. |
Opened new PRs |
Additional Detail from JIRA
md5: 8edf88e5efa8c04d21ce395d890ee837
Issue Description:
Swift should support compiling to riscv64.
The text was updated successfully, but these errors were encountered: