Opened 9 years ago

Closed 9 years ago

#5043 closed bug (duplicate)

Compiling bytestring-mmap with -fvia-C yields broken .s file, two .size directives

Reported by: jeffwheeler Owned by:
Priority: normal Milestone: 7.2.1
Component: Compiler Version: 7.0.2
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Compile-time crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


I tried to install the bytestring-mmap package, which specifies in its cabal file the option -fvia-C (when this is removed, the package compiles fine).

I'm using GHC 7.0.2 (installed Haskell Platform recently) on x86_64 (Ubuntu 11.04). On my system, I can reliably reproduce with simply

$ cabal install bytestring-mmap-0.2.1

To get the .s file I attached, you need to unpack the package, edit the cabal file to include the GHC option -keep-tmp-files, and then cabal install there. The error shows the location of the .s file:

bytestring-mmap-0.2.1$ cabal install
Resolving dependencies...
Configuring bytestring-mmap-0.2.1...
Preprocessing library bytestring-mmap-0.2.1...
Building bytestring-mmap-0.2.1...
[1 of 3] Compiling System.IO.Posix.MMap.Internal ( System/IO/Posix/MMap/Internal.hs, dist/build/System/IO/Posix/MMap/Internal.o )
/tmp/ghc1834_0/ghc1834_0.s: Assembler messages:

     Error: .size expression for __stginit_bytestringzmmmapzm0zi2zi1_SystemziIOziPosixziMMapziInternal does not evaluate to a constant
cabal: Error: some packages failed to install:
bytestring-mmap-0.2.1 failed during the building phase. The exception was:
ExitFailure 1

Attachments (1)

ghc2408_0.s (18.4 KB) - added by jeffwheeler 9 years ago.
broken .s file

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by jeffwheeler

Attachment: ghc2408_0.s added

broken .s file

comment:1 Changed 9 years ago by josh

Same problem here with ghc 7.0.2 and curl-1.3.6

comment:2 Changed 9 years ago by josh

Downgrading to binutils 2.20 works around this issue. binutils 2.21 added checking for .size directives.

comment:3 Changed 9 years ago by simonmar

Milestone: 7.2.1

Yes, that does look a bit bogus. -fvia-C is deprecated, but we need to either fix the bug or disable it.

comment:4 Changed 9 years ago by igloo

Resolution: duplicate
Status: newclosed

I'll close this as a duplicate of #5050, which includes a minimal testcase.

Note: See TracTickets for help on using tickets.