-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
[3.x] Add support for the RISC-V architecture #53509
Conversation
76f0279
to
52fa61e
Compare
SConstruct
Outdated
if env["arch"] == "" and machine() == "riscv64": | ||
env["arch"] = "rv64" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move this to the Linux detect.py
too. It won't add the arch
to extra_suffix
, but this isn't done for i386
, i686
, x86_64
, armv7hl
or aarch64
on Linux currently, so we shouldn't do it for rv64
only.
Like it's done for aarch64
currently, it should be clear to someone compiling on RISC-V hardware that their godot.linuxbsd.opt.tools.64
binary targets RISC-V (especially if they passed arch=rv64
for that).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, this check also makes it impossible to cross-compile from RISC-V to other architectures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the change locally to test it. To my surprise, it actually does add the arch to the suffix. It calls the configure method on line 397. So yeah, moving this to detect.py
works well.
BTW, this check also makes it impossible to cross-compile from RISC-V to other architectures.
It's not possible to cross-compile for x86 regardless as far as I can tell. For this code specifically, it doesn't make it impossible because this code only runs if env["arch"] == ""
so you just have to say arch=arm64
or arch=x86_64
, even if it's not picked up by the engine, this will stop it from being equal to ""
. Still, as I mentioned it's not possible to cross-compile for x86 regardless, we don't have any code in the build system to tell the compiler to target x86. Also, cross-compiling from RISC-V is super niche :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, specifying a different arch
would work. You can still cross-compile by passing CC
and CXX
manually to use the compilers for that architecture.
52fa61e
to
cda7f13
Compare
Supports RV64GC (RISC-V 64-bit with general-purpose and compressed-instruction extensions)
cda7f13
to
5659120
Compare
With the current form I think it's fine to merge for 3.4 even if it's not critical for that release. It's an extra option provided as is, without expectation that it actually works. But that's a start. |
Thanks! |
I'm going to try building godot under Debian sid on my VisionFive2. Am I right in thinking the build command is:
Thanks |
@danboid Yes, that is correct. Actually just |
Implements godotengine/godot-proposals#3374 on 3.x. Only Clang Debug builds work on RISC-V right now.