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

GCC called from GHC cannot find generated file

我有一个项目使用 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文件?

ghc 使用 response files to work around windows limitations on path length. The at sign syntax is part of how response files work。但是,似乎(请参阅第二个 link)响应文件支持已添加到 gcc,紧随您使用的旧版 gcc 之后。因此,虽然这确定了问题的根源,但我恐怕没有想到如何解决它的特别好的答案:-/。