0

I compiled hello.c program for c6x architecture:
gcc-4.8 -o hello -march='c64x' hello.c
But It got an error: error: bad value (c64x) for -march= switch
Seem gcc can't recognize c64x architecture!

I am using Ubuntu 12.04 LTS & gcc-4.8 version. Thank you!

cxphong
  • 847
  • 2
  • 9
  • 18
  • So you use `-march=c64x` to target the `c6x` architecture. A quick bit of Googling indicates that the terms "c64x" and "c6x" are either synonymous or closely related. I'm adding this comment in case people think it's a typo in your question (which was my first thought). – Keith Thompson Nov 14 '13 at 19:07

1 Answers1

2

-march=name This specifies the name of the target architecture.

But in your case target is TI (c64x) board i.e its arm architecture. to compile your program for arm architecture you need cross-compiler. But you trying to compile on x86gcc native-compiler with option -march which is different from target target. i.e "gcc" is a native compiler. In your case it appears you are not working on an ARM host, thus "gcc" will not compile for ARM on x86.

so download the cross-compiler tool chain and then compile your program with your options.

cross compiler for ubuntu is here

http://www.filewatcher.com/m/gcc-c6x-linux-gnu-4.7.1-0.1.20120606.fc18.1.i686.rpm.10801432-0.html

vinay hunachyal
  • 3,781
  • 2
  • 20
  • 31