Advertisement

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

Started by July 29, 2012 10:51 PM
2 comments, last by WitchLord 12 years, 5 months ago
I (finally) got our entire engine to compile - see more about the epic saga in my blog post Adventures in compiling for Mac OSX. 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.
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

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement
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.
Patch applied in revision 1378.

Thanks,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement