Hi maintainer,
Sorry for my delayed reply.
On Fri, 17 May 2024 14:01:37 +0300 Ilias Tsitsimpis wrote:
> Hi!
>
> On Wed, May 15, 2024 at 09:23AM, Peng Fan wrote:
> > The reason for the above error is that "relocation R_LARCH_B26 overflow
> I assume ghc 9.4.7 that you currently have in loong64 is unregisterised.
> Can you please run 'ghc --info' to confirm that?
For ghc Version 9.4.7, we have added loongarch support and built the
unreleased version 9.4.7+loong64.
The ghc Version 9.4.7+loong64 was uploaded to pool-loong64 repository on
Nov, 2023.
I installed ghc 9.4.7+loong64 on my local ENV, the result of run 'ghc
--info' is as follows,
```
root@localhost:/home# ghc --info
[("Project name","The Glorious Glasgow Haskell Compilation System")
,("GCC extra via C opts","")
,("C compiler command","loongarch64-linux-gnu-gcc")
,("C compiler flags","")
,("C++ compiler command","loongarch64-linux-gnu-g++")
,("C++ compiler flags","")
,("C compiler link flags","-fuse-ld=bfd")
......
```
> If that's the case, can you please try with ghc 9.6.7-1~exp1 from
> experimental? I have done some extra work there in order to get a
> registerised compiler on loong64.
Thanks for your help, sincerely.
But I'd like to note that the latest ghc version in the experimental
repository is currently 9.6.5-1~exp1.
Please see
https://buildd.debian.org/status/package.php?p=ghc&suite=experimental.
As you said, we really should submit bugs and make patch based on ghc
9.6.5-1~exp1.
Based on ghc 9.6.5-1~exp1, I have added extra --ghc-options in d/rules
for loong64.
Please consider the patch I attached.
Your opinions are welcome.
Thanks,
Dandan Zhang
diff --git a/debian/rules b/debian/rules
index 6515e18..6704ff0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -102,6 +102,10 @@ ifneq (,$(filter noopt, $(DEB_BUILD_OPTIONS)))
EXTRA_HADRIAN_FLAGS += "*.*.rts.*.opts += -O0"
endif
+ifneq (,$(filter loong64, $(DEB_HOST_ARCH)))
+ EXTRA_HADRIAN_FLAGS += "*.*.ghc.*.opts += -optc-mcmodel=medium"
+endif
+
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif