Building 64-bit libraries on OS X

Hi,

how do I compile LLVM for 64-bit on OS X? I want to get 64-bit libraries which generate x86_64 to link them into a 64-bit application. All my attempts ended up with either 32-bit libraries or errors. My machine is an Intel Xeon quad core, 'sysctl hw.cpu64bit_capable' returns 1 so I think the machine is fine.

- './configure && make' yields 32-bit libraries and executables
- I've tried various variations of ./configure --host X and ./configure --target X. I am not sure which target triple to use (the getting started guide says "The values of these options must be legal target triples that your GCC compiler supports."). Unfortunately I couldn't figure out which target triples to use. I've tried a few but until now I either get an error when calling configure or I simply end up with 32-bit libraries. For instance "i686_x86-apple-darwin9.0.0" results in "Invalid configuration `i686_x86-apple-darwin9.0.0': machine `i686_x86-apple' not recognized". "x86_64-apple-darwin9.0.0" configures and builds fine but all libraries are 32-bit ("file libLTO.dylib" says "libLTO.dylib: Mach-O dynamically linked shared library i386").

So, how can I build a 64-bit version for OS X? (Unfortunately prebuild executables are not an option for me)

Jan

To build 64-bit libraries (i.e. 'file <library>' shows x86_64) try 'make EXTRA_OPTIONS=-m64"

Either 32-bit or 64-bit libraries are able to generate code for either 32-bit or 64-bit, try -m32 or -m64 at runtime

Does llvm (not llvm-gcc-4.2) understand the
x86_64-apple-darwin target? I am not sure if
patches for x86_64-apple-darwin as a target
are present in gcc 4.2.1. I do know we only
added the full multilib support for the
x86_64-apple-darwin target in gcc 4.4.
                     Jack