Sign in to follow this  
Ricky C.

Scriptstdstring add-on under clang/LLVM 4.0 with libc++ and C++11

Recommended Posts

Ricky C.    132
I (finally) got our entire engine to compile - see more about the epic saga in my blog post [url="http://rwcproductions.com/node/26"]Adventures in compiling for Mac OSX[/url]. However to do so, I had to patch one add-on. Turns out that under clang/LLVM, when using the libc++ standard library, the operator+= and empty() methods of std::basic_string are inlined. This causes the linker to be unable to find the declarations the add-on is attempting to register - they don't exist.

After digging around, I was able to create the attached patch. This has allowed for compilation on my systems: OSX 10.7 and 10.8 using XCode 4.3 and 4.4 respectively. I have not yet tested execution, as there's still many yards of code for me to write to get there.

Share this post


Link to post
Share on other sites
WitchLord    4677
That's odd. It should be allowed to take the address of an inlined function. It will just force the compiler to provide a non-inlined version alongside the inlined one.

Anyway, I'll apply the patch as soon as possible.

Thanks,
Andreas

Share this post


Link to post
Share on other sites
Ricky C.    132
I'm not 100% about the underlying cause. I did note that the std::basic_string::empty() method was marked for inlining, and I hypothesized off that. Beyond there.... All I'm 100% certain of is that providing wrapper functions cleared out the error. Someone with a far more extensive knowledge of the subject could dig deeper.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this