4.6.2012 7:17, Georg-Johann Lay kirjoitti:
David Akodes schrieb:
My objective is to cross-compile on my own system a program for the
C64x+ architecture.
I am using the command
gcc test.c -march=c64x+
However, this fails and I receive the error message: [...]
The naming for a cross compiler to compile for that hardware would be
c6x-gcc
"gcc" is a native compiler. In your case it appears you are working on
an ARM host, thus "gcc" will compile on ARM for ARM.
Maybe there is a cross GCC for ARM and its GCC-driver named as 'gcc'?
In any case mentioning the development platform could help, at least
if wondering whether there is a prebuilt GCC for the target in question
and for that development host. For instance for Fedora 17 Linux, i686
and x86_64 variations, there seems to be, like :
[root@HP-Pavilion bin]# ./c6x-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=./c6x-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/home/kai/temp/usr/bin/../libexec/gcc/c6x-uclinux/4.7.0/lto-wrapper
Target: c6x-uclinux
Configured with: ../gcc-4.7.0/configure --disable-dependency-tracking
--disable-silent-rules --prefix=/usr --exec-prefix=/usr
--bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
--datadir=/usr/share --includedir=/usr/include --libexecdir=/usr/libexec
--localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man
--infodir=/usr/share/info --build=i686-redhat-linux-gnu
--host=i686-redhat-linux-gnu --target=c6x-uclinux --enable-targets=all
--program-prefix=c6x-linux-gnu- --enable-languages=c --without-headers
--enable-sjlj-exceptions --with-system-libunwind --disable-nls
--disable-threads --disable-shared --disable-libmudflap --disable-libssp
--disable-libgomp --disable-libquadmath --disable-gold
--disable-decimal-float --enable-checking= --enable-gnu-unique-object
--enable-linker-build-id --disable-plugin --enable-nls
--with-system-zlib --with-bugurl=http://bugzilla.redhat.com/bugzilla/
--enable-obsolete
Thread model: single
gcc version 4.7.0 20120322 (Red Hat 4.7.0-1) (GCC)
(the i686 host one). This was downloaded from :
http://pkgs.org/fedora-17/fedora-updates-testing-i386/gcc-c6x-linux-gnu-4.7.0-1.fc17.i686.rpm/download/
and produces code for 'c6x-uclinux' as can be seen. Another target
choice could be 'tic6x-elf' or 'c6x-elf', the 'c6x' is recognized
as 'tic6x' :
[root@HP-Pavilion gcc-4.7.0]# ./config.sub c6x-uclinux
tic6x-unknown-uclinux
[root@HP-Pavilion gcc-4.7.0]# ./config.sub c6x-elf
tic6x-unknown-elf
With the bare CPU name the chosen target (object format) will be :
[root@HP-Pavilion gcc-4.7.0]# ./config.sub c6x
tic6x-unknown-coff
Building from sources is possible but maybe it could be recommended
one to see a cross compiler before trying to build such, just as it
would be recommended to see and use a car before trying to build one :-)