Ticket #1146 (closed defect: fixed)
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@… |
Description
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}
To:
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) 2.18.50.20080109 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
Note: See
TracTickets for help on using
tickets.