[GHC] #13366: addCStub doesn't allow control over compiler flags or source file file
GHC
ghc-devs at haskell.org
Thu Mar 8 13:55:46 UTC 2018
#13366: addCStub doesn't allow control over compiler flags or source file file
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner: (none)
Type: feature request | Status: closed
Priority: high | Milestone: 8.2.1
Component: Compiler | Version: 8.0.1
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D3280
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by alpmestan):
The `T13366` test fails on master from yesterday, when executed with the
`ghci` way:
{{{
=====> T13366(ghci) 1 of 1 [0, 0, 0]
cd "./th/T13366.run" && "/home/alp/ghc/inplace/test spaces/ghc-stage2"
T13366.hs -dcore-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-
missed-specialisations -fshow-warning-groups -fdiagnostics-color=never
-fno-diagnostics-show-caret -dno-debug-output -XTemplateHaskell -package
template-haskell --interactive -v0 -ignore-dot-ghci -fno-ghci-history +RTS
-I0.1 -RTS -lstdc++ -v0< T13366.genscript
Actual stderr output differs from expected:
diff -uw "/dev/null" "./th/T13366.run/T13366.run.stderr.normalised"
--- /dev/null 2018-03-07 13:03:27.344000000 +0100
+++ ./th/T13366.run/T13366.run.stderr.normalised 2018-03-08
14:49:20.583965000 +0100
@@ -0,0 +1,13 @@
+ghc: ^^ Could not load 'fcxx', dependency unresolved. See top entry
above.
+
+
+ByteCodeLink: can't find label
+During interactive linking, GHCi couldn't find the following symbol:
+ fcxx
+This may be due to you not asking GHCi to load extra object files,
+archives or DLLs needed by your current session. Restart GHCi,
specifying
+the missing library using the -L/path/to/object/dir and -lmissinglibname
+flags, or simply by naming the relevant files on the GHCi command line.
+Alternatively, this link failure might indicate a bug in GHCi.
+If you suspect the latter, please send a bug report to:
+ glasgow-haskell-bugs at haskell.org
*** unexpected failure for T13366(ghci)
}}}
where the aforementionned symbol is defined in a snippet of C++ code that
TH adds to the build through `addForeignFile`:
{{{#!hs
foreign import ccall fcxx :: Int -> IO Int
do addForeignFile LangCxx $ unlines
[ "#include <iostream>"
, "extern \"C\" {"
, " int fcxx(int x) {"
, " std::cout << \"calling fcxx(\" << x << \")\" << std::endl;"
, " std::cout.flush();"
, " return A_MACRO + x;"
, " }"
, "}"
]
return []
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13366#comment:14>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list