[PATCH] libstdc++/26513: make_exports.pl hardcoded to build nm

Shantonu Sen ssen@opendarwin.org
Mon Apr 24 12:39:00 GMT 2006


When building a cross-compiler for a target that uses a binary format  
that the build nm does not support (like a linux -> darwin cross  
compiler), scripts/make_exports.pl fails with:
nm -P .libs/bitmap_allocator.o .libs/pool_allocator.o ... |
nm: .libs/bitmap_allocator.o: File format not recognized
nm: .libs/pool_allocator.o: File format not recognized

The problem is that "nm" in my PATH does not understand the Mach-O  
binary format, whereas "i686-apple-darwin8-nm" does (and is in my PATH)

The following change resolves <http://gcc.gnu.org/PR26513>, as  
suggested by Benjamin Kosnik. I've been using this patch for over a  
year locally for testing cross compilers.

Tested by doing a native bootstrap for x86_64-unknown-linux-gnu and  
regtested with no regressions. Also built a linux -> darwin cross  
compiler with --enable-languages=c,c++, and whereas this failed  
earlier, it now succeeds. I created a few simple C and C++ programs  
linked against the MacOSX10.4u.sdk, transported them to an Intel Mac,  
and ran them, and they worked.

2006-04-24  Shantonu Sen  <ssen@opendarwin.org>

         PR libstdc++/26513
         * scripts/make_exports.pl: Use $ENV{NM_FOR_TARGET}, if present



make_exports.diff



More information about the Gcc-patches mailing list