Sunday, 2 July 2017

Re: [ubuntu/artful-proposed] ghc 8.0.2-5ubuntu2 (Accepted)

Hello Matthias,
>sorry, I can't parse this changelog entry. The 8.0.2-5ubuntu1 upload tried to
>link using the BFD linker by changing the debian/rules file, however the build
>ended up still using the gold linker. So why do you write "BFD is not really
>suitable", if the ubuntu1 upload still used the gold linker? Is there any
>evidence that the BFD linker is not suitable for arm64? Plus I didn't change
>anything about armhf, but you are writing about arm*. Why? Sorry, but this
>upload doesn't help anything.

lets make the things clear, sorry for that:
1) I failed to parse the >1MB changelog, I usually search for "error:" and I found them
really before the previous build log, so I thought that using BFD just made thing worse.
Lines like:

/tmp/ghc824e_0/ghc_54.hc:22:1: error:
warning: label '_c8bQ' defined but not used [-Wunused-label]

really confused me.

anyway, back in 2012, 2013, 2014 and so on, we tried a *lot* to use BFD linker
and we failed always, it is not able to work with ghc, and the situation didn't improve over
time (I have to be honest, I don't remember when I tried this last time).

You can even see the arm64 failures, that stopped when we switched to gold linker (back in the
days arm64 has been bootstrapped)

I'm talking about:
* Try using on arm.
* Try using on arm, using -optc-B/usr/bin/
* Pass -fuse-ld=gold to gcc when used as alinker on arm
(patches/use-gold-on-arm) and make sure this setting does not affect other
parts (patches/saner-linker-opt-handling).
* Use on arm64 and enable GHCi. Thanks to Edmund Grimley Evans for
digging up the relevant upstream patches, and for Erik de Castro Lopo for
writing them in the first place. Closes: #783987

I don't remember the whole amount of work that has been done, and probably binutils
improved in the last releases, but I'm pretty sure gold for now is the only option
for arm*.

Anyhow, I did a quick patch, and uploaded in my ppa, I'm not sure if the patch is correct,
but it should force bfd on arm64 this time, with something like:
--- ghc-8.0.2.orig/aclocal.m4
+++ ghc-8.0.2/aclocal.m4
@@ -594,7 +594,7 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
# On aarch64/linux and aarch64/android, tell gcc to link using the
# gold linker.
# Forcing LD to be is done in FIND_LD m4 macro.
- $3="$$3 -fuse-ld=gold -Wl,-z,noexecstack"
+ $3="$$3 -fuse-ld=bfd -Wl,-z,noexecstack"
$4="$$4 -z noexecstack"

lets see how it goes :)

also here the documentation never mentioned bfd


ubuntu-devel mailing list
[email protected]
Modify settings or unsubscribe at: