#8976 closed bug (fixed)

dll-split: internal error: evacuate(static): strange closure type 0

Reported by: juhpetersen Owned by:
Priority: normal Milestone: 7.10.1
Component: Driver Version: 7.8.1
Keywords: Cc: mail@…, erikd
Operating System: Linux Architecture: arm
Type of failure: Building GHC failed Test Case:
Blocked By: Blocking:
Related Tickets: #9268 Differential Rev(s): Phab:D715
Wiki Page:


ghc-7.8.1 fails to build on Fedora ARM. This appears to be a regression compared to 7.8.1 RC2.

chmod +x                                                     inplace/bin/runghc
inplace/bin/dll-split compiler/stage2/build/.depend-v-dyn.haskell "DynFlags" "Annotations Avail Bag BasicTypes BinIface Binary Bitmap BlockId BooleanFormula BreakArray BufWrite BuildTyCl ByteCodeAsm ByteCodeInstr ByteCodeItbls CLabel Class CmdLineParser Cmm CmmCallConv CmmExpr CmmInfo CmmMachOp CmmNode CmmType CmmUtils CoAxiom ConLike CodeGen.Platform CodeGen.Platform.ARM CodeGen.Platform.NoRegs CodeGen.Platform.PPC CodeGen.Platform.PPC_Darwin CodeGen.Platform.SPARC CodeGen.Platform.X86 CodeGen.Platform.X86_64 Coercion Config Constants CoreArity CoreFVs CoreLint CoreSubst CoreSyn CoreTidy CoreUnfold CoreUtils CostCentre DataCon Demand Digraph DriverPhases DsMonad DynFlags Encoding ErrUtils Exception ExtsCompat46 FamInstEnv FastBool FastFunctions FastMutInt FastString FastTypes Finder Fingerprint FiniteMap ForeignCall Hooks Hoopl Hoopl.Dataflow HsBinds HsDecls HsDoc HsExpr HsImpExp HsLit HsPat HsSyn HsTypes HsUtils HscTypes IOEnv Id IdInfo IfaceEnv IfaceSyn IfaceType InstEnv InteractiveEvalTypes Kind ListSetOps Literal LoadIface Maybes MkCore MkGraph MkId Module MonadUtils Name NameEnv NameSet OccName OccurAnal OptCoercion OrdList Outputable PackageConfig Packages Pair Panic PatSyn PipelineMonad Platform PlatformConstants PprCmm PprCmmDecl PprCmmExpr PprCore PrelInfo PrelNames PrelRules Pretty PrimOp RdrName Reg RegClass Rules SMRep Serialized SrcLoc StaticFlags StgCmmArgRep StgCmmClosure StgCmmEnv StgCmmLayout StgCmmMonad StgCmmProf StgCmmTicky StgCmmUtils StgSyn Stream StringBuffer TcEvidence TcIface TcRnMonad TcRnTypes TcType TcTypeNats TrieMap TyCon Type TypeRep TysPrim TysWiredIn Unify UniqFM UniqSet UniqSupply Unique Util Var VarEnv VarSet"
dll-split: internal error: evacuate(static): strange closure type 0
    (GHC version 7.8.1 for arm_unknown_linux)
    Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
make[1]: *** [compiler/stage2/dll-split.stamp] Aborted

This is the bug report!

This happens on both Fedora 20 (current latest stable release) and 21 (in development). The build is against ghc-7.6.3 and llvm 3.3 and 3.4 respectively.

Attachments (1)

0001-Make-GHC-use-the-binutils-gold-linker-on-ARM.patch (3.4 KB) - added by erikd 11 months ago.
Updated version of patch

Download all attachments as: .zip

Change History (23)

comment:1 Changed 22 months ago by juhpetersen

  • Component changed from Compiler to Driver
  • Milestone set to 7.8.2

Karel pointed out this post by Ben on this topic: http://bgamari.github.io/posts/2014-03-06-compiling-ghc-7.8-on-arm.html (the short version being to use the gold linker).

Austin suspects it started happening after RC2 because of https://github.com/ghc/ghc/commit/abb86adf7f749b3d44887d28bc96b43c5a1e0631 which presumably started the ARM build using dynamic linking.

I guess it would be good to force the ARM build to use the gold linker for dyn linking, at least when the bfd linker is "broken".

comment:2 Changed 22 months ago by thoughtpolice

  • Milestone changed from 7.8.2 to 7.8.3

comment:3 Changed 21 months ago by nomeata

  • Cc mail@… added

comment:4 Changed 21 months ago by nomeata

Having this fixed in 7.8.3 would be greatly appreciated by Debian as well. Is Karel aware of this bug?

comment:5 Changed 20 months ago by thoughtpolice

  • Milestone changed from 7.8.3 to 7.8.4

Moving to 7.8.4.

comment:6 Changed 19 months ago by slomo

For allowing to build with gold, ticket #7452 has to be fixed too (includes patch)

