GCC从GHC调用无法找到生成的文件

时间:2016-03-14 17:59:36

标签: haskell gcc ghc ffi

我有一个使用FFI与某些C ++代码交互的项目。我将GHC升级到7.10.3,现在该项目不再编译。

我必须使用一个非常古老的gcc(3.3.6)并用这一行调用它:

ghc ${DEFINES}  ${INCLUDES} ${LIBDIRS} -pgmc /opt/gcc-3.3.6/bin/gcc MISCconfigTest.hs csrc/MISCconfig_c.cpp ${LIBRARIES}

自ghc升级以来,引发了以下错误:

gcc: @/tmp/ghc19542_0/ghc_2.rsp: No such file or directory

有人知道出了什么问题吗?

修改

这是ghc -v3的输出:

Hsc static flags: 
Created temporary directory: /tmp/ghc29748_0
*** C Compiler:
/opt/gcc-3.3.6/bin/gcc -D__OMNIORB4__ -D__x86__ -D__linux__ '-D__OSVERSION__=2' -DS2K_NAMESPACE -DUSE_NESTED_TEMPLATES -DIL_STD -D_REENTRANT -DS2K_LINUX -DUSE_STD_ALLOCATORS -DREDEFINE_STRING -DTCL_THREADS -x 'c++' csrc/MISCconfig_c.cpp -o /tmp/ghc29748_0/ghc_1.s -S '-D__GLASGOW_HASKELL__=710' -include /home/oswald/ghcs/ghc-7.10.3/lib/ghc-7.10.3/include/ghcversion.h -I/development/GECCOS_MUM/RELEASE3.1_W-03/core-stl-rep/include -I/development/GECCOS_MUM/RELEASE3.1_W-03/core-utilities-rep/include -I/development/GECCOS_MUM/RELEASE3.1_W-03/core-comm-rep/include -I/development/GECCOS_MUM/RELEASE3.1_W-03/model-cpd-rep/include -I/opt/omniORB-4.1.0/include/omniORB4 -I/opt/omniORB-4.1.0/include -I/development/GECCOS_MUM/RELEASE3.1_W-03/_generated -I/development/GECCOS_MUM/RELEASE3.1_W-03/../COTS/core-build-rep/include -I/home/oswald/ghcs/ghc-7.10.3/lib/ghc-7.10.3/base_HQfYBxpPvuw8OunzQu6JGM/include -I/home/oswald/ghcs/ghc-7.10.3/lib/ghc-7.10.3/integ_2aU3IZNMF9a7mQ0OzsZ0dS/include -I/home/oswald/ghcs/ghc-7.10.3/lib/ghc-7.10.3/include
gcc: @/tmp/ghc29748_0/ghc_2.rsp: No such file or directory
gcc: no input files
*** Deleting temp files:
Deleting: /tmp/ghc29748_0/ghc_2.rsp /tmp/ghc29748_0/ghc_1.s
Warning: deleting non-existent /tmp/ghc29748_0/ghc_1.s
*** Deleting temp dirs:
Deleting: /tmp/ghc29748_0
make: *** [MISCconfig] Error 1

我不知道ghc生成的中间文件的结构,但是看起来gcc获取了一个临时的.s文件并且里面引用了.rsp文件?

1 个答案:

答案 0 :(得分:0)

ghc使用response files来解决路径长度上的窗口限制。 at符号语法是how response files work的一部分。但是,在您使用的旧版本gcc之后,似乎(请参阅第二个链接)已将响应文件支持添加到gcc。因此,虽然这会解决问题的根源,但我担心没有特别好的答案会让人想起如何解决它: - /。