Bug #47360 | Can't build universal x86_64/i386: Undefined symbols for architecture x86_64 | ||
---|---|---|---|
Submitted: | 16 Sep 2009 9:53 | Modified: | 16 Jan 2014 13:04 |
Reporter: | Ryan Schmidt | Email Updates: | |
Status: | Won't fix | Impact on me: | |
Category: | MySQL Server: Compiling | Severity: | S3 (Non-critical) |
Version: | 5.1.38 | OS: | MacOS (10.6.1) |
Assigned to: | CPU Architecture: | Any | |
Tags: | regression, universal |
[16 Sep 2009 9:53]
Ryan Schmidt
[16 Sep 2009 9:54]
Ryan Schmidt
complete build output
Attachment: mysql5-5.1.38-universal.txt.bz2 (application/x-bzip2, text), 56.90 KiB.
[18 Sep 2009 16:37]
Valeriy Kravchuk
On Mac OS X 10.5.x "single-platform" 5.1.38 binaries from MacPorts also builds OK, while +universal do NOT. The errors I've got were different though...
[30 Sep 2009 10:21]
Geert Vanderkelen
Compiled 5.1.39 fine on MacOS X 10.6.1 (Latest XCode, No MacPorts). Slightly modified the build options, try and give us feed back whether it works on your install or not. Maybe with other options set, etc.. -Geert (put following in a file named compile.sh and execute it in the source dir) CFLAGS='-O2 -fPIC -arch x86_64 -arch i386' CPPFLAGS='-I/opt/local/include' CXXFLAGS='-O2 -fPIC -arch x86_64 -arch i386' MACOSX_DEPLOYMENT_TARGET='10.6' CXX='/usr/bin/g++-4.2' F90FLAGS='-O2' LDFLAGS='-L/opt/local/lib -arch x86_64 -arch i386' OBJC='/usr/bin/gcc-4.2' FCFLAGS='-O2' INSTALL='/usr/bin/install -c' OBJCFLAGS='-O2 -arch x86_64 -arch i386' FFLAGS='-O2' CC='/usr/bin/gcc-4.2' PREFIX=/opt/mysql/mysql-5.1.39-build ./configure --prefix=$PREIFX \ --disable-dependency-tracking \ --mandir=$PREFIX/share/man --infodir=$PREFIX/share/info \ --localstatedir=$PREFIX/var/ --libdir=$PREFIX/lib \ --bindir=$PREFIX/bin --includedir=$PREFIX/include \ --datadir=$PREFIX/share/ --sysconfdir=$PREFIX/etc \ --with-extra-charsets=complex \ --with-mysqld-user=mysql \ --without-docs --without-bench --with-partition --with-plugins=all \ --enable-thread-safe-client --with-embedded-server \ --with-pic --with-readline make clean make
[6 Oct 2009 16:56]
Ryan Schmidt
Hi, Geert. Yes, your script builds without error for me, but it builds 64-bit binaries only, not 32-bit/64-bit universal as desired. This is because none of the variables are getting passed to the Makefile. If you use "export" in front of each variable definition, e.g. "export CFLAGS='-O2 -fPIC -arch x86_64 -arch i386'", you should see the failure. After a few tests, it seems just requesting to add the embedded server is enough to trigger the problem. Here is the script I used: #!/bin/bash export CFLAGS='-O2 -fPIC -arch x86_64 -arch i386' export CPPFLAGS='-I/opt/local/include' export CXXFLAGS='-O2 -fPIC -arch x86_64 -arch i386' export MACOSX_DEPLOYMENT_TARGET='10.6' export CXX='/usr/bin/g++-4.2' export F90FLAGS='-O2' export LDFLAGS='-L/opt/local/lib -arch x86_64 -arch i386' export OBJC='/usr/bin/gcc-4.2' export FCFLAGS='-O2' export INSTALL='/usr/bin/install -c' export OBJCFLAGS='-O2 -arch x86_64 -arch i386' export FFLAGS='-O2' export CC='/usr/bin/gcc-4.2' ./configure \ --disable-dependency-tracking \ --with-embedded-server \ --with-pic make clean make
[25 Oct 2009 20:31]
Kendall Bennett
Can we get this fixed? I just discovered this when I tried to install MacPorts on my home system, and I NEED a universal install of MySQL for my development environment due to some stupid limitations of Zend Studio. 5.0.86 worked just fine, but now that my system is building 5.1.40, the universal builds get ignored ...
[21 Nov 2009 10:56]
Valeriy Kravchuk
Please, check if recent version, 5.1.41, is also affected when you use latest Xcode for 10.6.
[21 Nov 2009 11:01]
Ryan Schmidt
Yes, MySQL 5.1.41 is still affected on Mac OS X 10.6.2 with Xcode 3.2.1. Again, the problem is the libmysqld embedded server. When I updated the mysql5 port in MacPorts to 5.1.41 a few hours ago, I added a "no_embedded_server" variant; MacPorts users who do not need the embedded server but do need a universal build can use this variant: sudo port install mysql5 +no_embedded_server +universal
[31 Dec 2009 7:20]
Geert Vanderkelen
Verified (includes workaround). The problem is that the libmysqld Makefile's are just broken and this makes it difficult to produce universal binaries. (Probably also the reason why MacPorts gives the option to exclude it, smart!) Talking to engineering, there were some patches and fixes, but they were never approved. There is work on going, but not sure when this will go in. Workaround: For now, if you don't need libmysqld (most don't) you can use the script below to produce a binary which works 32 and 64bit. If you need libmysqld, build it 2 times: once for i386 and once for x86_64 and distribute as such. IMHO this is a valid workaround. (you might try to use lipo to combine them manually?) Below script might not need SDK/SDKLIB, but just showing to be complete. Also, I'm using libedit (for the folks that don't have readline compiled on their machines). #!/bin/bash SDK="-isysroot /Developer/SDKs/MacOSX10.6.sdk" SDKLIB="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk" MACOSX_DEPLOYMENT_TARGET="10.6" export CFLAGS="-O2 -fPIC -arch i386 -arch x86_64 $SDK" export CXXFLAGS="-O2 -fPIC -arch i386 -arch x86_64 $SDK" export LDFLAGS="-arch i386 -arch x86_64 $SDKLIB" CC="/usr/bin/gcc-4.2" CXX="/usr/bin/g++-4.2" OBJC="/usr/bin/gcc-4.2" INSTALL="/usr/bin/install -c" PREFIX=/opt/mysql/mysql-5.1.42-universal-ppc ./configure --prefix=$PREFIX \ --disable-dependency-tracking \ --mandir=$PREFIX/share/man --infodir=$PREFIX/share/info \ --localstatedir=$PREFIX/var/ --libdir=$PREFIX/lib \ --bindir=$PREFIX/bin --libexecdir=$PREFIX/bin \ --includedir=$PREFIX/include \ --datadir=$PREFIX/share/ --sysconfdir=$PREFIX/etc \ --with-extra-charsets=complex \ --with-mysqld-user=mysql \ --without-docs \ --with-plugins=all \ --enable-thread-safe-client --without-embedded-server \ --with-pic --with-libedit if [ $? -eq 0 ]; then make clean time make -j 2 fi
[16 Jan 2014 13:04]
Ståle Deraas
Posted by developer: From OS X 10.8 universal binaries are no longer relevant, as 10.8 only runs on 64bit cpus.