Fix instruction for RISC-V (the previous instruction didn't work) #10374
+14
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I checked this for Godot 4.3 sources on a Virtual Machine with Ubuntu 22.04.3(LTE). This pull request is the only instruction that worked for me. In all other cases I get an error.
I came to the conclusion that the user does not need to install clang at all to compile for RISC-V, since clang comes with the tool specified in the documentation. Moreover, only this toolset can be used for compilation. Check out details of my experiment:
As you can see below, I have clang installed (version 18.1.8, much better then 16-minimum mentioned in documentation). When I try to use command from actual version of "Compiling for Linux, *BSD" page, I get an error at the end of Godot compilation. ( "scons platform=linuxbsd use_llvm=yes linker=lld" works well therefore it's not problem with my clang )
Now I gonna uninstall official clang and check the same scons command after adding $RISCV_TOOLCHAIN_PATH/bin into PATH. Let's uninstall clang and llvm via apt-get purge command. To check that clang were trully uninstalled I trying to check it's version again.
(here I open a new terminal)
As you can see, now my Linux environment use built-in clang from riscv-gnu-toolchain path and it compiles Godot without errors. But, of course, adding $RISCV_TOOLCHAIN_PATH/bin into PATH would automatically "replaces" the installed Clang with another one if you have it on your system. The same is true vice versa — if the user installs a separate Сlang, then when trying to compile for RISC-V, an inappropriate version can be selected. That's why I recommend not to make adding to PATH permanent and do it every time before RISC-V-compiling.
In actual page version said: "RISC-V GCC has bugs with its atomic operations which prevent it from compiling Godot correctly". I can not prove that Godot compiled in my case have no such bugs, since I don't have any RISC-V devices. This requires testing (I attached the compiled file at the end of this comment). But, as I understang, GCC and Clang are different compilers, and I don't use GCC in suggested instruction.
godot.linuxbsd.editor.rv64.llvm