#6 Add support for riscv64
Merged 2 months ago by petersen. Opened 2 months ago by rjones.
rpms/ rjones/ghc riscv64-add  into  rawhide

Add support for riscv64
David Abdurachmanov • 2 months ago  
file modified
+7 -5
@@ -67,11 +67,11 @@ 

  # 9.4 needs llvm 10-14

  %global llvm_major 14

  %if %{with hadrian}

- %global ghc_llvm_archs armv7hl s390x

- %global ghc_unregisterized_arches s390 %{mips} riscv64

+ %global ghc_llvm_archs armv7hl s390x riscv64

+ %global ghc_unregisterized_arches s390 %{mips}


- %global ghc_llvm_archs armv7hl

- %global ghc_unregisterized_arches s390 s390x %{mips} riscv64

+ %global ghc_llvm_archs armv7hl riscv64

+ %global ghc_unregisterized_arches s390 s390x %{mips}



  %global obsoletes_ghcXY() \
@@ -454,7 +454,7 @@ 

  %patch -P13 -p1 -b .orig



- %ifarch %{ghc_unregisterized_arches}

+ %ifarch %{ghc_unregisterized_arches} riscv64

  %patch -P15 -p1 -b .orig

  %patch -P16 -p1 -b .orig

@@ -527,7 +527,9 @@ 

  # /usr/bin/debugedit: Cannot handle 8-byte build ID

  # https://bugzilla.redhat.com/show_bug.cgi?id=2116508

  # https://gitlab.haskell.org/ghc/ghc/-/issues/22195

+ %ifnarch riscv64

  export LD=%{_bindir}/ld.gold

+ %endif


  # * %%configure induces cross-build due to different target/host/build platform names

  ./configure --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \

Support for an LLVM backend was added a while back in this
upstream commit:

Signed-off-by: David Abdurachmanov davidlt@rivosinc.com

NB David has been testing riscv64 support in our own Koji instance for a while,
including patches similar to this and !5.

Thanks, btw I planning to gradually switch all ghc's to ld.bfd

Pull-Request has been merged by petersen

2 months ago

So the reason for commenting out ld.gold was that this has not been ported to RISC-V, and since GOLD has been deprecated it seems unlikely it will ever be ported. We don't see the buildid error on RISC-V anyway.