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

GHC ghc-devs at haskell.org
Mon Mar 6 10:29:43 UTC 2017


#13366: addCStub doesn't allow control over compiler flags or source file file
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:  bitonic
            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 mboes):

 I'm not convinced there is any bug here. inline-c snippets really are
 stubs, and C ones at that, no different from the ones produced by the
 `capi` calling convention and foreign exports. So it makes sense to treat
 them as such. And even to include the inline-c snippets in the same stubs
 file as the other stubs, since any compiler options should apply equally
 to both.

 Now, should we furthermore support C++? I'm unconvinced that this should
 be done as part of `addCStub`. After all, C++ is an entirely separate
 language. It so happens that a large subset of C is included in C++, but
 that's incidental. In fact C++ is so different that name mangling is
 different, and not understood by GHC at all.

 So I think that if users want not just C stubs but also C++ stubs, that it
 makes sense to have `addCppStubs`, which ideally would take into account
 Cabal's `cpp-options`, just as `addCStubs` takes into account `cc-
 options`. And why not, in the future `addJavaStubs`, `addCsharpStubs` etc.

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


More information about the ghc-tickets mailing list