Valentin Radu
2011-Sep-22 18:47 UTC
[LLVMdev] Compiling LLVM w/ Clang for ARMv7 and ARMv6 archs from a i386 OSX machine
Hello, For the last couple of days I struggled to find a way to compile LLVM with Clang for ARM. Now, I tried many variations of the settings, linkers and compilers, but I was able only to build for i386 and x86_64. My machine is an i386 iMac. This is my first attempt to cross-compile something, so probably I'm doing something incredible stupid. First, I'm not sure which compiler should I use. I tried: CXX="$DEVROOT/usr/bin/llvm-g++-4.2" CC="$DEVROOT/usr/bin/llvm-gcc-4.2" CXX="$DEVROOT/usr/bin/g++-4.2" CC="$DEVROOT/usr/bin/gcc-4.2" Here is my conf: ../llvm/configure --host=armv7-apple-darwin --target=armv7-apple-darwin --build=i386-apple-darwin --enable-optimized --disable-debug --disable-expensive-checks --disable-doxygen --disable-threads --enable-targets=arm Just after I run configure, I get: checking for armv7-apple-darwin-clang... no checking for armv7-apple-darwin-llvm-gcc... no checking for armv7-apple-darwin-gcc... no checking for clang... clang configure: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf at gnu.org. checking for C compiler default output file name... a.out *checking whether the C compiler works... yes checking whether we are cross compiling... yes* checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether clang accepts -g... yes checking for clang option to accept ISO C89... none needed checking for armv7-apple-darwin-clang++... no checking for armv7-apple-darwin-llvm-g++... no checking for armv7-apple-darwin-g++... no checking for clang++... clang++ checking whether we are using the GNU C++ compiler... yes checking whether clang++ accepts -g... yes checking how to run the C preprocessor... clang -E configure: WARNING: Unknown project (.svn) won't be configured automatically checking build system type... i386-apple-darwin checking host system type... armv7-apple-darwin checking target system type... armv7-apple-darwin checking type of operating system we're going to host on... Darwin checking type of operating system we're going to target... Darwin *checking target architecture... ARM* checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking whether byte ordering is bigendian... no Everythings seems to be fine, it targets ARM and its cross-compiling, however, when I run "make", it makes either a x86_64 or a i386 archive file (.a). I'm sure I'm doing something stupid somewhere... -- Regards, R. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110922/5d23313c/attachment.html>
Eric Christopher
2011-Sep-22 18:51 UTC
[LLVMdev] Compiling LLVM w/ Clang for ARMv7 and ARMv6 archs from a i386 OSX machine
On Sep 22, 2011, at 11:47 AM, Valentin Radu wrote:> checking for armv7-apple-darwin-clang... no > checking for armv7-apple-darwin-llvm-gcc... no > checking for armv7-apple-darwin-gcc... noIt's because you don't have a compiler around that targets arm by default. -eric -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110922/d8b6d5be/attachment.html>
Jim Grosbach
2011-Sep-26 18:01 UTC
[LLVMdev] Compiling LLVM w/ Clang for ARMv7 and ARMv6 archs from a i386 OSX machine
On Sep 22, 2011, at 11:51 AM, Eric Christopher wrote:> > On Sep 22, 2011, at 11:47 AM, Valentin Radu wrote: > >> checking for armv7-apple-darwin-clang... no >> checking for armv7-apple-darwin-llvm-gcc... no >> checking for armv7-apple-darwin-gcc... no > > It's because you don't have a compiler around that targets arm by default.Exactly right. You can look in the build_llvm script for an ugly-but-effective way to work around that on Darwin. -Jim
Apparently Analagous Threads
- [LLVMdev] Compiling LLVM w/ Clang for ARMv7 and ARMv6 archs from a i386 OSX machine
- [LLVMdev] Compiling LLVM w/ Clang for ARMv7 and ARMv6 archs from a i386 OSX machine
- [LLVMdev] Cross-compiling llvm/clang osx -> win32
- [PATCH] Add ARM cpu detection for iDevices
- [LLVMdev] LTO support on Mac