Making hadrian/ghci.sh work executing :main
However, if you try to invoke
:main on any file then you are greeted with a segfault.
If you try to turn on
-fexternal-interpreter you run into errors about missing symbols. The solution here is to add
.o files from
c-sources to the
hadrian/ghci.sh command line but then you can some confusing errors from the linker.
+ let context = vanillaContext Stage0 compiler + cSrcs' <- interpretInContext (vanillaContext Stage0 compiler) + (getContextData cSrcs) + cObjs <- mapM (objectPath context) cSrcs' + need cObjs + -- Find out the arguments that are needed to load a module into the -- session arg_list <- interpret fake_target getArgs - liftIO $ putStrLn (intercalate " " arg_list) + liftIO $ putStrLn (intercalate " " (arg_list ++ cObjs))
-fexternal-interpreter is fixed then the segfaults will also stop happening in the normal version.