Opened 11 months ago

Last modified 2 months ago

#8976 new bug

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

Reported by: juhpetersen Owned by:
Priority: normal Milestone: 7.12.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 Revisions:

Description

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.

Change History (13)

comment:1 Changed 11 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 11 months ago by thoughtpolice

  • Milestone changed from 7.8.2 to 7.8.3

comment:3 Changed 10 months ago by nomeata

  • Cc mail@… added

comment:4 Changed 10 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 9 months ago by thoughtpolice

  • Milestone changed from 7.8.3 to 7.8.4

Moving to 7.8.4.

comment:6 Changed 8 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 7 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 7 months ago by rwbarton

Maybe the same issue as #9268.

comment:9 Changed 7 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 5 months ago by thoughtpolice

  • Milestone changed from 7.8.4 to 7.10.1

Moving (in bulk) to 7.10.4

comment:11 Changed 3 months ago by erikd

  • Cc erikd added

comment:12 Changed 3 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-7.8.3.20141119/aclocal.m4
===================================================================
--- ghc-7.8.3.20141119.orig/aclocal.m4	2014-12-08 18:49:28.207171714 +0100
+++ ghc-7.8.3.20141119/aclocal.m4	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"
+        ;;
     esac
 
     # 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 2 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.

Note: See TracTickets for help on using tickets.