-
-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OSX: Undefined symbols for architecture x86_64 __d_osx_image_init2 #101
Comments
I am having the exact same issue and I tracked it down to some files that |
Actually Also un-disable (fancy enable?) There was also a configuration problem in CMake: instead of copying the provided With all these changes I managed to link a program that uses threads. :) I'll try to make a brew Formula when I get the chance. |
Both of the problems are caused by upstream changes being merged in without OS X being tested (which is hard for many devs).
It doesn't matter for us in any case – removing
Will push a fix for both shortly. |
Hi thanks for your answers; could it be related to a previous regression I reported? |
@thelastmammoth: No, this is genuinely a LDC bug – the build error was caused by indadvertedly merging in Walter's fix for Issue 4854, which is DMD only, into our copy of druntime. The fix is trivial, but I still need to test it before pushing it to the repo (hopefully in a few hours or so). |
I issued a pull request :) How do I run unittests btw? |
Fixed in master. @dansanduleac: At the moment, you unfortunately need to manually run the DMD/druntime/Phobos test suites from the respective repositories, setting the compiler to |
I can't build from master: ... |
You need to On 2 Jun 2012, at 21:03, thelastmammoth wrote:
|
thanks, it does! Couple questions while I'm at it:
I really don't understand why it can't demangle those symbols, as it's easy to do with ddemangle for example?
Thanks! |
Great!
Hope this helps On 2 Jun 2012, at 23:00, thelastmammoth wrote:
|
@dansanduleac: Correct – and I'm working on a more capable replacement for ldmd. |
Btw, there might not be any way as of yet for lldb to automatically demangle symbols in D, but for gdb there are patches that enable this: http://www.dsource.org/projects/gdb-patches. |
… and they are already (or at least to a large part) in mainline GDB since 7.1. |
yes, but in my experience they work on linux but not on OSX (see my other post http://d.puremagic.com/issues/show_bug.cgi?id=8172). I contacted the author of the original gdb patch (Mihail Zenkov) and he has only tested on linux it seems). Is that your experience as well? |
I followed the instructions given on https://github.com/ldc-developers/ldc/wiki/Installation with a few modifications to make the build successful on OSX (see below for required modifications):
when compiling + linking a hello world program main.d I get the following link error:
ldc2 main.d
Undefined symbols for architecture x86_64:
"__d_osx_image_init2", referenced from:
_main in libphobos-ldc.a(dmain2.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
Error: linking failed:
status: 1
************************************ installation *************************
sudo port install libconfig-hr (install libconfig)
then in ccmake, change llvm path to /opt/local/bin/llvm-config-mp-3.0 (to make it work with the macports version)
ccmake complains (" libconfig++ not found") ("consider manually setting the LIBCONFIG_CXXFLAGS and LIBCONFIG_LDFLAGS"). Unfortunately the instructions given here (http://www.dsource.org/projects/ldc/wiki/OSXBuildInstructions : you also need to set LIBCONFIG_LDFLAGS="-L/usr/local/lib -lconfig++" in advanced options of ccmake (while configuring, press 't', scroll down) didn't work as LIBCONFIG_LDFLAGS doesn't appear in advanced options.
but the following manual way works:
cmake .. -DLIBCONFIG_LDFLAGS="-L/opt/local/lib/ -lconfig++" -DLIBCONFIG_CXXFLAGS=-I/opt/local/include/
followed by make && make install
that compiles fine, ldc2 is created
The text was updated successfully, but these errors were encountered: