Your message dated Tue, 13 Aug 2024 12:35:43 +0000
with message-id <e1sdqkz-008ohp...@fasolo.debian.org>
and subject line Bug#1071151: fixed in ghc 9.6.6-1~exp3
has caused the Debian Bug report #1071151,
regarding ghc: Use extra --ghc-options in d/rules on loong64
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
1071151: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1071151
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: ghc
Version: 9.4.7-1+loong64.1
Severity: important
Tags: ftbfs patch
User: debian-loonga...@lists.debian.org
Usertags: loong64

Dear maintainers,

Compiling the haskell-pandoc failed for loong64 in the Debian Package
Auto-Building environment.
The error log is as follows,
```
[58 of 58] Linking dist-ghc/build/test-pandoc/test-pandoc
/usr/bin/ld.bfd:
/usr/lib/ghc/lib/../lib/loongarch64-linux-ghc-9.4.7/rts-1.0.2/libHSrts-1.0.2_thr.a(NonMovingMark.thr_o):
relocation R_LARCH_B26 overflow 0xfffffffff5fec6a4
Dump relocate record:
stack top        relocation name        symbol
at
/usr/lib/gcc/loongarch64-linux-gnu/13/../../../loongarch64-linux-gnu/crt1.o(.text+0x0):
...
0x0000000000000000 R_LARCH_NONE    `<nameless>' + 3(0x3)
......

