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

Chris Lattner clattner at apple.com
Fri Jan 8 10:13:03 PST 2010


This patch looks fine to me, Duncan, does it seem reasonable to you?

-Chris

On Jan 6, 2010, at 3:06 PM, Viktor Kutuzov wrote:

> 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<llvm-gcc-link-reg_renumber- 
> error.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list