• Bug#1069179: pandoc: use "--enable-executable-dynamic" in d/rules to re

    From zhangdandan@21:1/5 to All on Wed Apr 17 14:20:01 2024
    This is a multi-part message in MIME format.
    Source: pandoc
    Version: 3.1.3+ds-2
    Severity: important
    Tags: ftbfs patch
    User: debian-loongarch@lists.debian.org
    Usertags: loong64
    X-Debbugs-Cc: wanghonghu@loongson.cn, zhangjialing@loongson.cn, fanpeng@loongson.cn

    Dear maintainers,

    The pandoc is blocked from building by haskell-pandoc and haskell-pandoc-lua-engine in the Debian Package Auto-Building environment.
    I have built haskell-pandoc and haskell-pandoc-lua-engine locally, and
    then compiling pandoc for loong64 in my local ENV failed.

    The error message is related to "relocation R_LARCH_B26 overflow ......"
    during static linking when built pandoc binary.
    The build error log of pandoc from my local ENV is as follows,
    ```
    [4 of 4] Linking dist-ghc/build/pandoc/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 0xfffffffff62f45e4
    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)
    ......
    ```

    It is recommended to use "--enable-executable-dynamic" in d/rules to
    reduce binary size on loong64.
    The parameter "--enable-executable-dynamic" means "enable dynamic
    linking of executable files".
    Please consider the patch I attached.
    With the attached patch, the pandoc was built successfully in my local ENV.
    ```
    ......
    if grep -q '^Component:[[:space:]]*main' /CurrentlyBuilding 2>/dev/null;
    then dh_scour -ppandoc ; fi
    dh_md5sums -ppandoc
    dh_builddeb -ppandoc
    dpkg-deb: building package 'pandoc' in '../pandoc_3.1.3+ds-2_loong64.deb'.
     dpkg-genbuildinfo -O../pandoc_3.1.3+ds-2_loong64.buildinfo
     dpkg-genchanges -O../pandoc_3.1.3+ds-2_loong64.changes
    ```

    Your opinions are welcome.
    In addition, before the pandoc was built for loong64 in the Debian
    Package Auto-Building environment, could I dupload the pandoc compiled
    locally using "-enable-executable-dynamic" to the
    debian-ports/pool-loong64 repository?
    Looking forward to your reply.

    Thanks,
    Dandan Zhang


    ZGlmZiAtTnJ1IHBhbmRvYy0zLjEuMytkcy9kZWJpYW4vcnVsZXMgcGFuZG9jLTMuMS4zK2Rz L2RlYmlhbi9ydWxlcwotLS0gcGFuZG9jLTMuMS4zK2RzL2RlYmlhbi9ydWxlcwkyMDIzLTEy LTIxIDIwOjEzOjExLjAwMDAwMDAwMCArMDAwMAorKysgcGFuZG9jLTMuMS4zK2RzL2RlYmlh bi9ydWxlcwkyMDI0LTAxLTA3IDAwOjUyOjM5LjAwMDAwMDAwMCArMDAwMApAQCAtNTgsNiAr NTgsMTAgQEAKIERFQl9TRVRVUF9HSENfQ09ORklHVVJFX0FSR1MgKz0gLS1naGMtb3B0aW9u cz0iLU8wIgogZW5kaWYKIAoraWZuZXEgKCwkKGZpbHRlciAkKERFQl9IT1NUX0FSQ0hfQ1BV KSwgbG9vbmc2NCkpCitERUJfU0VUVVBfR0hDX0NPTkZJR1VSRV9BUkdTICs9IC0tZW5hYmxl LWV4ZWN1dGFibGUtZHluYW1pYyAKK2VuZGlmCisKIERFQl9TRVRVUF9HSENfQ09ORklHVVJF X0FSR1MgKz0gJChpZiAkKGZpbHRlciBub2NoZWNrLCQoREVCX0JVSUxEX09QVElPTlMpKSws LWZ0ZXN0cykKIAogREVCX0lOU1RBTExfRE9DU19BTEwgKz0gUkVBRE1FLm1kCg==

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jonas Smedegaard@21:1/5 to All on Sun Apr 21 02:00:01 2024
    Hi Dandan Zhang.

    Quoting zhangdandan (2024-04-17 14:13:00)
    The pandoc is blocked from building by haskell-pandoc and haskell-pandoc-lua-engine in the Debian Package Auto-Building environment.
    I have built haskell-pandoc and haskell-pandoc-lua-engine locally, and
    then compiling pandoc for loong64 in my local ENV failed.

    The error message is related to "relocation R_LARCH_B26 overflow ......" during static linking when built pandoc binary.
    The build error log of pandoc from my local ENV is as follows,
    ```
    [4 of 4] Linking dist-ghc/build/pandoc/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 0xfffffffff62f45e4
    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)
    ......
    ```

    It is recommended to use "--enable-executable-dynamic" in d/rules to
    reduce binary size on loong64.
    The parameter "--enable-executable-dynamic" means "enable dynamic
    linking of executable files".
    Please consider the patch I attached.
    With the attached patch, the pandoc was built successfully in my local ENV. ```
    ......
    if grep -q '^Component:[[:space:]]*main' /CurrentlyBuilding 2>/dev/null;
    then dh_scour -ppandoc ; fi
    dh_md5sums -ppandoc
    dh_builddeb -ppandoc
    dpkg-deb: building package 'pandoc' in '../pandoc_3.1.3+ds-2_loong64.deb'.
     dpkg-genbuildinfo -O../pandoc_3.1.3+ds-2_loong64.buildinfo
     dpkg-genchanges -O../pandoc_3.1.3+ds-2_loong64.changes
    ```

    Your opinions are welcome.
    In addition, before the pandoc was built for loong64 in the Debian
    Package Auto-Building environment, could I dupload the pandoc compiled locally using "-enable-executable-dynamic" to the
    debian-ports/pool-loong64 repository?
    Looking forward to your reply.

    Unfortunately, Debian treat Haskell libraries as development code, and
    the option --enable-executable-dynamic works only when development files
    are also installed.

    I have instead added loong64 to the list of low-memory architectures,
    which means these options are applied:
    --ghc-options="-optc--param -optcggc-min-expand=10 -O0"
    Hopefully that is enough for the build for loong64 succeeds.

    Kind regards,

    - Jonas

    --
    * Jonas Smedegaard - idealist & Internet-arkitekt
    * Tlf.: +45 40843136 Website: http://dr.jones.dk/
    * Sponsorship: https://ko-fi.com/drjones

    [x] quote me freely [ ] ask before reusing [ ] keep private --==============I36851073071408192=MIME-Version: 1.0
    Content-Transfer-Encoding: 7bit
    Content-Description: signature
    Content-Type: application/pgp-signature; name="signature.asc"; charset="us-ascii"

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

    iQIzBAABCgAdFiEEn+Ppw2aRpp/1PMaELHwxRsGgASEFAmYkU8UACgkQLHwxRsGg ASHaWQ/+PVRhuGMwpqmyJ0ZjpzQCT82ylmFOIO2wHOzo7d6tCLjSCSJJ6Zbez9zC VWwDGiGtfo1i1ipNgHIfxBRDYeD4sqa13IdcAfuIMJXCaS2ikewnpR+oojBGA+tW RDoKOVU9kf2qWqcoxxP/7rrvbwpGyCSelHqXOz8pZo4u+3xpSqo/AbkCPpWbv5YR /Wb6/bxuoHSefGJ51iBjyBeoXCNWafvrgPShOXHcDja+7Fo1dLfofhN+zRnehw+g giKSGN2M57dVoQLAvVPm9NJ5hsDBbXNtdWJI/6LYjuTAPAVjI/TcmWgBNLr51mQx qyueBBJKSINz6krpwR8xr3Ybu1SewUYOOxip+/GjcbVhHKROqIhF3UBV9OuPMsQ4 PXz4FyO592UiZPlYoNdhqHKY0z4vz9LWq8OpAcXQOw+xD61b9AN+0izBxbTdFw6A Uz8XUH6cSaBS+MjqkyXrzzZV+y4sFNgao9o98YqJ