After that it seems to be possible to build 7.8.3 with gold by setting CONF_GCC_LINKER_OPTS_STAGE1="-fuse-ld=gold" CONF_GCC_LINKER_OPTS_STAGE2="-fuse-ld=gold" and calling configure with --with-ld=ld.gold

This assumes that stage0 ghc works out of the box with its configured linker (e.g. the default system linker is still bfd, as is on Debian). And this also requires the patch from ticket #9336

I'm not 100% sure yet if the build will succeed, it's still running. But this brings us one step closer at least.

comment:7 Changed 19 months ago by slomo

It didn't work btw, still resulting in the same dll-split error. So although ld.gold was configured and gcc was told to use gold for stage1/stage2, and the "settings" file for everything contained these settings, something was still using bfd in the end. However whenever I checked which processes are running, it was something that would use gold.

Any ideas where to look? When changing /usr/bin/ld to ld.gold it should work, but that's not an option here.

comment:8 Changed 18 months ago by rwbarton

Maybe the same issue as #9268.

comment:9 Changed 18 months ago by rwbarton

#9268 is fixed in HEAD, can you try building that? You will probably need to use 7.6.3 as your bootstrapping compiler.

comment:10 Changed 16 months ago by thoughtpolice

  • Milestone changed from 7.8.4 to 7.10.1

Moving (in bulk) to 7.10.4

comment:11 Changed 14 months ago by erikd

  • Cc erikd added

comment:12 Changed 14 months ago by nomeata

I managed to build 7.8.4-rc1 by telling GHC to use gold as the linker. Unfortunately, this was not straight forward, as setting CONF_GCC_LINKER_OPTS_STAGE2 using this patch had knock-on-effects:

Index: ghc-
--- ghc-	2014-12-08 18:49:28.207171714 +0100
+++ ghc-	2014-12-08 19:03:06.815522917 +0100
@@ -553,6 +553,10 @@
         $3="$$3 -D_HPUX_SOURCE"
         $5="$$5 -D_HPUX_SOURCE"
+    arm*)
+        # On arm, link using gold
+        $3="$$3 -fuse-ld=gold"
+        ;;
     # If gcc knows about the stack protector, turn it off.

See #9873 for these problems and my (work-around-quality) patch.

I guess it would be good to force the ARM build to use the gold linker for dyn linking, at least when the bfd linker is "broken".

Probably yes.

comment:13 Changed 14 months ago by thoughtpolice

  • Milestone changed from 7.10.1 to 7.12.1

Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

Changed 11 months ago by erikd

Updated version of patch

comment:14 Changed 11 months ago by erikd

I've attached an updated version of the patch that I have tested on my own personal armhf build box.

comment:15 Changed 11 months ago by erikd

As @rwbarton pointed out in D715, ghc does not call ld directly, but cabal might (via the ld fields in the ghc settings file). Instead of setting ld command to /usr/bin/ld it should probably be set to /usr/bin/ld.gold and the cross compile issue has to be looked at as well.

comment:16 Changed 11 months ago by thomie

  • Differential Rev(s) set to Phab:D715

comment:17 Changed 11 months ago by erikd

The ld.gold linker seems to be the right thing to use when targeting Linux and android, but what about iOS? Should that just be left to use plain ld? Maybe @rwbarton knows.

comment:18 Changed 11 months ago by erikd

When target iOS, Apple has its own linker. ld.gold should only be used when targeting arm/linux and arm/android.

comment:19 Changed 11 months ago by Erik de Castro Lopo <erikd@…>

In 71fcc4c096ec0b575522e4c2d0104ef7a71a13c5/ghc:

Use the gold linker for linux/ARM and android/ARM targets.

Fixes #8976 and #9873 by making use of the Binutils ld.gold
linker explicit whenever the target is linux/ARM or android/ARM.
This does not affect iOS where Apple provides its own linker.

In order to achieve this, we need to add `-fuse-ld=gold` to
the SettingsCCompilerLinkFlags setting and set
SettingsLdCommand to `ld.gold` (or `${target}-ld.gold` when
cross-compiling). In addition, simplifying the use of

This patch was tested by ensuring that the following worked
as expected:

  * Native builds on linux/x86_64 (nothing changed).
  * Native builds on linux/arm (and uses the gold linker).
  * Linux to linux/arm cross compiles (and uses the cross
    gold linker).

Contributions by Ben Gamari, Joachim Breitner and Reid Barton.

Reviewers: nomeata, bgamari, austin, rwbarton

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D715

GHC Trac Issues: #8976 #9873

comment:20 Changed 11 months ago by erikd

  • Resolution set to fixed
  • Status changed from new to closed

comment:21 Changed 11 months ago by erikd

  • Status changed from closed to merge

comment:22 Changed 11 months ago by thoughtpolice

  • Milestone changed from 7.12.1 to 7.10.1
  • Status changed from merge to closed

These were merged into ghc-7.10, thanks Erik!

Note: See TracTickets for help on using tickets.