Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,319
    • Issues 4,319
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 368
    • Merge Requests 368
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #14708

Closed
Open
Opened Jan 23, 2018 by tchajed@trac-tchajed

GHC panics when linking with an archive and using an annotation

GHC panics when compiling code with an annotation and linking with an archive (a .a file). I think this is the same as #9438, but I have a really simple test case consisting of the following two files:

// add.c
int add2(int x, int y) { return x + y; }
-- app.hs
{-# ANN module () #-}

main :: IO ()
main = return ()

First I make an archive:

$ gcc -c add.c -o add.o
$ ar libadd.a add.o

And then the following fails:

$ ghc -ladd -L. app.hs
[1 of 1] Compiling Main             ( app.hs, app.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 8.2.2 for x86_64-apple-darwin):
	Loading archives not supported

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

make: *** [app] Error 1

The attached tar.gz has these source files and a Makefile to run the above. I've tested it on OS X 10.11 and Linux, both with GHC 8.2.2, and the behavior is the same.

Trac metadata
Trac field Value
Version 8.2.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#14708