Opened 17 months ago

Last modified 5 months ago

#8596 new feature request

Add support for "reponse files" to workaround Windows command line length limitations

Reported by: joeyhess Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.6.3
Keywords: Cc:
Operating System: Windows Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

I have a program (git-annex) which builds successfully on windows, but when I enable any of three optional features which pull in some additional libraries, it fails to link.

I will attach the output of cabal build --ghc-options=-v for a failing and a successful build.

I hypothesize this is due to a command line length limit. The final failing gcc link command is 43814 characters, vs 30765 in the configuration that succeeds. Right around the 32k boundry.

Not sure what I can do to work around this, short of splitting up my program into standalone libraries which will link without referencing every individual module?

Attachments (2)

log.failed-with-webapp (95.4 KB) - added by joeyhess 17 months ago.
failed link
log.nowebapp (75.8 KB) - added by joeyhess 17 months ago.
successful link

Download all attachments as: .zip

Change History (6)

Changed 17 months ago by joeyhess

failed link

Changed 17 months ago by joeyhess

successful link

comment:1 Changed 17 months ago by refold

gcc has a feature called response files that allows to work around this problem.

comment:2 Changed 17 months ago by joeyhess

Thanks, that's really helpful.

Is there any interface in ghc to use response files? If not, please consider this a feature request. ;)

comment:3 Changed 17 months ago by joeyhess

I have verified that I can use response files to link my program. Currently generating the file from ghc -v output:

cabal build --ghc-options='-v -keep-tmp-files' > build.log 2>&1
grep '"dist
build
git-annex
git-annex.exe"' build.log | sed -e 's/"["]*" ' -e 's/
/\
g' > gcc.opt
gcc @gcc.opt

Refold probably saved me weeks of refactoring into libraries.

Version 0, edited 17 months ago by joeyhess (next)

comment:4 Changed 5 months ago by thomie

  • Architecture changed from x86 to Unknown/Multiple
  • Summary changed from windows link failure due to excessively long gcc commad line "Unable to start C:\Program Files\Haskell + Platform\2013.2.0.0\mingw\bin/realgcc.exe (error code: 87)" to Add support for "reponse files" to workaround Windows command line length limitations
  • Type changed from bug to feature request
Note: See TracTickets for help on using tickets.