[GHC] #13366: addCStub doesn't allow control over compiler flags or source file file

GHC ghc-devs at haskell.org
Fri Mar 3 13:50:51 UTC 2017


#13366: addCStub doesn't allow control over compiler flags or source file file
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.2.1
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by facundo.dominguez):

 In the current implementation all stubs go into the same file as the C
 stubs.

 This means that multiple calls of `addCStub` have visibility of the the
 definitions that have been inserted earlier (actually I'm not sure of the
 order but this could be arranged).

 We could send each stub to a different file certainly. And ask for forward
 declarations.

 > Moreover, you can't have mixed C/C++ stubs at all.

 Not even doing
 {{{
 addCStub "extern \"C\" { ... }"
 }}}
 ?

 BTW, what's wrong with using `-optc`?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13366#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list