[LLVMdev] LLVM for ARM target

akramul azim bijoy123_8 at yahoo.com
Tue Jan 4 11:09:18 PST 2011


At the last step of building llvm for arm target, I am unable to build llvm-gcc. I am trying the follwing options:
 
$ ../llvm-gcc/configure --target=arm-linux --enable-pic --program-prefix=llvm-
--prefix=/llvm/install --disable-multilib --disable-optimized --enable-bindings
=none --enable-llvm=$PWD/../llvm-2.8 --enable-languages=c,c++ --disable-bootstr
ap
 
Then I get the following error when I run make:
 
$ make
 
../../llvm-gcc/gcc/config/arm/lib1funcs.asm:93:2: error: #error Unable to determ
ine architecture.
make[3]: *** [libgcc/./_udivsi3_s.o] Error 1
make[3]: Leaving directory `/llvm/arm_objects/gcc'
make[2]: *** [libgcc.a] Error 2
make[2]: Leaving directory `/llvm/arm_objects/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/llvm/arm_objects'
make: *** [all] Error 2
 
I also tried the following configuration:
 
$ ../llvm-gcc/configure --target=arm-linux --enable-pic --program-prefix=llvm-
--prefix=/llvm/install --disable-multilib --disable-optimized --enable-bindings
=none --enable-llvm=$PWD/../llvm-2.8 --enable-languages=c,c++ --disable-bootstr
ap --with-arch=armv5te 
 
Then I get the following error when I run make:
 
$ make
 
