Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 5.5k
    • Issues 5.5k
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 638
    • Merge requests 638
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Model experiments
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #10687

Clang 3.6 fails with -g due to .file directive order

On Mac Os X, compiling with -g will sometimes fail with an error like follows:

/var/folders/yt/bmbchswn57nbmz1l67btd6p00000gn/T/ghc27418_0/ghc_1.s:6573:7: error:
     error: unassigned file number in '.loc' directive
            .loc 7 106 17 /* cast */
                 ^
 }}}

Which refers to the following code:
{{{
[...]
	.file 7 "libraries/base/Data/Typeable.hs"
	.file 6 "libraries/ghc-prim/GHC/Classes.hs"
[...]
	.loc 7 106 17 /* cast */

So the file number is clearly assigned, we are just not assigning them "in order". This is okay for most compilers, but Clang 3.6 seems to disagree. The attached patch changes the code so .file directives are always generated in order.

Could try to produce a testcase if required - it would be rather easy to check that .file directives appear in order in a given assembly file.

Trac metadata
Trac field Value
Version 7.10.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking