17.7.2012 21:31, Sylvain Leroux kirjoitti:
Hi,
I'm tying to compile gcc for AVR. configure, make and make install
went smoothly (i.e.: without any /visible/ error) - but I noticed that
'g++' was installed but not 'gcc'. I spend a lot of time trying and
googling without much progress.
I have all the required dependencies and a working gcc/binutils/libc
for my platform (Debian Squeeze x86_64). Here is my setting:
sh$ export VERSION=4.7.1
sh$ wget
"ftp://ftp.gnu.org/gnu/gcc/gcc-${VERSION}/gcc-${VERSION}.tar.bz2"
sh$ tar xjf gcc-${VERSION}.tar.bz2
sh$ mkdir gcc-${VERSION}-build
sh$ cd gcc-${VERSION}-build/
sh$ ../gcc-${VERSION}/configure --prefix=/tmp/gcc-${VERSION} \
--program-prefix=avr-
--program-suffix=-${VERSION} \
--target=avr \
--enable-languages=c,c++
sh$ make -j9
sh$ make install
At this point, when looking in the installation directory, I notice
that 'g++' is there, but not 'gcc':
sh$ ls /tmp/gcc-4.7.1/bin/
avr-c++-4.7.1 avr-g++-4.7.1 avr-gcc-nm-4.7.1 avr-gcov-4.7.1
avr-cpp-4.7.1 avr-gcc-ar-4.7.1 avr-gcc-ranlib-4.7.1
As Georg-Johann wrote, a '$target-gcc-$gcc_version' binary will be
installed always, the given
<program-prefix> and <program-suffix> have no influence to this install
name. So when you
unexpectedly? set your <program-prefix> = $target- and <program-suffix>
= -$gcc_version
then something unexpected can be as the result :(
I tried my "usual" quite similar configuration settings and got :
[root@HP-Pavilion bin]# ls avr-*
avr-addr2line avr-cpp-4.7 avr-gcc-ar-4.7 avr-ld avr-ranlib
avr-ar avr-elfedit avr-gcc-nm-4.7 avr-ld.bfd avr-readelf
avr-as avr-g++-4.7 avr-gcc-ranlib-4.7 avr-nm avr-size
avr-c++-4.7 avr-gcc-4.7 avr-gcov-4.7 avr-objcopy avr-strings
avr-c++filt avr-gcc-4.7.1 avr-gprof avr-objdump avr-strip
[root@HP-Pavilion bin]# pwd
/opt/cross/bin
As can be seen my choice is to use the "major_version.minor_version",
here "4.7", as the
"$gcc_version", not putting the "bugfix_release" into it at all -
updating the GCC with a
newer bugfix_release will overwrite the earlier one...
By looking at the output of 'make install' I notice an error while
copying gcc-cross:
-------8<----------
rm -f /tmp/gcc-4.7.1/bin/avr-gcc-4.7.1
/usr/bin/install -c xgcc /tmp/gcc-4.7.1/bin/avr-gcc-4.7.1
rm -f /tmp/gcc-4.7.1/bin/avr-gcc-4.7.1
( cd /tmp/gcc-4.7.1/bin && \
ln avr-gcc-4.7.1 avr-gcc-4.7.1 ) <<<<<<< STRANGE ???
Knowing what I previously wrote this is understandable :
1. the existing <program-prefix>gcc<program-suffix> will be removed and
replaced with
a new one
2. the existing $target-gcc-$gcc_version will be removed and replaced
with a link to the
earlier installed <program-prefix>gcc<program-suffix>
Another thing which is totally "unexpected" is the install folder.
Everyone is expected to
know what the '/tmp' folder is :
http://en.wikipedia.org/wiki/Temporary_folder
The: "Many operating systems and some software automatically delete the
contents of
this directory at bootup or at regular intervals" alone will make this
choice absurd :(