Ticket #5050 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

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 Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by igloo) (diff)

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:

  /tmp/ghc4532_0/ghc4532_0.s:73:0:
       Error: .size expression does not evaluate to a constant

[0]  http://lists.debian.org/debian-haskell/2011/03/msg00088.html

Attachments

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

Change History

Changed 2 years ago by laney

Changed 2 years ago by laney

  • cc laney@… added

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

Changed 2 years ago by igloo

  • description modified (diff)

Changed 2 years ago by igloo

  • priority changed from normal to high
  • milestone set to 7.2.1

Thanks for the report.

See also #5043.

Changed 2 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

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

Changed 2 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.