```

The Full log can be found at
https://buildd.debian.org/status/logs.php?pkg=haskell-pandoc&ver=3.1.3-1&arch=loong64.

The reason for the above error is that "relocation R_LARCH_B26 overflow
......" occurs during static linking in the test-pandoc stage.
Currently we have a verified method, don't need to skip test cases to solve 
"relocation R_LARCH_B26
overflow ......" during static linking.
The verified method is as follows,
We need to add extra --ghc-options in d/rules on loong64 to increase 
jump-instructions's range.

```
diff --git a/debian/rules b/debian/rules
index 29b9da7..4c55f52 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
```

Meanwhile, you can also consider the patch I attached.
Your opinions are welcome.

Thanks.



-- System Information:
Debian Release: trixie/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: loong64 (loongarch64)

Kernel: Linux 5.10.0-60.121.0.148.oe2203.loongarch64 (SMP w/32 CPU threads)
Kernel taint flags: TAINT_UNSIGNED_MODULE
Locale: LANG=zh_CN.UTF-8, LC_CTYPE=zh_CN.UTF-8 (charmap=ANSI_X3.4-1968) 
(ignored: LC_ALL set to POSIX), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect

Versions of packages ghc depends on:
ii  dpkg            1.22.6
ii  gcc             4:13.2.0-7
ii  libbsd-dev      0.12.2-1
ii  libc6           2.38-11
ii  libc6-dev       2.38-11
ii  libffi-dev      3.4.6-1
ii  libffi8         3.4.6-1
ii  libgmp-dev      2:6.3.0+dfsg-2
ii  libgmp10        2:6.3.0+dfsg-2
ii  libncurses-dev  6.5-2
ii  libnuma1        2.0.18-1
ii  libtinfo6       6.5-2
ii  llvm-16         1:16.0.6-27

ghc recommends no packages.

Versions of packages ghc suggests:
ii  ghc-doc   9.4.7-5
ii  ghc-prof  9.4.7-1+loong64.1
pn  llvm-15   <none>
ii  perl      5.38.2-4

-- no debconf information
diff --git a/debian/rules b/debian/rules
index 29b9da7..4c55f52 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

--- End Message ---
--- Begin Message ---
Source: ghc
Source-Version: 9.6.6-1~exp3
Done: Gianfranco Costamagna <locutusofb...@debian.org>

We believe that the bug you reported is fixed in the latest version of
ghc, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1071...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Gianfranco Costamagna <locutusofb...@debian.org> (supplier of updated ghc 
package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Tue, 13 Aug 2024 14:17:49 +0200
Source: ghc
Built-For-Profiles: noudeb
Architecture: source
Version: 9.6.6-1~exp3
Distribution: experimental
Urgency: medium
Maintainer: Debian Haskell Group 
<pkg-haskell-maintain...@lists.alioth.debian.org>
Changed-By: Gianfranco Costamagna <locutusofb...@debian.org>
Closes: 1071151
Changes:
 ghc (9.6.6-1~exp3) experimental; urgency=medium
 .
   [ Peng Fan <fanp...@loongson.cn> ]
   * Add loong64 support (Closes: #1071151)
Checksums-Sha1:
 9314cf9c4b169f9e5a7d6fac598652fbce22b706 2712 ghc_9.6.6-1~exp3.dsc
 3ad3de4bc2ba754068e6de9b3455fc883e1a147c 66652 ghc_9.6.6-1~exp3.debian.tar.xz
 043117c45eecf2739a38a54ff50452510111f2b5 16528 
ghc_9.6.6-1~exp3_source.buildinfo
Checksums-Sha256:
 2e4a0a6717c7a85b4962afd49182cc1042024f23a6696a61f7fe2f94f699e22b 2712 
ghc_9.6.6-1~exp3.dsc
 a34de8b3cf5408b051de9987db58aa16f90f000bdbdca934b4cc2a8830bdce36 66652 
ghc_9.6.6-1~exp3.debian.tar.xz
 8c4ed0c54db6748400e665cec1bfcbaa4c57c449ccfd7f45d7da653e62fc6c16 16528 
ghc_9.6.6-1~exp3_source.buildinfo
Files:
 224f939977c51e82c6f3de404e60b83d 2712 haskell optional ghc_9.6.6-1~exp3.dsc
 9139f2fc940e47cbfef56d0ab25c5fd3 66652 haskell optional 
ghc_9.6.6-1~exp3.debian.tar.xz
 e91c7bbcadbf710f56bdebf4e2a73085 16528 haskell optional 
ghc_9.6.6-1~exp3_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEkpeKbhleSSGCX3/w808JdE6fXdkFAma7Ty4ACgkQ808JdE6f
XdmurhAApM3NjCeySFY3sQ7WCVfPVphl+RhQazCOKMcwjpYabZ2sbuqUsMd4KJxo
kTZs6uBRkLd0MeeGxZY8/SMK0uWZT8JEZDtFi5q3pKGwWH2wQViVK20YlipS+xXm
4D4H5dJBmKPwLCayLrs7gb1wf7BCXNPa6+x4G74ijcC8LlmB9gjr5Z4p9kD8aGtO
u9sVaAzfLVN2VjhJ/Fe82/uqVD7UCi9EJI5UIiM0kK9ojkW84DjRRSf4LJHlnggP
Mo3WskCCwxx8OZ8hVr5Jsm3g1sto2VYZdsLtasA4fKO/xX0TgURHnSR+6bR3DQ4m
JptfAzekwxuVpKO4nXLpLVUhlNdkD4ifLV+sQOuzOSyrrl4NRp+bkeUaceRUE2N9
uI+7COm0sKOxVKWEjKPcsjcxAqv9sSaW2Cs6NFTr351J+L3IDOAfM8TTG511mVcW
X2oSJoCehe1fbjLDmAUltNFMQC1QaQCDktUYWQXX4fU8BpNS+RLeVZ7cqycWhyrQ
uWWlF91siDnXdi0r397BWTv4IBOop9vQdHdFAhEOT2z+f/0EOfWYINvbCf+jTFYg
jQOZNI0xutiN9mKbM8QExlm1LU7KHzwnb+HRyUwlnkTJ1Ci4fRaV/+B905x9OXHi
WOSESPamvvLR5EA5lh2fnvZbi7Wt1B52MqmSWTuqG88c03hLfVY=
=Hdrk
-----END PGP SIGNATURE-----

Attachment: pgpnJbBVJRB0R.pgp
Description: PGP signature


--- End Message ---

Reply via email to