Hi, I am trying to use LLVM on x86 with some code intended for another
architecture (IBM Cell). The plan is:
1. foreach $c_files
llvm-gcc -emit-llvm -c -o $bc_file $c_file
2. link $bc_files
3. run my passes with 'opt'
4. llc -march=c
5. cell_cc
The original code is for the Cell, and uses altivec intrinsics. However,
llvm-gcc complains about not recognizing them. I read that there is
an -maltivec flag for the LLVM PowerPC backend, but my version of llvm-gcc
complains about this "unrecognized command line option." Any hints?
Thanks.
(Please CC me as I am not subscribed to this list)
Any pointers on how to do this? I'm able to build llvm-gcc-4.2 x86 natively,
but not the powerpc version.
Using "--disable-shared --disable-multilib --disable-bootstrap" as additional
flags, I've tried:
powerpc-linux
powerpc64-linux
CellSPU-linux
as the target, but powerpc* dies with rs6000.c and the CellSPU target wasn't
recognized. Setting --with-sysroot didn't help either.
I haven't tried this before myself. But you may need to set the --build, --host, and --target flags to their appropriate values. You can run "config.guess" to see an example of what some of those values should be. As for the values for the target machine, I'm not sure how to get those. Check config.guess again to see what it does.
Hi, I'm still working on this problem by first trying code without the Altivec
intrinsics. I'm trying to use the cross compiler on the c code outputted
by "llc -march c" and have run into this linker problem (spewed by the cross
compiler):
Command line : error: L0039: reference to undefined symbol .fopen64 in
file /tmp/cc4tgLu5.o
Command line : error: L0039: reference to undefined symbol ._IO_putc in
file /tmp/cc4tgLu5.o
Command line : error: L0039: reference to undefined symbol ._IO_getc in
file /tmp/cc4tgLu5.o
Command line : error: L0039: reference to undefined symbol .stat64 in
file /tmp/cc4tgLu5.o
Command line : error: L0039: reference to undefined symbol .popen in
file /tmp/cc4tgLu5.o
Command line : error: L0039: reference to undefined symbol .pclose in
file /tmp/cc4tgLu5.o
Command line : error: L0039: reference to undefined symbol .gettimeofday in
file /tmp/cc4tgLu5.o
...and so on. Any reason why llc is generating these symbols with a "." in
front of them?
Hi, I'm still working on this problem by first trying code without the Altivec
intrinsics. I'm trying to use the cross compiler on the c code outputted
by "llc -march c" and have run into this linker problem (spewed by the cross
compiler):
If you want to use llvm-gcc as a cross compiler, you must configure it as a cross compiler, and compile the output with the appropriate cross toolchain. LLVM does not implicitly make your code portable, see: http://llvm.org/docs/tutorial/LangImpl8.html#targetindep
for example.
-Chris
Command line : error: L0039: reference to undefined symbol .fopen64 in
file /tmp/cc4tgLu5.o
Command line : error: L0039: reference to undefined symbol ._IO_putc in
file /tmp/cc4tgLu5.o
Command line : error: L0039: reference to undefined symbol ._IO_getc in
file /tmp/cc4tgLu5.o
Command line : error: L0039: reference to undefined symbol .stat64 in
file /tmp/cc4tgLu5.o
Command line : error: L0039: reference to undefined symbol .popen in
file /tmp/cc4tgLu5.o
Command line : error: L0039: reference to undefined symbol .pclose in
file /tmp/cc4tgLu5.o
Command line : error: L0039: reference to undefined symbol .gettimeofday in
file /tmp/cc4tgLu5.o
...and so on. Any reason why llc is generating these symbols with a "." in
front of them?