GHC HEAD now needs extra tools to build libffi?

Joachim Breitner mail at joachim-breitner.de
Mon Oct 23 12:45:36 UTC 2017


Hi,

JFTR, upgrading the Arch installation, including ghc to 8.2.1, fixes
the issue for perf.haskell.org.

Greetings,
Joachim

Am Donnerstag, den 19.10.2017, 16:28 +0800 schrieb Moritz Angermann:
> Hi,
> 
> As it turns out this might be linker madness. I do not yet understand why this did work with
> the "old" libffi though.
> 
> The command that fails is a rather long gcc invocation asking it to link a bunch of libraries together.
> 
> $ gcc -fno-stack-protector -DTABLES_NEXT_TO_CODE '-fuse-ld=gold' [...] -lHSghci-8.3-ghc8.3.20171018 [...] -lffi [...]
> 
> From the error message, we know taht ghci depends on libffi. E.g.
> 
> > libHSghci-8.3-ghc8.3.20171018.so: error: undefined reference to 'ffi_prep_cif'
> 
> Now there are two possible configurations that do (successfully) link on my test machine:
> 
> 1.) Droppping `-fuse-ld=gold`.
> 2.) Moving `-lffi` prior to `-lHSghci-8.3-ghc8.3.20171018`.
> 
> I guess we could also add the libffi symbols the the other -Wl,-u,... symbols.
> 
> Obviously I would not see this on macOS, as there is no go.ld on macOS. On my ubuntu system, gold is
> > GNU gold (GNU Binutils for Ubuntu 2.27) 1.12
> 
> Again, as I stated in the beginning, I fail to understand why this should related to the new libffi version.
> 
> As such running `LD=ld ./configure && make -j` does indeed complete successfully on my machine.
> 
> If someone has any idea what the core issue between the libffi update and these build failures is, I'd be happy
> to know!
> 
> Cheers,
>  Moritz
> 
> > On Oct 18, 2017, at 11:38 PM, Joachim Breitner <mail at joachim-breitner.de> wrote:
> > 
> > Hi,
> > 
> > it’s an Arch linux (generously sponsored by Richard’s university). I
> > have not idea how to give more precise information about the distro
> > release version or such :-)
> > 
> > Greetings,
> > Joachim
> > 
> > Am Mittwoch, den 18.10.2017, 22:02 +0800 schrieb Moritz Angermann:
> > > Hi,
> > > 
> > > so this somehow looks like for a not yet absolutely clear reason to me,
> > > when building ghci, we fail to link in libffi, for some configurations.
> > > 
> > > Joachim, as far as I could see, you are using ghc 8.0.1 to boostrap the
> > > compiler. Thomas are you by any chance bootstrapping with 8.0.1 as well?
> > > I assume Ben bootstraps wit 8.2.1.
> > > 
> > > I'll set up a Ubuntu 16.10 machine tomorrow and try to reproduce this.
> > > 
> > > Joachim, is perf.haskell.org running Ubuntu as well?
> > > 
> > > Cheers,
> > > Moritz
> > > 
> > > > On Oct 11, 2017, at 1:43 AM, Thomas Jakway <tjakway at nyu.edu> wrote:
> > > > 
> > > > Thanks for getting back to me.
> > > > 
> > > > (I think you mean `git clean -x -f -d`): I usually omit -x but I'll give it a go and report back.
> > > > 
> > > > Before I got the issue on a clean checkout I thought it was something I did to the build files.
> > > > 
> > > > I also tried building the latest release of libffi (v3.2.1) and using it in configure with --with-ffi-includes and --with-ffi-libraries but got the same error.
> > > > 
> > > > 
> > > > On 10/09/2017 02:40 AM, Moritz Angermann wrote:
> > > > > Yes, this commit indeed introduced the need for makeinfo, however after some debugging and improved packaging of the external libffi library, this dependency was removed again, and should not be required with the latest head anymore.
> > > > > 
> > > > > Then again this should not result in link issues but rather in build time issues.
> > > > > 
> > > > > The key to libffi is the libffi-tarballs git submodule, which contains the packaged libffi-tarballs. Make sure all your submodules are also updated.
> > > > > 
> > > > > I usually use `git -x -f -d` (read the documentation first) to ensure a clean working tree. Especially as you say you can’t reproduce it on other machines, maybe there is a file in your tree that the cleaning did not catch?
> > > > > 
> > > > > Sent from my iPhone
> > > > > 
> > > > > > On 9 Oct 2017, at 4:31 AM, Thomas Jakway <tjakway at nyu.edu> wrote:
> > > > > > 
> > > > > > I'm on Ubuntu 16.10.
> > > > > > 
> > > > > > I ran git bisect:
> > > > > > 
> > > > > > ----------------------
> > > > > > 
> > > > > > e515c7f37be97e1c2ccc497ddd0a730e63ddfa82 is the first bad commit
> > > > > > commit e515c7f37be97e1c2ccc497ddd0a730e63ddfa82
> > > > > > Author: Moritz Angermann <moritz.angermann at gmail.com>
> > > > > > Date:   Sat Sep 30 09:31:12 2017 -0400
> > > > > > 
> > > > > > Allow libffi snapshots
> > > > > > 
> > > > > > This is rather annoying. I'd prefer to have a stable release to
> > > > > > use. However libffi-3.2.1 has been released November 12, 2014, and
> > > > > > libffi-4 is TBD. See also https://github.com/libffi/libffi/issues/296
> > > > > > 
> > > > > > The core reason for this change is that llvm changed the supported
> > > > > > assembly to unified syntax, which libffi-3.2.1 does not use, and hence
> > > > > > fails to compile for arm with llvm. For refence, see the following
> > > > > > issue: https://github.com/libffi/libffi/issues/191.
> > > > > > 
> > > > > > This diff contains a script to generate a tarball for the
> > > > > > `libffi-tarballs` repository from the libffi GitHub repository; as well
> > > > > > as the necessary changes to the build system.
> > > > > > 
> > > > > > Updates libffi-tarballs submodule.
> > > > > > 
> > > > > > Reviewers: austin, bgamari, hvr
> > > > > > 
> > > > > > Subscribers: hvr, erikd, rwbarton, thomie
> > > > > > 
> > > > > > Differential Revision: https://phabricator.haskell.org/D3574
> > > > > > 
> > > > > > ----------------------
> > > > > > 
> > > > > > I can't reproduce it on my other linux computers though.
> > > > > > 
> > > > > > 
> > > > > > > On 10/04/2017 02:17 PM, Ben Gamari wrote:
> > > > > > > Thomas Jakway <tjakway at nyu.edu> writes:
> > > > > > > 
> > > > > > > > Anyone else getting linker errors?
> > > > > > > > 
> > > > > > > > This is after running
> > > > > > > > 
> > > > > > > > make clean && make distclean && find . -name "*.o" -type f -delete &&
> > > > > > > > find . -name "*.hi" -type f -delete
> > > > > > > > 
> > > > > > > > then
> > > > > > > > 
> > > > > > > > ./boot && ./configure && make -j5
> > > > > > > > 
> > > > > > > > (ghc-new is not a new checkout, this error is happening on a branch I'm
> > > > > > > > working on, but one that doesn't touch the FFI)
> > > > > > > > 
> > > > > > > 
> > > > > > > I'm afraid I can't reproduce this. What platform/operating system is
> > > > > > > this on?
> > > > > > > 
> > > > > > > Cheers,
> > > > > > > 
> > > > > > > - Ben
> > > > > > 
> > > > > > _______________________________________________
> > > > > > ghc-devs mailing list
> > > > > > ghc-devs at haskell.org
> > > > > > http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
> > > > 
> > > > _______________________________________________
> > > > ghc-devs mailing list
> > > > ghc-devs at haskell.org
> > > > http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
> > > 
> > > 
> > 
> > -- 
> > Joachim Breitner
> >  mail at joachim-breitner.de
> >  http://www.joachim-breitner.de/
> > _______________________________________________
> > ghc-devs mailing list
> > ghc-devs at haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
> 
> ————————————————— 
> Moritz Angermann
> +49 170 54 33 0 74
> moritz at lichtzwerge.de
> 
> lichtzwerge GmbH
> Raiffeisenstr. 8
> 93185 Michelsneukirchen
> 
> Amtsgericht Regensburg HRB 14723
> Geschäftsführung: Moritz Angermann, Ralf Sangl
> USt-Id: DE291948767
> 
> Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
> Informationen. Wenn Sie nicht der richtige Adressat sind oder diese
> E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den
> Absender und vernichten Sie diese Mail.
> Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail
> ist nicht gestattet.
> This e-mail may contain confidential and/or privileged information.
> If you are not the intended recipient (or have received this e-mail in
> error) please notify the sender immediately and destroy this e-mail.
> Any unauthorized copying, disclosure or distribution of the material in
> this e-mail is strictly forbidden.
> 
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
-- 
Joachim “nomeata” Breitner
  mail at joachim-breitner.de
  https://www.joachim-breitner.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20171023/ffd4bbe1/attachment.sig>


More information about the ghc-devs mailing list