-
-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gcc-wrapper doesn't handle arguments specified in response files #11762
Comments
My guess is that something isn't quoted properly in the wrapper, as |
The new GHC version contains a patch [1] that passes linker and compiler flags to GCC via response files rather than directly on the command-line. This is supposed to be beneficial on Windows and other platforms that have trouble dealing with long argument lists. On NixOS, however, this feature breaks the flag handling provided by gcc-wrapper [2] and therefore causes the entire GHC build to fail. This issue has been reported upstream at [3]. It's not clear yet how to remedy this problem, but until we've figured that out we just don't pass compiler flags in response files on NixOS to fix #10752. [1] ghc/ghc@296bc70 [2] #11762 [3] https://ghc.haskell.org/trac/ghc/ticket/11147
So, the ghc issue was worked around but this issue itself probably lasts. (Correct me if I'm wrong.) |
Yes, I've patched |
The new GHC version contains a patch [1] that passes linker and compiler flags to GCC via response files rather than directly on the command-line. This is supposed to be beneficial on Windows and other platforms that have trouble dealing with long argument lists. On NixOS, however, this feature breaks the flag handling provided by gcc-wrapper [2] and therefore causes the entire GHC build to fail. This issue has been reported upstream at [3]. It's not clear yet how to remedy this problem, but until we've figured that out we just don't pass compiler flags in response files on NixOS to fix #10752. [1] ghc/ghc@296bc70 [2] #11762 [3] https://ghc.haskell.org/trac/ghc/ticket/11147 (cherry picked from commit a421e7b)
I just ran into this with one of my own projects. It's trivial for me to reproduce: test.rsp:
In the second case the RPATH is missing as you described. Before I get into fixing it, has anyone done any work on it? I'll probably just start with unpacking the response files into |
I am not aware of any attempts to fix this yet.
|
I tried building |
@peti It looks like arguments such as I'll see what I can do in cc-wrapper. Thanks |
NixOS#11762 has been fixed by NixOS@1ad1edb.
@corngood, Hydra is building the new code at http://hydra.nixos.org/jobset/nixpkgs/staging. Unfortunately, the |
It seems almost all the failures is just a failing guile test on i686-linux which I can't reproduce locally (probably appears randomly). |
Hmm, merging master to staging turned out to be a huge rebuild in itself :-/ so I squeezed in a stdenv rebuild. |
I can't say I know. |
It's fixed in 175461e, which doesn't seem to be merged to 16.09. |
I'll merge those fixes to |
Fixes NixOS#11762 (cherry picked from commit 1ad1edb)
Fixes NixOS#11762 (cherry picked from commit 1ad1edb)
The new GHC version contains a patch [1] that passes linker and compiler flags to GCC via response files rather than directly on the command-line. This is supposed to be beneficial on Windows and other platforms that have trouble dealing with long argument lists. On NixOS, however, this feature breaks the flag handling provided by gcc-wrapper [2] and therefore causes the entire GHC build to fail. This issue has been reported upstream at [3]. It's not clear yet how to remedy this problem, but until we've figured that out we just don't pass compiler flags in response files on NixOS to fix NixOS#10752. [1] ghc/ghc@296bc70 [2] NixOS#11762 [3] https://ghc.haskell.org/trac/ghc/ticket/11147 (cherry picked from commit a421e7b)
Fixes NixOS#11762 (cherry picked from commit 1ad1edb)
According to https://gcc.gnu.org/wiki/Response_Files,
gcc
reads for every argument of the form@path
the filepath
and inserts its contents in the command-line array as if those flags had been specified directly. This mechanism is supposed to be used to work around system limitations with regard to command-line length.The Haskell compiler GHC has picked up the habit of using those response files for all its linker arguments, and it's now broken on NixOS as a result, apparently because all kinds of "rpaths" are no longer provided correctly.
My theory is that before that patch, gcc-wrapper would catch the
-L/path/...
style arguments and handle them correctly, but now it no longer does, because those flags are hidden inside of a response file. Does that sound plausible?Cc: @vcunat
The text was updated successfully, but these errors were encountered: