[LLVMdev] LLVM ARM Cross-Compiler Build

Keun Soo Yim yim6 at illinois.edu
Sat Dec 27 21:26:37 PST 2008


 Hi,

 This is a simple question about building ARM cross-compiler.
 What is the building procedure using LLVM 2.4 and GCC front-end 4.2?

 I used these commands for LLVM, and it is okay.

 $ ../configure --prefix=/usr/local -target=arm
 $ make ENABLE_OPTIMIZED=0
 $ make ENABLE_OPTIMIZED=0 install

 Then these commands were used for GCC front-end but this got couple of
errors.

 $ ../configure --prefix=/usr/local --enable-checking
--enable-llvm=../../llvm/objdir/ --disable-bootstrap --disable-multilib
--program-prefix=llvm- --target=arm-linux-gnu --enable-languages=c,c++,objc
 $ make; make install
 
 Compiler errors are caused due to absence of definition of macros:
 MACHO_DYNAMIC_NO_PIC_P, TARGET_64BIT, and so on.

 When these macros are manually added, it caused another error, like below:

 ../objdir/./gcc/xgcc -B../objdir/./gcc/ -B/usr/local/arm-linux-gnu/bin/
-B/usr/local/arm-linux-gnu/lib/ -isystem /usr/local/arm-linux-gnu/include
-isystem /usr/local/arm-linux-gnu/sys-include -O2 -O2 -g -O2 -DIN_GCC
-DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition -isystem ./include  -I. -I.
-I../../gcc -I../../gcc/. -I../../gcc/../include
-I../../gcc/../libcpp/include  -I../../gcc/../libdecnumber -I../libdecnumber
-I../objdir//include -../../llvm-2.4/include  -g0 -finhibit-size-directive
-fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss
-fno-toplevel-reorder -Dinhibit_libc  \
          -c ../../gcc/crtstuff.c -DCRT_BEGIN \
          -o crtbegin.o
../objdir/./gcc/as: line 2: exec: -o: invalid option
exec: usage: exec [-cl] [-a name] file [redirection ...]
make[2]: *** [crtbegin.o] Error 1
make[2]: Leaving directory `../objdir/gcc'

 As a native GCC, 4.3.0, 3.4.2, and 3.4.6 were used but all have same error.
 A similar command except for --target=arm option works correctly.

 In addition to that, does any developer succeed in compiling a micro-kernel
(e.g., L4 or Xen/ARM) using LLVM ARM port?

 Thanks in advance.

 Best regards,
 Keun Soo





More information about the llvm-dev mailing list