<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV><FONT color=#c00000>At the last step of building llvm for arm target, I am unable to build llvm-gcc. I am trying the follwing options:</FONT></DIV>
<DIV> </DIV><FONT size=2>
<DIV>$ ../llvm-gcc/configure --target=arm-linux --enable-pic --program-prefix=llvm-</DIV>
<DIV>--prefix=/llvm/install --disable-multilib --disable-optimized --enable-bindings</DIV>
<DIV>=none --enable-llvm=$PWD/../llvm-2.8 --enable-languages=c,c++ --disable-bootstr</DIV>
<DIV>ap</DIV>
<DIV> </DIV>
<DIV><FONT color=#ff0000>Then I get the following error when I run make:</FONT></DIV>
<DIV> </DIV>
<DIV>$ make</DIV>
<DIV> </DIV>
<DIV>../../llvm-gcc/gcc/config/arm/lib1funcs.asm:93:2: error: #error Unable to determ</DIV>
<DIV>ine architecture.</DIV>
<DIV>make[3]: *** [libgcc/./_udivsi3_s.o] Error 1</DIV>
<DIV>make[3]: Leaving directory `/llvm/arm_objects/gcc'</DIV>
<DIV>make[2]: *** [libgcc.a] Error 2</DIV>
<DIV>make[2]: Leaving directory `/llvm/arm_objects/gcc'</DIV>
<DIV>make[1]: *** [all-gcc] Error 2</DIV>
<DIV>make[1]: Leaving directory `/llvm/arm_objects'</DIV>
<DIV>make: *** [all] Error 2</DIV>
<DIV> </DIV>
<DIV><FONT color=#c00000>I also tried the following configuration:</FONT></DIV>
<DIV> </DIV>
<DIV>$ ../llvm-gcc/configure --target=arm-linux --enable-pic --program-prefix=llvm-</DIV>
<DIV>--prefix=/llvm/install --disable-multilib --disable-optimized --enable-bindings</DIV>
<DIV>=none --enable-llvm=$PWD/../llvm-2.8 --enable-languages=c,c++ --disable-bootstr</DIV>
<DIV>ap <FONT color=#0000ff>--with-arch=armv5te</FONT> </DIV>
<DIV> </DIV>
<DIV><FONT color=#ff0000>Then I get the following error when I run make:</FONT></DIV>
<DIV> </DIV>
<DIV>$ make</DIV>
<DIV> </DIV>
<DIV>/llvm/install/arm-linux/bin/ranlib ./libgcov.a</DIV>
<DIV>/llvm/arm_objects/./gcc/xgcc -B/llvm/arm_objects/./gcc/ -B/llvm/install/arm-linu</DIV>
<DIV>x/bin/ -B/llvm/install/arm-linux/lib/ -isystem /llvm/install/arm-linux/include -</DIV>
<DIV>isystem /llvm/install/arm-linux/sys-include --sysroot=yes -O2 -O2 -g -O2 --sys</DIV>
<DIV>root=yes -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wstric</DIV>
<DIV>t-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -f</DIV>
<DIV>omit-frame-pointer -fPIC -g0 -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_</DIV>
<DIV>NEEDED -Dinhibit_libc -I. -I. -I../../llvm-gcc/gcc -I../../llvm-gcc/gcc/. -I../.</DIV>
<DIV>./llvm-gcc/gcc/../include -I../../llvm-gcc/gcc/../libcpp/include -I../../llvm-g</DIV>
<DIV>cc/gcc/../libdecnumber -I../libdecnumber -I/llvm/arm_objects/../llvm-2.8/include</DIV>
<DIV>-I/llvm/llvm-2.8/include -fexceptions -fvisibility=hidden -DHIDE_EXPORTS -c ../</DIV>
<DIV>../llvm-gcc/gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o</DIV>
<DIV>'arm1026ej-s' is not a recognized processor for this target (ignoring processor)</DIV>
<DIV>'arm1026ej-s' is not a recognized processor for this target (ignoring processor)</DIV>
<DIV>In file included from ./gthr-default.h:1,</DIV>
<DIV>from ../../llvm-gcc/gcc/gthr.h:114,</DIV>
<DIV>from ../../llvm-gcc/gcc/unwind-dw2.c:42:</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:43:21: error: pthread.h: No such file or directo</DIV>
<DIV>ry</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:44:20: error: unistd.h: No such file or director</DIV>
<DIV>y</DIV>
<DIV>In file included from ./gthr-default.h:1,</DIV>
<DIV>from ../../llvm-gcc/gcc/gthr.h:114,</DIV>
<DIV>from ../../llvm-gcc/gcc/unwind-dw2.c:42:</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:46: error: expected `=', `,', `;', `asm' or `__a</DIV>
<DIV>ttribute__' before `__gthread_key_t'</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:47: error: expected `=', `,', `;', `asm' or `__a</DIV>
<DIV>ttribute__' before `__gthread_once_t'</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:48: error: expected `=', `,', `;', `asm' or `__a</DIV>
<DIV>ttribute__' before `__gthread_mutex_t'</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:49: error: expected `=', `,', `;', `asm' or `__a</DIV>
<DIV>ttribute__' before `__gthread_recursive_mutex_t'</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:92: error: `pthread_once' undeclared here (not i</DIV>
<DIV>n a function)</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:92: warning: type defaults to `int' in declarati</DIV>
<DIV>on of `__gthrw_pthread_once'</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:93: error: `pthread_getspecific' undeclared here</DIV>
<DIV>(not in a function)</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:93: warning: type defaults to `int' in declarati</DIV>
<DIV>on of `__gthrw_pthread_getspecific'</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:94: error: `pthread_setspecific' undeclared here</DIV>
<DIV>(not in a function)</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:94: warning: type defaults to `int' in declarati</DIV>
<DIV>on of `__gthrw_pthread_setspecific'</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:95: error: `pthread_create' undeclared here (not</DIV>
<DIV>in a function)</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:95: warning: type defaults to `int' in declarati</DIV>
<DIV>on of `__gthrw_pthread_create'</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:96: error: `pthread_cancel' undeclared here (not</DIV>
<DIV>in a function)</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:96: warning: type defaults to `int' in declarati</DIV>
<DIV>on of `__gthrw_pthread_cancel'</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:97: error: `pthread_mutex_lock' undeclared here</DIV>
<DIV>(not in a function)</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:97: warning: type defaults to `int' in declarati</DIV>
<DIV>on of `__gthrw_pthread_mutex_lock'</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:98: error: `pthread_mutex_trylock' undeclared he</DIV>
<DIV>re (not in a function)</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:98: warning: type defaults to `int' in declarati</DIV>
<DIV>on of `__gthrw_pthread_mutex_trylock'</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:99: error: `pthread_mutex_unlock' undeclared her</DIV>
<DIV>e (not in a function)</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:99: warning: type defaults to `int' in declarati</DIV>
<DIV>on of `__gthrw_pthread_mutex_unlock'</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:100: error: `pthread_mutex_init' undeclared here</DIV>
<DIV>(not in a function)</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:100: warning: type defaults to `int' in declarat</DIV>
<DIV>ion of `__gthrw_pthread_mutex_init'</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:103: error: `pthread_key_create' undeclared here</DIV>
<DIV>(not in a function)</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:103: warning: type defaults to `int' in declarat</DIV>
<DIV>ion of `__gthrw_pthread_key_create'</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:104: error: `pthread_key_delete' undeclared here</DIV>
<DIV>(not in a function)</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:104: warning: type defaults to `int' in declarat</DIV>
<DIV>ion of `__gthrw_pthread_key_delete'</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:105: error: `pthread_mutexattr_init' undeclared</DIV>
<DIV>here (not in a function)</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:105: warning: type defaults to `int' in declarat</DIV>
<DIV>ion of `__gthrw_pthread_mutexattr_init'</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:106: error: `pthread_mutexattr_settype' undeclar</DIV>
<DIV>ed here (not in a function)</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:106: warning: type defaults to `int' in declarat</DIV>
<DIV>ion of `__gthrw_pthread_mutexattr_settype'</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:107: error: `pthread_mutexattr_destroy' undeclar</DIV>
<DIV>ed here (not in a function)</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:107: warning: type defaults to `int' in declarat</DIV>
<DIV>ion of `__gthrw_pthread_mutexattr_destroy'</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:572: error: expected `)' before `*' token</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:581: error: expected `)' before `*' token</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:587: error: expected `)' before `key'</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:593: error: expected `)' before `key'</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:599: error: expected `)' before `key'</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:605: error: expected `)' before `*' token</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:614: error: expected `)' before `*' token</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:623: error: expected `)' before `*' token</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:633: error: expected `)' before `*' token</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:654: error: expected `)' before `*' token</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:660: error: expected `)' before `*' token</DIV>
<DIV>../../llvm-gcc/gcc/gthr-posix.h:666: error: expected `)' before `*' token</DIV>
<DIV>make[3]: *** [libgcc/./unwind-dw2.o] Error 1</DIV>
<DIV>make[3]: Leaving directory `/llvm/arm_objects/gcc'</DIV>
<DIV>make[2]: *** [libgcc.a] Error 2</DIV>
<DIV>make[2]: Leaving directory `/llvm/arm_objects/gcc'</DIV>
<DIV>make[1]: *** [all-gcc] Error 2</DIV>
<DIV>make[1]: Leaving directory `/llvm/arm_objects'</DIV>
<DIV>make: *** [all] Error 2</DIV></FONT>
<DIV><BR> </DIV>
<DIV>Can anyone please tell me the problem? </DIV>
<DIV> </DIV>
<DIV>Thanks,</DIV>
<DIV>Akramul</DIV>
<DIV><BR>--- On <B>Sun, 2/1/11, Bill Wendling <I><wendling@apple.com></I></B> wrote:<BR></DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid"><BR>From: Bill Wendling <wendling@apple.com><BR>Subject: Re: [LLVMdev] LLVM for ARM target<BR>To: "akramul azim" <bijoy123_8@yahoo.com><BR>Cc: "Anton Korobeynikov" <anton@korobeynikov.info>, llvmdev@cs.uiuc.edu<BR>Date: Sunday, 2 January, 2011, 6:07 AM<BR><BR>
<DIV class=plainMail>On Jan 1, 2011, at 8:29 PM, akramul azim wrote:<BR><BR>> Hi,<BR>>     I am planning to follow the steps to install LLVM for the ARM-target (Processor: Xscale, Architecture: armv5te):<BR>>  <BR>> 1. Install binutils-2.21 (downloaded from gnu.org)<BR>>  <BR>> Steps:<BR>>  <BR>> $ ./configure --target=arm-unknown-linux-gnueabi --program-prefix=arm- --prefix<BR>> =/llvm/arm --with-sysroot=/llvm/arms/sys-root<BR>>  <BR>> $ make<BR>>  <BR>> $ make install<BR>>  <BR>> <BR>> 2. Install LLVM<BR>>  <BR>> Steps<BR>>  <BR>> $ ../llvm-src/configure --target=arm-linux --prefix=/llvm/arm --disable-optimiz<BR>> ed --enable-bindings=none --disable-multilib --disable-bootstrap --with-sysroot<BR>> =/llvm/arms/sys-root --with-binutils-include=/llvm/binutils-2.21/include --with<BR>> -llvmgccdir=/llvm/llvm-gcc-4.2<BR>> 
 <BR>> $ make<BR>>  <BR>> $ make install<BR>>  <BR>> 3. Install LLVM-GCC<BR>>  <BR>> Steps:<BR>>  <BR>> $ ../llvm-gcc/configure --target=arm-linux --program-prefix=arm- --prefix=$PWD/<BR>> ../install --disable-optimized --enable-bindings=none --enable-llvm=$PWD/../llv<BR>> m-2.8 --enable-languages=c,c++ --disable-multilib --disable-bootstrap<BR>> $ make<BR>>  <BR>> $ make install<BR>>  <BR>>  <BR>> However, when I try to build LLVM source (second step) by make, I get the following error:<BR>>  <BR>> llvm[2]: Linking Debug Loadable Module LLVMgold.dll<BR>> /llvm/llvm-src/tools/gold/Debug/gold-plugin.o: In function `all_symbols_read_hoo<BR>> k':<BR>> /llvm/llvm-src/tools/gold/gold-plugin.cpp:364: undefined reference to `_lto_code<BR>> gen_create'<BR><BR>It looks like llvm/tools/lto wasn't built in step 1 (you can check to see if this is so). From
 the Makefile, it will built tools/lto when ENABLE_PIC is 1. Check to see what ENABLE_PIC is set to in the Makefile.config file. If it's not set, try using the --enable-pic flag during LLVM's configure.<BR><BR>-bw<BR><BR><BR></DIV></BLOCKQUOTE></td></tr></table><br>