Ticket #29757 (closed defect: fixed)
mysql5 fails with Xcode 4.2 (clang)
| Reported by: | thomas.visser@… | Owned by: | ryandesign@… |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | 1.9.2 |
| Keywords: | clang | Cc: | greg_spam@…, macports@…, johnmac@…, miranda.henrique@…, larry.velazquez@…, jeremyhu@… |
| Port: | mysql5 |
Description (last modified by ryandesign@…) (diff)
Instaling the mysql5 port fails with the following error:
:info:build ld: in ../libmysqld.a(), archive member '' with length 0 is not mach-o or llvm bitcode for architecture x86_64
See http://pastebin.com/rA4wUvfD for a larger portion of the main.log file.
I also tried installing the port using +universal. That, and installing mysql5-devel, resulted in the same error.
I am running XCode 4.2 on Snow Leopard on a 2011 MacBook Pro.
Attachments
Change History
comment:2 Changed 4 years ago by ryandesign@…
- Keywords mysql5, removed
- Owner changed from macports-tickets@… to ryandesign@…
- Description modified (diff)
- Cc thomas.visser@… removed
- Port set to mysql5
This problem is new to me. Please clean and try again and attach the entire main.log to this ticket.
comment:3 in reply to: ↑ description Changed 4 years ago by ryandesign@…
Replying to thomas.visser@…:
I am running XCode 4.2 on Snow Leopard on a 2011 MacBook Pro.
I assume you mean 4.0.2, the latest version? I haven't tried Xcode 4 yet but I haven't heard any other reports of mysql5 breaking with Xcode 4.
comment:4 Changed 4 years ago by thomas.visser@…
I cleaned and tried again; it resulted in the same error. I have uploaded the entire main.log as an attachment. I am running Xcode 4.2, it comes with the iOS5 beta and was released last monday.
I have had some more problems with macports recently. My previous install was completely broken, a 'port install' always resulted in an immediate segmentation fault. I deinstalled macports, removed all ports and reinstalled it. After the reinstall I still ran into some problems, e.g. building python27 failed unless I added +universal. Might be related, might be a clue?
comment:5 follow-up: ↓ 6 Changed 4 years ago by ryandesign@…
- Summary changed from install of mysql5 failed to mysql5 fails with Xcode 4.2
Thanks. But we can't really help with beta releases of Mac OS X, Xcode, or related Apple products. (Most of us don't have access to them.) Sorry, I don't know how to help with this. You could try reporting the problem to the developers of MySQL (http://bugs.mysql.com/ -- it may be a MySQL bug) and/or to Apple (https://bugreport.apple.com/ -- it may be an Xcode 4.2 bug).
comment:6 in reply to: ↑ 5 Changed 4 years ago by thomas.visser@…
Thanks for your help. I'll try to get help from mysql/apple.
comment:8 follow-up: ↓ 10 Changed 4 years ago by thomas.visser@…
I was able to install mysql5-server just fine with XCode 4.2 beta2. I think this issue can be closed.
comment:9 Changed 4 years ago by ryandesign@…
- Status changed from new to closed
- Resolution set to invalid
Thanks for letting me know.
comment:10 in reply to: ↑ 8 Changed 4 years ago by page.agent@…
- Status changed from closed to reopened
- Resolution invalid deleted
Replying to thomas.visser@…:
I was able to install mysql5-server just fine with XCode 4.2 beta2. I think this issue can be closed.
Have you also tried to install mysql5?
I'm experiencing the same problem although using Xcode 4.0.2 on SnowLeopard. Was able to compile and install apache2, php, mysql5-server but mysql5 gives me the same error as reported above. Also tried +universal (after cleaning and uninstalling all packages).
Here is a excerpt of the log:
:info:build libtool: link: /Developer/usr/bin/llvm-g++-4.2 -O2 -fPIC -arch x86_64 -fno-implicit-templates -fno-exceptions -fno-rtti -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL -arch x86_64 -o mysqltest_embedded mysqltest.o -L/opt/local/lib ../libmysqld.a -ldl ../../regex/libregex.a -lm -lm -L/opt/local/lib/ -lssl -lcrypto -lz :info:build ld: in ../libmysqld.a(HùHÿÁHÿÈuöH), archive member 'HùHÿÁHÿÈuöH' with length 0 is not mach-o or llvm bitcode for architecture x86_64 :info:build collect2: ld returned 1 exit status
comment:11 Changed 4 years ago by macports@…
try:
sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
allowed me to selfupdate and build.
MBP 2011, XCode 4.2 (4C199), Snow Leopard 10.6.8
comment:12 Changed 4 years ago by ryandesign@…
- Cc macports@… added
Absolutely do not mess around in /usr/bin. Please undo whatever you did.
To the best of my knowledge, /usr/bin/gcc-4.2 doesn't even exist anymore in Xcode 4.2.
Now that Xcode 4.2 final is out, it would be interesting to hear from people using it. If you're having trouble building mysql5 with clang (which is the default compiler on Xcode 4.2), try with llvm-gcc-4.2:
sudo port clean mysql5 sudo port install configure.compiler=llvm-gcc-4.2
Please let us know here if that works.
comment:13 Changed 4 years ago by macports@…
sudo port -v selfupdate
Failed because it couldn't find gcc-4.2. If you have a fix that would allow me to run selfupdate on 10.6.8 and XCode 4.2 I'd love to hear it. Since /usr/bin/gcc is gcc 4.2, I thought I'd try the hack I posted and it worked. I was dead in the water. The only information I can find on here related to this issue is "it works for me - issue closed", or "no it still doesnt work" from 4 months ago. This fix worked for me.
monster:~ jamie$ /usr/bin/gcc -v Using built-in specs. Target: i686-apple-darwin10 Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~3/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~3/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/usr/include/c++/4.2.1 Thread model: posix gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
comment:14 Changed 4 years ago by macports@…
I realized I'm hijacking someones ticket, so I made my own: #31619
comment:15 Changed 4 years ago by ryandesign@…
That's not gcc-4.2. That's llvm-gcc-4.2.
comment:16 Changed 3 years ago by ryandesign@…
- Cc johnmac@…, miranda.henrique@… added
Has duplicate #30442.
comment:17 Changed 3 years ago by larry.velazquez@…
Compiling mysql5 with clang fails for me, on OS X 10.7.2 (11C74) with Xcode 4.2. Attaching build log.
Changed 3 years ago by larry.velazquez@…
- Attachment main.2.log added
Build failure with Apple's clang 3.0 on OS X 10.7.2
comment:18 Changed 3 years ago by ryandesign@…
- Keywords clang added
- Summary changed from mysql5 fails with Xcode 4.2 to mysql5 fails with Xcode 4.2 (clang)
Does using llvm-gcc-4.2 or gcc 4.2 fix it?
comment:19 follow-up: ↓ 20 Changed 3 years ago by ryandesign@…
- Cc larry.velazquez@… added
Larry, please see my remark above.
comment:20 in reply to: ↑ 19 Changed 3 years ago by larry.velazquez@…
Replying to ryandesign@…:
Larry, please see my remark above.
Builds fine with llvm-gcc-4.2. The port already defaults to llvm-gcc-4.2 on systems with clang (r80074); I had to specify clang explicitly to test it. I guess I just verified that the clang issue is still around.
comment:21 Changed 3 years ago by ryandesign@…
- Cc jeremyhu@… added
- Status changed from reopened to closed
- Resolution set to fixed


Cc Me!