[llvm-commits] [PATCH] LLVM_GCC: Fix for "Undefined symbols: "_reg_renumber"" build error on Mac OS X Snow Leopard

Viktor Kutuzov vkutuzov at accesssoftek.com
Wed Jan 6 15:06:46 PST 2010


Hello everyone,

Please find attached the patch to fix the following llvm-gcc build error on Mac OS X Snow Leopard (10.6.2):

Undefined symbols:
  "_reg_renumber", referenced from:
      _reg_renumber$non_lazy_ptr in libbackend.a(i386.o)
      _reg_renumber$non_lazy_ptr in libbackend.a(regclass.o)
      _reg_renumber$non_lazy_ptr in libbackend.a(function.o)
      _reg_renumber$non_lazy_ptr in libbackend.a(cselib.o)
      _reg_renumber$non_lazy_ptr in libbackend.a(integrate.o)
      _reg_renumber$non_lazy_ptr in libbackend.a(jump.o)
      _reg_renumber$non_lazy_ptr in libbackend.a(reload.o)
      _reg_renumber$non_lazy_ptr in libbackend.a(insn-preds.o)
      _reg_renumber$non_lazy_ptr in libbackend.a(reload1.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [cc1-dummy] Error 1
make[1]: *** [all-gcc] Error 2
make: *** [all] Error 2

The problem happens because libtool (or ranlib if ar and ranlib is used to create the library) on Mac OS X by default does not include common symbols in archive's definitions table.

To fix this, I have changed the gcc/local-alloc.c file to initialize the reg_renumber global.

Tested on Mac OS X Snow Leopard (10.6.2) and Ubuntu (9.10).

Cheers,
Viktor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm-gcc-link-reg_renumber-error.patch
Type: application/octet-stream
Size: 382 bytes
Desc: llvm-gcc-link-reg_renumber-error.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100106/4f3494ee/attachment.obj>


More information about the llvm-commits mailing list