Skip to content
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

Fix instruction for RISC-V (the previous instruction didn't work) #10374

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

OS-of-S
Copy link

@OS-of-S OS-of-S commented Dec 5, 2024

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 )
image

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.
image
image
image
(here I open a new terminal)
image
image
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.
image

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

@tetrapod00 tetrapod00 added enhancement area:contributing Issues and PRs related to the Contributing/Development section of the documentation labels Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:contributing Issues and PRs related to the Contributing/Development section of the documentation enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants