[Haskell-cafe] trouble installing ghc 6.6: xargs: /usr/bin/ar: terminated by signal 11

Simon Peyton-Jones simonpj at microsoft.com
Mon Jan 8 06:07:53 EST 2007

I've added this useful response to the GHC Building FAQ, here

Please continue to add material to this page.


| -----Original Message-----
| From: haskell-cafe-bounces at haskell.org [mailto:haskell-cafe-bounces at haskell.org] On Behalf Of Duncan
| Coutts
| Sent: 07 January 2007 13:38
| To: tphyahoo
| Cc: haskell-cafe at haskell.org
| Subject: Re: [Haskell-cafe] trouble installing ghc 6.6: xargs: /usr/bin/ar: terminated by signal 11
| On Sat, 2007-01-06 at 15:30 -0800, tphyahoo wrote:
| > I'm having trouble installing ghc 6.6. On ubuntu, virtual server (user mode
| > linux).
| >
| > Something seems to be killing the process, no idea why.
| >
| > Anyone seen this?
| Yes.
| > /usr/bin/ar: creating libHSbase.a
| > xargs: /usr/bin/ar: terminated by signal 11
| What is happening is that the ghc build system is linking thousands and
| thousands of tiny .o files into libHSbase.a. GNU ar isn't optimised for
| this use-case and it takes far more memory than it really needs to. So
| what happens is that ar takes >500Mb of memory and your virtual
| machine / virtual server probably isn't configured with that much memory
| and so the linux kernel OOM killer terminates the ar process.
| To make this worse, since there are so many .o files, it takes several
| invocations of ar to link them all. On each invocation ar is building
| the symbol index (-q is ignored) and this is what takes the most time
| and memory. It's a good deal quicker to use a custom program (100 lines
| of Haskell) to build libHSbase.a and then use ranlib just once to build
| the symbol index.
| I submitted a patch to gnu binutils to make ar take less memory when
| linking 1000's of files so it now only takes around 100Mb rather than
| 500Mb when linking libHSbase.a. That patch is included in version 2.17 I
| think (in other words most systems don't have it yet).
| What you can do in the mean time is either configure your virtual
| machine with more memory or turn off the split-objs feature when you
| configure ghc. Just add SplitObjs=NO" to your mk/build.mk file (which
| may not exist to start with). (The Gentoo ebuild does this
| automatically)
| Duncan
| _______________________________________________
| Haskell-Cafe mailing list
| Haskell-Cafe at haskell.org
| http://www.haskell.org/mailman/listinfo/haskell-cafe

More information about the Haskell-Cafe mailing list