Jump to content

Problem running some older command line binaries in 10.5


5 posts in this topic

Recommended Posts

While I am a developer, I'm not a gcc or OS X internals expert so I'm a bit stumped. I have some command line binaries that were compiled by a third party under Open Darwin 10.4 that no longer work in Leopard. They fail with this message:

 

-bash: /usr/bin/foobar: cannot execute binary file

 

Strange thing is, I have other such binaries that work just fine. What's more, I have the source for one of these apps (the others are not available), and if I recompile it myself under 10.5, it works fine. Our first thought was perhaps there was a library versioning problem:

 

% otool -L foobar.10.4
foobar.10.4:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.0.0)
% otool -L foobar.10.5
foobar.10.5:
	/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)

 

So I tried copying the libSystem.B.dylib from 10.4 over to my Leopard box and naming it libSystem.B.88.0.0.dylib in the hopes the OS X versioning system would load the right one, but that didn't do it. Taking things a step further, I copied the entire /usr/lib directory from 10.4 into a temp folder on 10.5 and used DYLIB_LIBRARY_PATH to get it to temporarily load it from there. Still no dice. Using DYLD_PRINT_LIBRARIES I can see the libraries being loaded with other binaries, but the ones in question don't show any libraries loading, they just go straight to the error listed above. According to the author of these binaries, the "dependencies on the C library are simple - largely limited to a few basic posix functions like read() and lseek() that should easily resolve into system calls".

 

We're stumped. Any experts out there that have some idea of what might be going wrong here and what we can do to resolve it?

Link to comment
Share on other sites

The results of file are as follows:

 

$ file foobar.10.4
foobar.10.4: Mach-O executable i386
$ file foobar.10.5
foobar.10.5: Mach-O executable i386

 

I'm glad someone's stepped up to help, I just don't know enough of this low-level stuff to figure it out... Thank you!

Link to comment
Share on other sites

  • 2 weeks later...
The results of file are as follows:

 

$ file foobar.10.4
foobar.10.4: Mach-O executable i386
$ file foobar.10.5
foobar.10.5: Mach-O executable i386

 

I'm glad someone's stepped up to help, I just don't know enough of this low-level stuff to figure it out... Thank you!

 

can you drop on of those files you cannot run on evilruff@gmail.com? need to have a closer look.

 

YA

Link to comment
Share on other sites

 Share

×
×
  • Create New...