[cfe-dev] problem embedding clang 2.7 (__builtin_fabsf not found) - confused!

Graham Wakefield wakefield at mat.ucsb.edu
Sun Jun 6 11:00:49 PDT 2010


Yes.

Under /include/clang/Basic/ I have a Builtins.def which includes the __builtin_fabsf which is what is complained as being undeclared by Clang when invoked. Note that iterating through the list of builtins using Ctx.BuiltinInfo.GetBuiltinNames() also finds __builtin_fabsf. 

But when using the clang libraries to compile code that #includes <math.h>, __builtin_fabsf (and many others) are undeclared.  

I'm confused about how they are listed in the ASTContext / Preprocessor objects, but not declared in the code. I wonder if there is some extra step I am missing, or some special defines I should pass before calling ParseAST? 


FYI, this is using LLVM/Clang 2.7 release, built on Mac OS 10.6, with the following ./configure/make invocation (I need to support OS 10.5+ and 32/64 bit universal):

env MACOSX_DEPLOYMENT_TARGET=10.5 ./configure --enable-targets=x86,x86_64 --enable-jit --enable-optimized --enable-pic
env MACOSX_DEPLOYMENT_TARGET=10.5 sudo make DARWIN_VERSION=10.5 UNIVERSAL=1 UNIVERSAL_ARCH="i386 x86_64" UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.5.sdk/

The compiler is being compiled into a dynamic library, loaded by an application. 
I'm including the lib/clang/1.1/include path, and have verified that these headers are being found (if I don't include them, I get more errors).  

I didn't have this problem with 2.6, if that helps at all.

On Jun 5, 2010, at 12:25 AM, Paul Davey wrote:

> Is it in builtins.def which is somewhere in clang Basic, either in the
> includes or the lib folder...





More information about the cfe-dev mailing list