Skip to content

tools/[Rust|D]: Fix build break for RISC-V#12838

Merged
xiaoxiang781216 merged 1 commit intoapache:masterfrom
no1wudi:rust
Aug 5, 2024
Merged

tools/[Rust|D]: Fix build break for RISC-V#12838
xiaoxiang781216 merged 1 commit intoapache:masterfrom
no1wudi:rust

Conversation

@no1wudi
Copy link
Copy Markdown
Contributor

@no1wudi no1wudi commented Aug 4, 2024

Summary

Rust/D support for RISC-V is broken after #11549,
since the target triple is quite different bewteen Rust/D toolchain and GCC,
only few RISC-V targets are supported by Rust toolchain now, so it's better to
construct target triple in Rust.defs/D.defs for RISC-V.

Impact

Minor

Testing

Local machine

@anchao
Copy link
Copy Markdown
Contributor

anchao commented Aug 4, 2024

@no1wudi I solved this issue a long time ago, but forgot to submit it... could you fix the similar issue in LDC2(dlang) at the same time?
https://github.com/apache/nuttx/blob/master/tools/D.defs#L50

Comment thread tools/Rust.defs
Rust/D support for RISC-V is broken after apache#11549,
since the target triple is quite different bewteen Rust/D toolchain and GCC,
only few RISC-V targets are supported by Rust toolchain now, so it's better to
construct target triple in Rust.defs/D.defs for RISC-V.
@no1wudi
Copy link
Copy Markdown
Contributor Author

no1wudi commented Aug 5, 2024

@no1wudi I solved this issue a long time ago, but forgot to submit it... could you fix the similar issue in LDC2(dlang) at the same time? https://github.com/apache/nuttx/blob/master/tools/D.defs#L50

OK

@no1wudi no1wudi changed the title tools/Rust: Fix build break for RISC-V tools/[Rust|D]: Fix build break for RISC-V Aug 5, 2024
@xiaoxiang781216 xiaoxiang781216 merged commit 1eca39e into apache:master Aug 5, 2024
@lupyuen
Copy link
Copy Markdown
Member

lupyuen commented Aug 6, 2024

Sorry @no1wudi I think CONFIG_ARCH_RV_ISA_F and CONFIG_ARCH_RV_ISA_D don't exist: tools/Rust.defs

  ifeq ($(CONFIG_ARCH_RV_ISA_F),y)
    RUST_ARCHTYPE := $(RUST_ARCHTYPE)f
  endif
  ifeq ($(CONFIG_ARCH_RV_ISA_D),y)
    RUST_ARCHTYPE := $(RUST_ARCHTYPE)d
  endif

In my upcoming PR, I propose to change them to CONFIG_ARCH_FPU and CONFIG_ARCH_DPFPU: tools/Rust.defs

    ifeq ($(CONFIG_ARCH_FPU),y)
      RUST_ARCHTYPE := $(RUST_ARCHTYPE)f
    endif
    ifeq ($(CONFIG_ARCH_DPFPU),y)
      RUST_ARCHTYPE := $(RUST_ARCHTYPE)d
    endif

(This usage of CONFIG_ARCH_FPU and CONFIG_ARCH_DPFPU is consistent with Toolchain.defs)

My PR will also fix the Rust Build riscv64gc for QEMU RISC-V 64-bit. (Which has been broken for a while) I hope you are OK with this. Thanks!

@no1wudi
Copy link
Copy Markdown
Contributor Author

no1wudi commented Aug 6, 2024

@lupyuen Sorry for this issue, let's submit a standalone patch to fix it?

@lupyuen
Copy link
Copy Markdown
Member

lupyuen commented Aug 6, 2024

@no1wudi Yep I'll submit a patch now for D.defs and Rust.defs. My Dockerfile testing is taking a while, so I'll patch the other files later. Thanks!

@lupyuen
Copy link
Copy Markdown
Member

lupyuen commented Aug 6, 2024

@no1wudi Here's the patch for D.defs and Rust.defs thanks! #12854

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants