LLVM for ARM target



hi everyone,







I am new in LLVM. I am using this command to compile gcc or configure LLVM for the ARM target.







$ …/llvm-gcc-4.8/ configure --target=arm-linux --program-prefix=arm-



arm- --prefix=$PWD/… /install --disable-optimized --enable-bindings= none --enab**le-llvm=$PWD/…/ llvm-2.8 --enable-languages= c,c++







$ make







However, I get compile errors. So, i cannot execute make install.











I wonder that is this the right way to configure LLVM for compiling C programs for ARM target from my windows host machine(x86)?







Thanks.


|

I'm not sure which errors you're getting, but you should probably be using the `--disable-bootstrap' flag during configuration.

-bw


Hi,
I get the following error where the “make”(building) stops.

/MinGW/llvm/arm_objects/./gcc/xgcc -B/MinGW/llvm/arm_objects/./gcc/ -B/MinGW/llv
m/arm_objects/…/install/arm-linux/bin/ -B/MinGW/llvm/arm_objects/…/install/arm
-linux/lib/ -isystem /MinGW/llvm/arm_objects/…/install/arm-linux/include -isyst
em /MinGW/llvm/arm_objects/…/install/arm-linux/sys-include -O2 -O2 -g -O2 -DI
N_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition -isystem ./include -I. -I. -I…/.
./llvm-gcc-4.8/gcc -I…/…/llvm-gcc-4.8/gcc/. -I…/…/llvm-gcc-4.8/gcc/…/includ
e -I…/…/llvm-gcc-4.8/gcc/…/libcpp/include -I…/…/llvm-gcc-4.8/gcc/…/libdec
number -I…/libdecnumber -I/MinGW/llvm/arm_objects/…/llvm-2.8/include -I/MinGW/
llvm/llvm-2.8/include -g0 -finhibit-size-directive -fno-inline-functions -fno-e
xceptions -fno-zero-initialized-in-bss -fno-toplevel-reorder -Dinhibit_libc <br>-c …/…/llvm-gcc-4.8/gcc/crtstuff.c -DCRT_BEGIN <br>-o crtbegin.o
C:/MinGW/llvm/arm_objects/gcc/as: line 2: exec: -o: invalid option
exec: usage: exec [-cl] [-a name] file [redirection …]
make[3]: *** [crtbegin.o] Error 1
make[3]: Leaving directory /MinGW/llvm/arm_objects/gcc'<br>make[2]: *** [all-stage1-gcc] Error 2<br>make[2]: Leaving directory /MinGW/llvm/arm_objects’
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory /MinGW/llvm/arm_objects'<br>make: *** [all] Error 2<br><br>I tried --enable-bootstrap but get the same error.<br><br>Akramul<br><br>--- On __Wed, 29/12/10, Bill Wendling *<wendling@apple.com>*__ wrote:<br><br><br><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: llvmdev@cs.uiuc.edu<br>> Date: Wednesday, 29 December, 2010, 2:26 AM<br>> <br>> On Dec 28, 2010, at 8:06 AM, akramul azim wrote:<br>> <br>> > hi everyone,<br>> ><br>> > I am new in LLVM. I am using this command to compile gcc or configure LLVM for the ARM target.<br>> ><br>> > $ ../llvm-gcc-4.8/ configure --target=arm-linux --program-prefix=arm-<br>> > arm- --prefix=$PWD/.. /install --disable-optimized --enable-bindings= none --enable-llvm=$PWD/../ llvm-2.8 --enable-languages= c,c++<br>> ><br>> > $ make<br>> ><br>> > However, I get compile errors. So, i cannot execute make install.<br>> ><br>> ><br>> > I wonder that is this the right way to configure LLVM for compiling C programs for ARM target from my windows host machine(x86)?<br>> ><br>> I'm not sure which errors you're getting, but you should probably be using the –disable-bootstrap’ flag during configuration.
>
> -bw

|

Hello Akuramul,

I think you meant to type --disable-bootstrap instead of --enable-bootstrap.

Try it again,

--Sam

Hello

      \-c \.\./\.\./llvm\-gcc\-4\.8/gcc/crtstuff\.c \-DCRT\_BEGIN \\
      \-o crtbegin\.o

C:/MinGW/llvm/arm_objects/gcc/as: line 2: exec: -o: invalid option

You don't have cross ARM binutils installed.


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<br>k':<br>/llvm/llvm-src/tools/gold/gold-plugin.cpp:364: undefined reference to _lto_code
gen_create’
/llvm/llvm-src/tools/gold/gold-plugin.cpp:368: undefined reference to _lto_code<br>gen_add_module'<br>/llvm/llvm-src/tools/gold/gold-plugin.cpp:387: undefined reference to _lto_code
gen_add_must_preserve_symbol’
/llvm/llvm-src/tools/gold/gold-plugin.cpp:401: undefined reference to _lto_code<br>gen_dispose'<br>/llvm/llvm-src/tools/gold/gold-plugin.cpp:405: undefined reference to _lto_code
gen_set_pic_model’
/llvm/llvm-src/tools/gold/gold-plugin.cpp:406: undefined reference to _lto_code<br>gen_set_debug_model'<br>/llvm/llvm-src/tools/gold/gold-plugin.cpp:409: undefined reference to _lto_code
gen_set_assembler_path’
/llvm/llvm-src/tools/gold/gold-plugin.cpp:417: undefined reference to _lto_code<br>gen_set_assembler_args'<br>/llvm/llvm-src/tools/gold/gold-plugin.cpp:420: undefined reference to _lto_code
gen_set_cpu’
/llvm/llvm-src/tools/gold/gold-plugin.cpp:426: undefined reference to _lto_code<br>gen_debug_options'<br>/llvm/llvm-src/tools/gold/gold-plugin.cpp:439: undefined reference to _lto_code
gen_write_merged_modules’
/llvm/llvm-src/tools/gold/gold-plugin.cpp:447: undefined reference to _lto_code<br>gen_compile'<br>/llvm/llvm-src/tools/gold/gold-plugin.cpp:473: undefined reference to _lto_code
gen_dispose’
/llvm/llvm-src/tools/gold/Debug/gold-plugin.o: In function claim_file_hook':<br>/llvm/llvm-src/tools/gold/gold-plugin.cpp:264: undefined reference to _lto_modu
le_is_object_file_in_memory’
/llvm/llvm-src/tools/gold/gold-plugin.cpp:268: undefined reference to _lto_modu<br>le_is_object_file'<br>/llvm/llvm-src/tools/gold/gold-plugin.cpp:276: undefined reference to _lto_modu
le_create_from_memory’
/llvm/llvm-src/tools/gold/gold-plugin.cpp:276: undefined reference to _lto_modu<br>le_create'<br>/llvm/llvm-src/tools/gold/gold-plugin.cpp:280: undefined reference to lto_get
error_message’
/llvm/llvm-src/tools/gold/gold-plugin.cpp:285: undefined reference to _lto_modu<br>le_set_target_triple'<br>/llvm/llvm-src/tools/gold/gold-plugin.cpp:288: undefined reference to _lto_modu
le_get_num_symbols’
/llvm/llvm-src/tools/gold/gold-plugin.cpp:292: undefined reference to _lto_modu<br>le_get_symbol_attribute'<br>/llvm/llvm-src/tools/gold/gold-plugin.cpp:298: undefined reference to _lto_modu
le_get_symbol_name’
collect2: ld returned 1 exit status
make[2]: *** [/llvm/llvm-src/Debug/bin/LLVMgold.dll] Error 1
make[2]: Leaving directory /llvm/llvm-src/tools/gold'<br>make[1]: *** [all] Error 1<br>make[1]: Leaving directory /llvm/llvm-src/tools’
make: *** [all] Error 1

Can anyone please tell me is there any problem on my plan to build LLVM for the ARM target (for armv5te) and why I get the errors when building LLVM (make)?


Thanks,
Akramul

— On Thu, 30/12/10, Anton Korobeynikov anton@korobeynikov.info wrote:



> From: Anton Korobeynikov anton@korobeynikov.info
> Subject: Re: [LLVMdev] LLVM for ARM target
> To: “akramul azim” bijoy123_8@yahoo.com
> Cc: “Bill Wendling” wendling@apple.com, llvmdev@cs.uiuc.edu
> Date: Thursday, 30 December, 2010, 1:29 PM
>
> Hello
>
> > -c …/…/llvm-gcc-4.8/gcc/crtstuff.c -DCRT_BEGIN <br>> > -o crtbegin.o
> > C:/MinGW/llvm/arm_objects/gcc/as: line 2: exec: -o: invalid option
> You don’t have cross ARM binutils installed.
>
> –
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University

|

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

I tried adding --enable-pics but getting the same error. I opened the make file but don’t see any flag of enable_pics :-(. Is there any way to get around the problem?


Akramul

— On Sun, 2/1/11, Bill Wendling wendling@apple.com wrote:


> From: Bill Wendling wendling@apple.com
> Subject: Re: [LLVMdev] LLVM for ARM target
> To: “akramul azim” bijoy123_8@yahoo.com
> Cc: “Anton Korobeynikov” anton@korobeynikov.info, llvmdev@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<br>> > k':<br>> > /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


|


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'<br>make[2]: *** [libgcc.a] Error 2<br>make[2]: Leaving directory /llvm/arm_objects/gcc’
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory /llvm/arm_objects'<br>make: *** [all] Error 2<br><br>I also tried the following configuration:<br><br>$ ../llvm-gcc/configure --target=arm-linux --enable-pic --program-prefix=llvm-<br>--prefix=/llvm/install --disable-multilib --disable-optimized --enable-bindings<br>=none --enable-llvm=$PWD/../llvm-2.8 --enable-languages=c,c++ --disable-bootstr<br>ap --with-arch=armv5te<br><br>Then I get the following error when I run make:<br><br>$ make<br><br>/llvm/install/arm-linux/bin/ranlib ./libgcov.a<br>/llvm/arm_objects/./gcc/xgcc -B/llvm/arm_objects/./gcc/ -B/llvm/install/arm-linu<br>x/bin/ -B/llvm/install/arm-linux/lib/ -isystem /llvm/install/arm-linux/include -<br>isystem /llvm/install/arm-linux/sys-include --sysroot=yes -O2 -O2 -g -O2 --sys<br>root=yes -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wstric<br>t-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -f<br>omit-frame-pointer -fPIC -g0 -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_<br>NEEDED -Dinhibit_libc -I. -I. -I../../llvm-gcc/gcc -I../../llvm-gcc/gcc/. -I../.<br>./llvm-gcc/gcc/../include -I../../llvm-gcc/gcc/../libcpp/include -I../../llvm-g<br>cc/gcc/../libdecnumber -I../libdecnumber -I/llvm/arm_objects/../llvm-2.8/include<br>-I/llvm/llvm-2.8/include -fexceptions -fvisibility=hidden -DHIDE_EXPORTS -c ../<br>../llvm-gcc/gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o<br>'arm1026ej-s' is not a recognized processor for this target (ignoring processor)<br>'arm1026ej-s' is not a recognized processor for this target (ignoring processor)<br>In file included from ./gthr-default.h:1,<br>from ../../llvm-gcc/gcc/gthr.h:114,<br>from ../../llvm-gcc/gcc/unwind-dw2.c:42:<br>../../llvm-gcc/gcc/gthr-posix.h:43:21: error: pthread.h: No such file or directo<br>ry<br>../../llvm-gcc/gcc/gthr-posix.h:44:20: error: unistd.h: No such file or director<br>y<br>In file included from ./gthr-default.h:1,<br>from ../../llvm-gcc/gcc/gthr.h:114,<br>from ../../llvm-gcc/gcc/unwind-dw2.c:42:<br>../../llvm-gcc/gcc/gthr-posix.h:46: error: expected =’, ,', ;’, asm' or a
ttribute
’ before __gthread_key_t'<br>../../llvm-gcc/gcc/gthr-posix.h:47: error: expected =’, ,', ;’, asm' or a
ttribute
’ before __gthread_once_t'<br>../../llvm-gcc/gcc/gthr-posix.h:48: error: expected =’, ,', ;’, asm' or a
ttribute
’ before __gthread_mutex_t'<br>../../llvm-gcc/gcc/gthr-posix.h:49: error: expected =’, ,', ;’, asm' or a
ttribute
’ before __gthread_recursive_mutex_t'<br>../../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<br>on of __gthrw_pthread_once’
…/…/llvm-gcc/gcc/gthr-posix.h:93: error: pthread_getspecific' undeclared here<br>(not in a function)<br>../../llvm-gcc/gcc/gthr-posix.h:93: warning: type defaults to int’ in declarati
on of __gthrw_pthread_getspecific'<br>../../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<br>on of __gthrw_pthread_setspecific’
…/…/llvm-gcc/gcc/gthr-posix.h:95: error: pthread_create' undeclared here (not<br>in a function)<br>../../llvm-gcc/gcc/gthr-posix.h:95: warning: type defaults to int’ in declarati
on of __gthrw_pthread_create'<br>../../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<br>on of __gthrw_pthread_cancel’
…/…/llvm-gcc/gcc/gthr-posix.h:97: error: pthread_mutex_lock' undeclared here<br>(not in a function)<br>../../llvm-gcc/gcc/gthr-posix.h:97: warning: type defaults to int’ in declarati
on of __gthrw_pthread_mutex_lock'<br>../../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<br>on of __gthrw_pthread_mutex_trylock’
…/…/llvm-gcc/gcc/gthr-posix.h:99: error: pthread_mutex_unlock' undeclared her<br>e (not in a function)<br>../../llvm-gcc/gcc/gthr-posix.h:99: warning: type defaults to int’ in declarati
on of __gthrw_pthread_mutex_unlock'<br>../../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<br>ion of __gthrw_pthread_mutex_init’
…/…/llvm-gcc/gcc/gthr-posix.h:103: error: pthread_key_create' undeclared here<br>(not in a function)<br>../../llvm-gcc/gcc/gthr-posix.h:103: warning: type defaults to int’ in declarat
ion of __gthrw_pthread_key_create'<br>../../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<br>ion of __gthrw_pthread_key_delete’
…/…/llvm-gcc/gcc/gthr-posix.h:105: error: pthread_mutexattr_init' undeclared<br>here (not in a function)<br>../../llvm-gcc/gcc/gthr-posix.h:105: warning: type defaults to int’ in declarat
ion of __gthrw_pthread_mutexattr_init'<br>../../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<br>ion of __gthrw_pthread_mutexattr_settype’
…/…/llvm-gcc/gcc/gthr-posix.h:107: error: pthread_mutexattr_destroy' undeclar<br>ed here (not in a function)<br>../../llvm-gcc/gcc/gthr-posix.h:107: warning: type defaults to int’ in declarat
ion of __gthrw_pthread_mutexattr_destroy'<br>../../llvm-gcc/gcc/gthr-posix.h:572: error: expected )’ before *' token<br>../../llvm-gcc/gcc/gthr-posix.h:581: error: expected )’ before *' token<br>../../llvm-gcc/gcc/gthr-posix.h:587: error: expected )’ before key'<br>../../llvm-gcc/gcc/gthr-posix.h:593: error: expected )’ before key'<br>../../llvm-gcc/gcc/gthr-posix.h:599: error: expected )’ before key'<br>../../llvm-gcc/gcc/gthr-posix.h:605: error: expected )’ before *' token<br>../../llvm-gcc/gcc/gthr-posix.h:614: error: expected )’ before *' token<br>../../llvm-gcc/gcc/gthr-posix.h:623: error: expected )’ before *' token<br>../../llvm-gcc/gcc/gthr-posix.h:633: error: expected )’ before *' token<br>../../llvm-gcc/gcc/gthr-posix.h:654: error: expected )’ before *' token<br>../../llvm-gcc/gcc/gthr-posix.h:660: error: expected )’ before *' token<br>../../llvm-gcc/gcc/gthr-posix.h:666: error: expected )’ before *' token<br>make[3]: *** [libgcc/./unwind-dw2.o] Error 1<br>make[3]: Leaving directory /llvm/arm_objects/gcc’
make[2]: *** [libgcc.a] Error 2
make[2]: Leaving directory /llvm/arm_objects/gcc'<br>make[1]: *** [all-gcc] Error 2<br>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@apple.com wrote:



> From: Bill Wendling wendling@apple.com
> Subject: Re: [LLVMdev] LLVM for ARM target
> To: “akramul azim” bijoy123_8@yahoo.com
> Cc: “Anton Korobeynikov” anton@korobeynikov.info, llvmdev@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<br>> > k':<br>> > /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

|

Can anyone please tell me the problem?

It seems you don't have the standard C library for ARM around.

Can you please tell me what should I do at this point? How to get the standard C library for ARM around?

I also tried to build http://llvm.org/svn/llvm-project/llvm/trunk/utils/crosstool/ in CYGWIN. However, my LLVM building was failed when I run the script. I am in dilemma what steps i should follow. Please help me.

Thanks a lot
Akramul

— On Tue, 4/1/11, Anton Korobeynikov anton@korobeynikov.info wrote:


> From: Anton Korobeynikov anton@korobeynikov.info
> Subject: Re: [LLVMdev] LLVM for ARM target
> To: “akramul azim” bijoy123_8@yahoo.com
> Cc: “Bill Wendling” wendling@apple.com, llvmdev@cs.uiuc.edu
> Date: Tuesday, 4 January, 2011, 8:41 PM
>
> > Can anyone please tell me the problem?
> It seems you don’t have the standard C library for ARM around.
>
> –
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University

|

Can you please tell me what should I do at this point? How to get the standard C library for ARM around?

The best thing is to grab some description how to build "normal" gcc
for your target and make sure all the steps described there will be
ok.
After this you can substitute normal gcc with llvm-gcc and start the
same scenario from scratch.

I believe this is the best way how the newcomer can proceed with such
a complex procedure.


Thanks for your suggestions. I am trying to install cross gcc in my another PC then. Btw, I tried the automated scripts (create-snapshots.sh and build-install-linux.sh) that are in the LLVM repository for building crosstoll for ARM (http://llvm.org/svn/llvm-project/llvm/trunk/utils/crosstool/) but get the following error for building llvm-gcc (llvm built successfully):

‘arm1026ej-s’ is not a recognized processor for this target (ignoring processor)
‘arm1026ej-s’ is not a recognized processor for this target (ignoring processor)
/tmp/llvm-project.YZQXqN/src/llvm-gcc-4.2/gcc/crtstuff.c:1: internal compiler er
ror: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://llvm.org/bugs/> for instructions.
make[2]: *** [crtbegin.o] Error 1
make[2]: Leaving directory /tmp/llvm-project.YZQXqN/obj/llvm-gcc-4.2/gcc'<br>make[1]: *** [all-gcc] Error 2<br>make[1]: Leaving directory /tmp/llvm-project.YZQXqN/obj/llvm-gcc-4.2’
make: *** [all] Error 2
~

I am using the latest version of LLVM and LLVM-GCC from SVN (version number: 122872). And I am using arm-2009q1-176-arm-none-linux-gnueabi-i686-mingw32.tar.bz2. I am using CygWin. Can anyone please tell me what is the reason of the problem?

Akramul
— On Wed, 5/1/11, Anton Korobeynikov anton@korobeynikov.info wrote:



> From: Anton Korobeynikov anton@korobeynikov.info
> Subject: Re: [LLVMdev] LLVM for ARM target
> To: “akramul azim” bijoy123_8@yahoo.com
> Cc: “Bill Wendling” wendling@apple.com, llvmdev@cs.uiuc.edu
> Date: Wednesday, 5 January, 2011, 4:30 PM
>
> > Can you please tell me what should I do at this point? How to get the standard C library for ARM around?
> The best thing is to grab some description how to build “normal” gcc
> for your target and make sure all the steps described there will be
> ok.
> After this you can substitute normal gcc with llvm-gcc and start the
> same scenario from scratch.
>
> I believe this is the best way how the newcomer can proceed with such
> a complex procedure.
>
> –
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University

|