Hi, On Oct 10, 2009, at 7:17 AM, hiroshi saito wrote:
Hi Laurent,
Thanks for pointing out possibility about llvm-gcc somewhere in the PATH. That's right. I found llvm-gcc in /Developer/usr/bin. After removing /Developer/usr/bin from the PATH, I could successfully build llvm as an universal binary.
Cool.
However, as for MacRuby itself, libmacruby.dylib and macruby is OK with allow_build_warnings=true option, but aot_compile_stdlib is failed. I used MacRuby trunk r2779 this time.
$ PATH=$PATH:~/Desktop/wc/MacRuby/llvm-trunk/Release/bin rake allow_build_warnings=true -t ... ** Invoke macruby:dylib ** Execute aot_compile_stdlib ./miniruby -I. -I./lib bin/rubyc --internal -C "rbconfig.rb" -o "./ rbconfig.rbo" /var/folders/HQ/HQYJapbxHKW7ieZsqEt5-++++TI/-Tmp-/main.c:2: error: expected initializer before ‘-’ token /var/folders/HQ/HQYJapbxHKW7ieZsqEt5-++++TI/-Tmp-/main.c: In function ‘void __init__()’: /var/folders/HQ/HQYJapbxHKW7ieZsqEt5-++++TI/-Tmp-/main.c:5: error: ‘MREP_’ was not declared in this scope /var/folders/HQ/HQYJapbxHKW7ieZsqEt5-++++TI/-Tmp-/main.c:5: error: ‘107041289’ cannot be used as a function Error when executing `/usr/bin/g++ /var/folders/HQ/HQYJapbxHKW7ieZsqEt5-++++TI/-Tmp-/main.c -dynamic -bundle -undefined suppress -flat_namespace -arch x86_64 -L. -lmacruby /var/folders/HQ/HQYJapbxHKW7ieZsqEt5-++++TI/-Tmp-/rbconfig.o -o ./rbconfig.rbo' rake aborted!
Strange. Could you try the following in the same directory and paste us the output? $ ./miniruby -I. -I./lib bin/rubyc --internal -C "rbconfig.rb" -o "./ rbconfig.rbo" -V
The content of /var/folders/HQ/HQYJapbxHKW7ieZsqEt5-++++TI/-Tmp-/ main.c is: extern "C" { void *MREP_-107041289(void *, void *); void *rb_vm_top_self(void); __attribute__((constructor)) static void __init__(void) { MREP_-107041289(rb_vm_top_self(), 0); } }
Looks like the unique ID is negative. Maybe a bug of macrubyc.
FYI, the warnings I forced to ignore with allow_build_warnings=true are those below. I wonder this is happened by not installing llvm, but specifying it's location with "PATH".
/usr/bin/g++ -I/Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include -I/Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3 -fno-common -Woverloaded-virtual -I. -I./include -g -Wall -arch i386 -arch x86_64 -Winline --param inline-unit-growth=10000 --param large-function-growth=10000 -x objective-c++ -c dispatcher.cpp -o dispatcher.o /Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include/llvm/Type.h:417: warning: ‘void llvm::PATypeHandle::addUser()’ was used before it was declared inline /Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include/llvm/ AbstractTypeUser.h:95: warning: previous non-inline declaration here /Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include/llvm/Type.h:422: warning: ‘void llvm::PATypeHandle::removeUser()’ was used before it was declared inline /Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include/llvm/ AbstractTypeUser.h:96: warning: previous non-inline declaration here /Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include/llvm/Type.h:434: warning: ‘llvm::Type* llvm::PATypeHolder::get() const’ was used before it was declared inline /Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include/llvm/ AbstractTypeUser.h:159: warning: previous non-inline declaration here /Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include/llvm/Type.h:440: warning: ‘void llvm::PATypeHolder::addRef()’ was used before it was declared inline /Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include/llvm/ AbstractTypeUser.h:182: warning: previous non-inline declaration here /Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include/llvm/Type.h:446: warning: ‘void llvm::PATypeHolder::dropRef()’ was used before it was declared inline /Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include/llvm/ AbstractTypeUser.h:183: warning: previous non-inline declaration here /Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include/llvm/Type.h:417: warning: ‘void llvm::PATypeHandle::addUser()’ was used before it was declared inline /Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include/llvm/ AbstractTypeUser.h:95: warning: previous non-inline declaration here /Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include/llvm/Type.h:422: warning: ‘void llvm::PATypeHandle::removeUser()’ was used before it was declared inline /Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include/llvm/ AbstractTypeUser.h:96: warning: previous non-inline declaration here /Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include/llvm/Type.h:434: warning: ‘llvm::Type* llvm::PATypeHolder::get() const’ was used before it was declared inline /Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include/llvm/ AbstractTypeUser.h:159: warning: previous non-inline declaration here /Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include/llvm/Type.h:440: warning: ‘void llvm::PATypeHolder::addRef()’ was used before it was declared inline /Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include/llvm/ AbstractTypeUser.h:182: warning: previous non-inline declaration here /Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include/llvm/Type.h:446: warning: ‘void llvm::PATypeHolder::dropRef()’ was used before it was declared inline /Users/hiroshi/Desktop/wc/MacRuby/llvm-trunk/include/llvm/ AbstractTypeUser.h:183: warning: previous non-inline declaration here
I never got these warnings before on several machines, we build with - Werror since months and nobody reported this problem too. I suspect it has something to do with your LLVM installation, but I'm not sure. These warnings are probably because of -Winline that we only pass when building dispatcher.cpp (to make sure gcc won't lie to us). Laurent