Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#5050 closed bug (fixed)

Produces invalid assembly when using `peek' and -fvia-c with new binutils on amd64

Reported by: laney Owned by:
Priority: high Milestone: 7.2.1
Component: Compiler (FFI) Version: 7.0.2
Keywords: Cc: debian-haskell@…, laney@…
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Other Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by igloo)

I noticed this when rebuilding happstack-util on Ubuntu. A mail sent to debian-haskell can be found at [0], but I've since produced a minimal test case, attached. To reproduce this you need a new binutils (the ones in Debian unstable and Ubuntu Natty are sufficient to trigger the bug).

When using peek from Foreign.Storable and compiling via C, GHC produces code which generates invalid assembly:

  [1 of 1] Compiling Break            ( break.hs, break.o )
  /tmp/ghc4532_0/ghc4532_0.s: Assembler messages:

       Error: .size expression does not evaluate to a constant


Attachments (1)

break.hs (147 bytes) - added by laney 9 years ago.

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by laney

Attachment: break.hs added

comment:1 Changed 9 years ago by laney

Cc: laney@… added

I forgot to explicitly mention that this works on i386 but not on amd64.

comment:2 Changed 9 years ago by igloo

Description: modified (diff)

comment:3 Changed 9 years ago by igloo

Milestone: 7.2.1
Priority: normalhigh

Thanks for the report.

See also #5043.

comment:4 Changed 9 years ago by igloo

Resolution: fixed
Status: newclosed

This is now "fixed", by turning -fvia-c into a no-op.

comment:5 Changed 9 years ago by simonmar

We should also mention that the workaround for 7.0.3 and earlier is to not use -fvia-C.

Note: See TracTickets for help on using tickets.