Re: Using llvm with Xcode
Re: Using llvm with Xcode
- Subject: Re: Using llvm with Xcode
- From: Jesper Papmehl-Dufay <email@hidden>
- Date: Tue, 28 Aug 2007 20:45:33 +0200
27 aug 2007 kl. 19.32 skrev Devang Patel:
I assume you built llvm yourself and used configure time option --
prefix to select installation location.
Actually, I downloaded the pre-built 2.0 release for Mac OS X ("LLVM-
GCC 4 Front End Binaries for MacOS X/x86") and just unpacked the
archive into my home directory, and then placed the symlinks in /usr/
bin.
I'm afraid I won't be able to give you perfect solution. SDKs are
installed at /Developer/SDKs. GCC is finding float.h at
/MacOSX10.4.0.sdk/usr/include/float.h
GCC constructs this path using following two components
1) Based on SDK selection /Developer/SDKs/MacOSX10.4.0.sdk
2) Based on install location /usr, it searches for system header
in ${SDKPATH}/usr/include .
In llvm-gcc's case, install location is not /usr/include but
something else hence it is not finding float.h If you use -v
command line option then it will list paths being used to search
header. One approach is to create appropriate symlinks in /
Developer/SDKs/MacOSX.10.4.0.sdk to link /Developer/SDKs/usr/
include/float.h. But be warned, this is not an elegant way and it
may not work and restoring original status may not be straight
forward.
Thanks for the tip about -v! I hadn't thought about that. Looking at
the output, I noticed that it's looking for
/Developer/SDKs/MacOSX.10.4.0.sdk/Users/tonic/release/llvm-gcc/obj/../
install/include/[regular usr/include stuff goes here]
/Developer/SDKs/MacOSX.10.4.0.sdk/Users/tonic/release/llvm-gcc/obj/../
install/lib/[regular usr/lib stuff goes here]
So I created all the folders in the path it was looking for, and then
symlinks to usr/include and /usr/lib at the end, and it works! :)
I guess I could get rid of all that ugliness if I built the gcc front
end myself, specifying /usr/include as the --prefix option?
I also had to comment out lots of functions in mmintrin.h that where
casting long long vectors to "regular" long longs, and llvm wouldn't
have any of it, but apart from that, it seems to work! (Just some
inline assembly I have to remove...)
Thanks!
/Jesper
-
Devang
Thanks!
/Jesper
24 aug 2007 kl. 20.24 skrev Devang Patel:
On Aug 24, 2007, at 10:04 AM, Jesper Papmehl-Dufay wrote:
Thanks for the quick reply!
Yes, that's much easier! :) I wasn't aware of the CC/CPLUSPLUS.
Unfortunately, I now run into other problems. I'm sorry if this
is maybe getting a bit off-topic; hopefully, I'm not the only
Xcode user interested in using llvm.
When precompiling my prefix file, I get a few errors about some
system headers that cannot be found.
For example, my prefix file includes stdarg.h, and that file in
itself can be found, but it contains the following line:
#include_next <stdarg.h>
and llvm cannot found _that_ copy of stdarg.h.
I have the same problem with float.h (which is included by a
header in the Carbon framework which I include).
Is there some way to make llvm to behave more like gcc when it
comes to finding system header files?
llvm-gcc uses gcc front-end so it behaves like gcc. However,
depending upon your llvm-gcc install location, it may not be able
to find system headers associated with SDKs. Are you using SDK ?
-
Devang
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden