I'm trying to build Stepmania (https://github.com/stepmania/stepmania @ master[a09e3477]) on OSX 10.10 with Xcode 6.0.1. Others have successfully done so on OSX 10.10, though because of the merge date, it would have had to have been on an earlier version of the Xcode command line tools than were released yesterday that I am using.
At the end of the Xcode build, the linking step fails:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -L/Users/nilbus/stepmania -L/Users/nilbus/stepmania/Xcode/build/Debug -L/Users/nilbus/stepmania/Xcode/Libraries -L/Users/nilbus/stepmania/Xcode/../extern/mad-0.15.1b/msvc++/Release -L/Users/nilbus/stepmania/Xcode/ffmpeg -L/Users/nilbus/stepmania/Xcode/ffmpeg/lib -F/Users/nilbus/stepmania -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks -filelist /Users/nilbus/stepmania/Xcode/build/stepmania.build/Debug/stepmania.build/Objects-normal/i386/StepMania\ (Debug).LinkFileList -mmacosx-version-min=10.6 -dead_strip -no_dead_strip_inits_and_terms -lbz2 -fobjc-link-runtime -framework Accelerate -framework Cocoa -framework Carbon -framework IOKit -framework QuickTime -framework OpenGL -framework CoreFoundation -framework AudioToolbox -framework AudioUnit -framework CoreAudio -framework vecLib -logg_link -ltheora_link -lvorbis_link -llua-5.1-sm5 -ltomcrypt-sm5 -ltommath-sm5 -lz_link -lmad-sm5 -lpng-1.5.1-sm5 -lglew-sm5 -lpcre-sm5 -ljpeg-sm5 -lavcodec -lavdevice -lavfilter -lavformat -lavutil -lswresample -lswscale -Xlinker -dependency_info -Xlinker /Users/nilbus/stepmania/Xcode/build/stepmania.build/Debug/stepmania.build/Objects-normal/i386/StepMania\ (Debug)_dependency_info.dat -o /Users/nilbus/stepmania/StepMania\ (Debug).app/Contents/MacOS/StepMania\ (Debug)
with this error:
ld: can't open file, errno=24 file '/Users/nilbus/stepmania/Xcode/build/stepmania.build/Debug/stepmania.build/Objects-normal/i386/Command.o' for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Occasionally I also get this error instead:
Bus error: 10
Note that the file being linked (in this case Command.o) is not deterministic but is always within 5 lines of the same area (around line 250) of the list in stepmania/Xcode/build/stepmania.build/Debug/stepmania.build/Objects-normal/i386/StepMania (Debug).LinkFileList
of 400 files being linked.
According to /usr/include/sys/errno.h, 24 is Too Many Files Open (in a process, vs system-wide, which is errno 23).
The limit can be set for a shell and its children with ulimit -n
. It can only be increased by root. So as root:
$ <long clang++ command from above>
ld: can't open file, errno=24 file '/Users/nilbus/stepmania/Xcode/build/stepmania.build/Debug/stepmania.build/Objects-normal/i386/Command.o' for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$ ulimit -n
2560
$ ulimit -n 10000
$ ulimit -n
10000
$ <long clang++ command from above>
ld: can't open file, errno=24 file '/Users/nilbus/stepmania/Xcode/build/stepmania.build/Debug/stepmania.build/Objects-normal/i386/Command.o' for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Setting ulimit should apply to child processes, and it certainly does for subshells. Increasing the file descriptor limit does not however affect the reported
Am I making any incorrect assumptions? What can I do to discover what the actual source of this problem may be?
To attempt to reproduce:
- git clone https://github.com/stepmania/stepmania @ master[a09e3477]
- Open stepmania/Xcode as an Xcode project
- Build the project