/llvm/install/arm-linux/bin/ranlib ./libgcov.a
/llvm/arm_objects/./gcc/xgcc -B/llvm/arm_objects/./gcc/ -B/llvm/install/arm-linu
x/bin/ -B/llvm/install/arm-linux/lib/ -isystem /llvm/install/arm-linux/include -
isystem /llvm/install/arm-linux/sys-include --sysroot=yes -O2 -O2 -g -O2 --sys
root=yes -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wstric
t-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -f
omit-frame-pointer -fPIC -g0 -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_
NEEDED -Dinhibit_libc -I. -I. -I../../llvm-gcc/gcc -I../../llvm-gcc/gcc/. -I../.
./llvm-gcc/gcc/../include -I../../llvm-gcc/gcc/../libcpp/include -I../../llvm-g
cc/gcc/../libdecnumber -I../libdecnumber -I/llvm/arm_objects/../llvm-2.8/include
-I/llvm/llvm-2.8/include -fexceptions -fvisibility=hidden -DHIDE_EXPORTS -c ../
../llvm-gcc/gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o
'arm1026ej-s' is not a recognized processor for this target (ignoring processor)
'arm1026ej-s' is not a recognized processor for this target (ignoring processor)
In file included from ./gthr-default.h:1,
from ../../llvm-gcc/gcc/gthr.h:114,
from ../../llvm-gcc/gcc/unwind-dw2.c:42:
../../llvm-gcc/gcc/gthr-posix.h:43:21: error: pthread.h: No such file or directo
ry
../../llvm-gcc/gcc/gthr-posix.h:44:20: error: unistd.h: No such file or director
y
In file included from ./gthr-default.h:1,
from ../../llvm-gcc/gcc/gthr.h:114,
from ../../llvm-gcc/gcc/unwind-dw2.c:42:
../../llvm-gcc/gcc/gthr-posix.h:46: error: expected `=', `,', `;', `asm' or `__a
ttribute__' before `__gthread_key_t'
../../llvm-gcc/gcc/gthr-posix.h:47: error: expected `=', `,', `;', `asm' or `__a
ttribute__' before `__gthread_once_t'
../../llvm-gcc/gcc/gthr-posix.h:48: error: expected `=', `,', `;', `asm' or `__a
ttribute__' before `__gthread_mutex_t'
../../llvm-gcc/gcc/gthr-posix.h:49: error: expected `=', `,', `;', `asm' or `__a
ttribute__' before `__gthread_recursive_mutex_t'
../../llvm-gcc/gcc/gthr-posix.h:92: error: `pthread_once' undeclared here (not i
n a function)
../../llvm-gcc/gcc/gthr-posix.h:92: warning: type defaults to `int' in declarati
on of `__gthrw_pthread_once'
../../llvm-gcc/gcc/gthr-posix.h:93: error: `pthread_getspecific' undeclared here
(not in a function)
../../llvm-gcc/gcc/gthr-posix.h:93: warning: type defaults to `int' in declarati
on of `__gthrw_pthread_getspecific'
../../llvm-gcc/gcc/gthr-posix.h:94: error: `pthread_setspecific' undeclared here
(not in a function)
../../llvm-gcc/gcc/gthr-posix.h:94: warning: type defaults to `int' in declarati
on of `__gthrw_pthread_setspecific'
../../llvm-gcc/gcc/gthr-posix.h:95: error: `pthread_create' undeclared here (not
in a function)
../../llvm-gcc/gcc/gthr-posix.h:95: warning: type defaults to `int' in declarati
on of `__gthrw_pthread_create'
../../llvm-gcc/gcc/gthr-posix.h:96: error: `pthread_cancel' undeclared here (not
in a function)
../../llvm-gcc/gcc/gthr-posix.h:96: warning: type defaults to `int' in declarati
on of `__gthrw_pthread_cancel'
../../llvm-gcc/gcc/gthr-posix.h:97: error: `pthread_mutex_lock' undeclared here
(not in a function)
../../llvm-gcc/gcc/gthr-posix.h:97: warning: type defaults to `int' in declarati
on of `__gthrw_pthread_mutex_lock'
../../llvm-gcc/gcc/gthr-posix.h:98: error: `pthread_mutex_trylock' undeclared he
re (not in a function)
../../llvm-gcc/gcc/gthr-posix.h:98: warning: type defaults to `int' in declarati
on of `__gthrw_pthread_mutex_trylock'
../../llvm-gcc/gcc/gthr-posix.h:99: error: `pthread_mutex_unlock' undeclared her
e (not in a function)
../../llvm-gcc/gcc/gthr-posix.h:99: warning: type defaults to `int' in declarati
on of `__gthrw_pthread_mutex_unlock'
../../llvm-gcc/gcc/gthr-posix.h:100: error: `pthread_mutex_init' undeclared here
(not in a function)
../../llvm-gcc/gcc/gthr-posix.h:100: warning: type defaults to `int' in declarat
ion of `__gthrw_pthread_mutex_init'
../../llvm-gcc/gcc/gthr-posix.h:103: error: `pthread_key_create' undeclared here
(not in a function)
../../llvm-gcc/gcc/gthr-posix.h:103: warning: type defaults to `int' in declarat
ion of `__gthrw_pthread_key_create'
../../llvm-gcc/gcc/gthr-posix.h:104: error: `pthread_key_delete' undeclared here
(not in a function)
../../llvm-gcc/gcc/gthr-posix.h:104: warning: type defaults to `int' in declarat
ion of `__gthrw_pthread_key_delete'
../../llvm-gcc/gcc/gthr-posix.h:105: error: `pthread_mutexattr_init' undeclared
here (not in a function)
../../llvm-gcc/gcc/gthr-posix.h:105: warning: type defaults to `int' in declarat
ion of `__gthrw_pthread_mutexattr_init'
../../llvm-gcc/gcc/gthr-posix.h:106: error: `pthread_mutexattr_settype' undeclar
ed here (not in a function)
../../llvm-gcc/gcc/gthr-posix.h:106: warning: type defaults to `int' in declarat
ion of `__gthrw_pthread_mutexattr_settype'
../../llvm-gcc/gcc/gthr-posix.h:107: error: `pthread_mutexattr_destroy' undeclar
ed here (not in a function)
../../llvm-gcc/gcc/gthr-posix.h:107: warning: type defaults to `int' in declarat
ion of `__gthrw_pthread_mutexattr_destroy'
../../llvm-gcc/gcc/gthr-posix.h:572: error: expected `)' before `*' token
../../llvm-gcc/gcc/gthr-posix.h:581: error: expected `)' before `*' token
../../llvm-gcc/gcc/gthr-posix.h:587: error: expected `)' before `key'
../../llvm-gcc/gcc/gthr-posix.h:593: error: expected `)' before `key'
../../llvm-gcc/gcc/gthr-posix.h:599: error: expected `)' before `key'
../../llvm-gcc/gcc/gthr-posix.h:605: error: expected `)' before `*' token
../../llvm-gcc/gcc/gthr-posix.h:614: error: expected `)' before `*' token
../../llvm-gcc/gcc/gthr-posix.h:623: error: expected `)' before `*' token
../../llvm-gcc/gcc/gthr-posix.h:633: error: expected `)' before `*' token
../../llvm-gcc/gcc/gthr-posix.h:654: error: expected `)' before `*' token
../../llvm-gcc/gcc/gthr-posix.h:660: error: expected `)' before `*' token
../../llvm-gcc/gcc/gthr-posix.h:666: error: expected `)' before `*' token
make[3]: *** [libgcc/./unwind-dw2.o] Error 1
make[3]: Leaving directory `/llvm/arm_objects/gcc'
make[2]: *** [libgcc.a] Error 2
make[2]: Leaving directory `/llvm/arm_objects/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/llvm/arm_objects'
make: *** [all] Error 2

 
Can anyone please tell me the problem? 
 
