Ticket #1146 (closed defect: fixed)

Opened 9 years ago

Last modified 8 years ago

Linking split-objs fails with "xargs: /mingw/bin/ar: Bad file number"

Reported by: guest Owned by: duncan
Priority: normal Milestone:
Component: build system Version: 0.9.13
Keywords: Cc: matti.niemenmaa+gtk2hsbugs@…


link-splitobjs.sh fails with the error "xargs: /mingw/bin/ar: Bad file number". It seems that the MinGW ar can only handle a limited number of objects at a time, and getting several hundreds at once causes it to error in such a way.

This is simple to fix, just change the line in link-splitobjs.sh.in:

cat ${lib}.list | xargs @AR@ q ${lib}


cat ${lib}.list | xargs --max-args=100 @AR@ q ${lib}

I'm not sure if there's a way of finding out the maximum number that can be given easily, 100 worked fine. ar --version is GNU ar (GNU Binutils) in case that makes a difference.

Relevant make output:

rm -f libHSglib.a
./mk/link-splitobjs.sh libHSglib.a glib/System/Glib.o glib/System/Glib/FFI.o glib/System/Glib/UTFString.o glib/System/Glib/Types.o glib/System/Glib/GType.o glib/System/Glib/GTypeConstants.o glib/System/Glib/GValue.o glib/System/Glib/GValueTypes.o glib/System/Glib/GParameter.o glib/System/Glib/StoreValue.o glib/System/Glib/GObject.o glib/System/Glib/Properties.o glib/System/Glib/Attributes.o glib/System/Glib/GError.o glib/System/Glib/GList.o glib/System/Glib/Signals.o glib/System/Glib/Flags.o glib/System/Glib/MainLoop.o glib/System/Glib/GDateTime.o glib/System/Glib/hsgclosure.o glib/System/Glib/GObject_stub.o glib/System/Glib/MainLoop_stub.o 
Linking libHSglib.a, for larger libs this can take quite some time...
xargs: /mingw/bin/ar: Bad file number
ranlib libHSglib.a
D:\Progging\mingw\bin\ranlib.exe: 'libHSglib.a': No such file
make[1]: *** [libHSglib.a] Error 1

Change History

Changed 9 years ago by guest

  • owner changed from somebody to duncan
  • component changed from general (Gtk+, Glib) to build system

Changed 9 years ago by Alvaro

If you do the job badly enough, sometimes you don't get asked to do it

again. -- Calvin acquista viagra farmacia online generic fioricet cialis prezzo tramadol buy cheap

Changed 8 years ago by pgavin

  • status changed from new to closed
  • resolution set to fixed


Note: See TracTickets for help on using tickets.