mysql-5.0.15 does not build with llvm 1.6 (does with gcc)
| Bugzilla Link | 666 |
| Resolution | FIXED |
| Resolved on | Mar 06, 2010 14:00 |
| Version | 1.6 |
| OS | Linux |
Extended Description
MySQL 5.0 fails to build on Debian Linux (unstable/testing).
linux kernel: 2.6.12-1-686-smp
./configure line:
CC=llvm-gcc CXX=llvm-g++ LDFLAGS="-Wl,-native" ./configure
(same problem with "-Wl,-native" removed)
Configure works just fine. Problem occurs during build:
...
if llvm-gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -O3
-DDBUG_OFF -MT str2int.o -MD -MP -MF ".deps/str2int.Tpo" -c -o str2int.o
str2int.c;
then mv -f ".deps/str2int.Tpo" ".deps/str2int.Po"; else rm -f
".deps/str2int.Tpo"; exit 1; fi
In file included from ../include/my_sys.h:32,
from str2int.c:44:
../include/my_pthread.h:245:45: thread.h: No such file or directory
make[2]: *** [str2int.o] Error 1
make[2]: Leaving directory
/home/local/kremenek/llvm/test/builds/mysql-5.0.15/strings' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory /home/local/kremenek/llvm/test/builds/mysql-5.0.15'
make: *** [all] Error 2
The file "my_pthread.h" uses a bunch of preprocessor logic to select what thread header file to include (OS/system dependent). The file "thread.h" does not exist, but it doesn't look like it should be included in the first place.
I'm not exactly certain what the issue is. Looks like a configuration logic error?
Compilation works just fine when we use gcc:
%> gcc --version
Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.0 --enable-__cxa_atexit --enable-libstdcxx-allocator=mt --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-gc=boehm --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disable-werror --enable-checking=release i486-linux-gnu Thread model: posix gcc version 4.0.2 (Debian 4.0.2-2)
Today is the perfect day to resolve this bug.
This can't be resolved until 6/6/06 :)
This is the "llvmgcc3 breaks configure scripts because it doesn't do link tests right". The real fix for this is to use llvmgcc4, which doesn't have this problem.
Maybe I should have waited until 6/6/06 to close this... :)
-Chris
Ted,
See the script I attached. You can use this to configure MySQL 5.0 properly so that it builds with LLVM tools. Note that you will run into a link error in the final analysis as the setrlimit function has multiple type definitions and llvm linker can't resolve one of the definitions. You get an undefined symbol for something like l75_setrlimit. Chris said he'd look into that problem, but the attached script should at least get you through building MySQL with LLVM.
Reid
A script to properly configure mysql for building with LLVM This bash script will configure MySQL 5.0 correctly so that it will build correctly using LLVM tools.
I'm not sure, but this doesn't look/smell like an LLVM problem. More likely it is a problem with their configure script, and it not being compatible with llvm-gcc or something. Can you dig in a bit more and find out why it wants thread.h with llvm but not with GCC?
Thanks,
-Chris