Thanks,
Akramul

--- On Sun, 2/1/11, Bill Wendling <wendling at apple.com> wrote:


From: Bill Wendling <wendling at apple.com>
Subject: Re: [LLVMdev] LLVM for ARM target
To: "akramul azim" <bijoy123_8 at yahoo.com>
Cc: "Anton Korobeynikov" <anton at korobeynikov.info>, llvmdev at cs.uiuc.edu
Date: Sunday, 2 January, 2011, 6:07 AM


On Jan 1, 2011, at 8:29 PM, akramul azim wrote:

> Hi,
>     I am planning to follow the steps to install LLVM for the ARM-target (Processor: Xscale, Architecture: armv5te):
>  
> 1. Install binutils-2.21 (downloaded from gnu.org)
>  
> Steps:
>  
> $ ./configure --target=arm-unknown-linux-gnueabi --program-prefix=arm- --prefix
> =/llvm/arm --with-sysroot=/llvm/arms/sys-root
>  
> $ make
>  
> $ make install
>  
> 
> 2. Install LLVM
>  
> Steps
>  
> $ ../llvm-src/configure --target=arm-linux --prefix=/llvm/arm --disable-optimiz
> ed --enable-bindings=none --disable-multilib --disable-bootstrap --with-sysroot
> =/llvm/arms/sys-root --with-binutils-include=/llvm/binutils-2.21/include --with
> -llvmgccdir=/llvm/llvm-gcc-4.2
>  
> $ make
>  
> $ make install
>  
> 3. Install LLVM-GCC
>  
> Steps:
>  
> $ ../llvm-gcc/configure --target=arm-linux --program-prefix=arm- --prefix=$PWD/
> ../install --disable-optimized --enable-bindings=none --enable-llvm=$PWD/../llv
> m-2.8 --enable-languages=c,c++ --disable-multilib --disable-bootstrap
> $ make
>  
> $ make install
>  
>  
> However, when I try to build LLVM source (second step) by make, I get the following error:
>  
> llvm[2]: Linking Debug Loadable Module LLVMgold.dll
> /llvm/llvm-src/tools/gold/Debug/gold-plugin.o: In function `all_symbols_read_hoo
> k':
> /llvm/llvm-src/tools/gold/gold-plugin.cpp:364: undefined reference to `_lto_code
> gen_create'

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.

-bw




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110104/73025ed0/attachment.html>


More information about the llvm-dev mailing list