Opened 5 years ago

Closed 5 years ago

#3201 closed bug (fixed)

ar: Bad file number

Reported by: simonmar Owned by: simonmar
Priority: normal Milestone: 6.12.1
Component: Build System Version: 6.10.2
Keywords: Cc: asklingenberg@…
Operating System: Windows Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Satnam Singh reported to me that he gets

xargs: /c/ghc/ghc-6.10.1/bin/ar: Bad file number

when trying to build GHC on Windows using MSYS. Turning off SplitObjs works around it. We should verify and investigate.

Change History (4)

comment:1 Changed 5 years ago by Deewiant

Probably the same thing that I ran into with Gtk2hs: http://hackage.haskell.org/trac/gtk2hs/ticket/1146

Basicaly, MinGW's ar can't handle too many object files at once.

comment:2 Changed 5 years ago by asklinge

  • Cc asklingenberg@… added

I get the same error. It appears to me to be a problem with xargs that does not realize it overflows the Windows command line, and passes truncated file names to ar.

What I do to get GHC to build in MSYS is move /bin/xargs.exe to /bin/_xargs.exe and create an xargs shell script:

#!/bin/sh
_xargs -s 32767 $@

And it works with SplitObjs enabled. Quicker than editing multiple Makefiles, but it's a hack.

Maybe a solution is to set up a wrapper in the build system to call xargs in this fashion when building on MSYS?

comment:3 Changed 5 years ago by simonmar

  • Owner set to simonmar

comment:4 Changed 5 years ago by simonmar

  • Resolution set to fixed
  • Status changed from new to closed
Thu May 21 03:31:31 PDT 2009  Simon Marlow <marlowsd@gmail.com>
  * Fix #3201: "ar: Bad file number" build error with MSYS and SplitObjs=YES

Incedentally: 32767 didn't work for me, but 30000 did.

Note: See TracTickets for help on using tickets.