Another avr-g++ problem

Hi,

I'm facing with the problem within the post: YaBB.pl?num=1195491175

I've tried to use --enable-languages=c,c++ but below you can see the output:

[root@home obj-avr]# ../configure --target=avr --prefix=/usr/local/avr --disable-nls --enable-languages=c,c++ --disable-libssp
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... avr-unknown-none
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for correct version of gmp.h... yes
checking for correct version of mpfr.h... buggy but acceptable
configure: error:
The following requested languages could not be built: c++
Supported languages are: c,treelang

And below the versions of the chain components:

[root@home obj-avr]# ll ../..
total 152440
drwxrwxrwx 5 107 wheel 4096 Aug 27 21:33 avrdude-5.10
-rw-r--r-- 1 root root 525750 Jan 19 2010 avrdude-5.10.tar.gz
drwxrwxrwx 11 107 wheel 4096 Aug 27 17:12 avr-libc-1.7.0
-rw-r--r-- 1 root root 1409160 Jun 16 23:29 avr-libc-1.7.0.tar.bz2
drwxr-xr-x 17 root root 4096 Aug 23 14:32 binutils-2.20
-rw-r--r-- 1 root root 23292219 Oct 16 2009 binutils-2.20.tar.gz
drwxr-xr-x 19 16446 ftp 4096 Aug 27 23:05 gcc-4.3.5
-rw-r--r-- 1 root root 130672640 Aug 27 15:59 gcc-core-4.3.5.tar

Any hints for this?

Thanks in advance,
BR,
CC

Did you add --with-dwarf2?

Also, try --enable-languages=c,c++ when you compile binutils too

--
Check out our new shield: http://www.ruggedcircuits.com/html/gadget_shield.html

Hmmm...I seem to remember a problem with the latest avr-gcc and avr-libc. I did a little experimenting to find tools that "play nice" together.

Here's how I built things from scratch on my Centos 5.5 workstations. I used to have a link to a site where I found instructions like these, but the link is now dead.

Oh, well...


*******************************************************
   Building avr-gcc for use with arduino on Centos 5
   ---davekw7x
*******************************************************

I downloaded and built from my home directory as follows:

mkdir ~/avr-gcc
cd ~/avr-gcc

----------------------------binutils---------------------------------
mkdir binutils
cd binutils

(Download binutils-2.20.1.tar.bz2 from http://ftp.gnu.org/gnu/binutils/)

tar jxvf binutils-2.20.1.tar.bz2
cd binutils-2.20.1
mkdir obj-avr
cd obj-avr
../configure --prefix=/usr/local --target=avr --disable-nls 2>& 1 | tee configure.log
make 2>& 1 | tee make.log
sudo make install 2>& 1 | tee make-install.log
----------------------------binutils---------------------------------

=====================================================================
=====================================================================

----------------------------gcc--------------------------------------
cd ~/avr-gcc
mkdir gcc
cd gcc

(Download gcc-4.3.4.tar.bz2 from a mirror at http://gcc.gnu.org)

tar jxvf gcc-4.3.4.tar.bz2
cd gcc-4.3.4
mkdir obj-avr
cd obj-avr
../configure --target=avr --enable-languages=c,c++ --disable-nls --disable-libssp --with-dwarf2 2>& 1 | tee configure.log
make 2 >& 1 | tee make.log
sudo make install 2>& 1 | tee make-install.log
----------------------------gcc------------

=====================================================================
=====================================================================

----------------------------avr-libc---------------------------------
mkdir avr-libc
cd avr-libc

(Download avr-libc-1.6.8.tar.bz2 from http://download.savannah.gnu.org/releases/avr-libc/)

tar jxvf avr-libc-1.6.8.tar.bz2
cd avr-libc-1.6.8
./configure --build=`./config.guess` --host=avr 2>& 1 | tee configure.log
make 2>& 1 | tee make.log

# You must be root to install in /usr or /usr/local or other system file names, so:

sudo su

# In case /usr/local/bin is not on root's PATH, make it so:
export PATH=/usr/local/bin:$PATH

make install 2>& 1 | tee make-install.log
----------------------------avr-libc---------------------------------
[hr]

In order to get things up and running on Centos 5.5 I had to do the following. For other distributions: YMMV (Your Mileage May Vary)

1. In order to run arduino, you must have privileges to write to /var/lock. So, if there is not a group named lock, then make one.
Add your user name to the lock group.

2. If you don't have read/write privileges to /dev/ttyUSB0, then add your user name to the uucp group.

Regards,

Dave

Footnote:
Building avrdude-5.10 was uneventful with gcc version 4.1.2, which is currently supplied with Centos 5.

Thanks a lot guys,

I'll give it a try and come back to you with the results.

BR,
CC

Hi,

No, it's not working.
[root@home obj-avr]# ../configure --target=avr --enable-languages=c,c++ --disable-nls --disable-libssp --with-dwarf2
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... avr-unknown-none
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for correct version of gmp.h... yes
checking for correct version of mpfr.h... buggy but acceptable
configure: error:
The following requested languages could not be built: c++
Supported languages are: c,treelang
[root@home obj-avr]# uname -a
Linux home 2.6.18-194.11.1.el5xen #1 SMP Tue Aug 10 20:27:58 EDT 2010 i686 i686 i386 GNU/Linux
[root@home obj-avr]# ech
[root@home obj-avr]# cat /etc/issue.net
CentOS release 5.5 (Final)
[root@home obj-avr]# ll ../..
total 253084
drwxrwxrwx 5 107 wheel 4096 Aug 27 21:33 avrdude-5.10
-rw-r--r-- 1 root root 525750 Jan 19 2010 avrdude-5.10.tar.gz
drwxrwxrwx 11 107 wheel 4096 Aug 27 17:12 avr-libc-1.7.0
-rw-r--r-- 1 root root 1409160 Jun 16 23:29 avr-libc-1.7.0.tar.bz2
drwxr-xr-x 18 root root 4096 Sep 7 02:38 binutils-2.20
-rw-r--r-- 1 root root 128808960 Oct 16 2009 binutils-2.20.tar
drwxrwxrwx 18 16446 ftp 4096 Sep 7 02:35 gcc-4.3.4
-rw-r--r-- 1 root root 128112640 Sep 7 02:33 gcc-core-4.3.4.tar

Any other ideas?
Any ENV vars customized by you?

BR,
CC

Did you build binutils first? I seem to remember after building binutils you had to set your PATH to point to where they are installed?

Maybe try these instructions:

http://www.nongnu.org/avr-libc/user-manual/install__tools.html

--
Check out our new shield: http://www.ruggedcircuits.com/html/gadget_shield.html

The following requested languages could not be built: c++
Supported languages are: c,treelang

Try


sudo yum install gcc-c++


Regards,

Dave

Hi all,

Thanks for the answers.
gcc-c++ is installed and I did rebuild binutils like Posted by: davekw7x, also tied a make clean/distclean with no results.
Maybe I need the dev package installed for gcc or gcc-c++
This ideea came to me now. But I'm at work with no access to my linux box. I'll try the ideea tonight and come back with feedback.

BR,
CC

What version of native C and C++ compilers do you have installed?
Have you looked at the configure log to see if it has any more details?

Hi guys,

I fixed it. Let's say that was my mistake.
Initially I was following this howto: tuxgraphics.org: Building your own avr-gcc environment with atmega328p capabilities, Linux

But I have read carefully the post of davekw7x and realised that I was reading between lines and in fact I should've download gcc not gcc-core like it says in the tutorial found at link above.

So I tried with gcc and now it works.
Thanks a lot davekw7x and to all of you that lost your time trying to give a solution.

BR,
CC

Hi,
Iam new in this comunity. I have installed the Arduine Software on my macBook and it worked fine. But I need it on my CentOS Linux machine and there I got problems in the compile step, because the avr-gcc is needed.
I have found your commands to get it working, but on my machine i got an error in compiling the avr-gcc :

checking for avr-gcc... /home/vdhart/avr-gcc/gcc/gcc-4.3.4/obj-avr/./gcc/xgcc -B/home/vdhart/avr-gcc/gcc/gcc-4.3.4/obj-avr/./gcc/ -B/usr/local/avr/bin/ -B/usr/local/avr/lib/ -isystem /usr/local/avr/include -isystem /usr/local/avr/sys-include
checking for suffix of object files... configure: error: cannot compute suffix of object files: cannot compile
See config.log' for more details. make[1]: *** [configure-target-libgcc] Error 1 make[1]: Leaving directory /home/vdhart/avr-gcc/gcc/gcc-4.3.4/obj-avr'
make: *** [all] Error 2

I can't imagine, what has gone wrong, but maybe you can tell me.

I have a second question for the last step. Is it true, that the avr-libc directory is a sub-directory in the obj-avr directory, because you didn#t go back to the avr-gcc directory?

Best regards and thanks in advance

Andre

Hi Andre,

I don't know.
Google gave me the following hint: http://www.linuxquestions.org/questions/linux-from-scratch-13/why-cannot-compute-suffix-of-object-files-350753/

BR,
CC

Hi,
I looked for that link and I found that my confdefs.h was empty. However I found also some other errors in the configure file eg the command
avr-gcc -V
with the answer that this command needs more input. The error was the -V insteat of the -v parameter. But then there were assmbler errors:

configure:3234: avr-gcc -o conftest conftest.c >&5
/tmp/ccOq9cI7.s: Assembler messages:
/tmp/ccOq9cI7.s:15: Error: too many memory references for in' /tmp/ccOq9cI7.s:16: Error: too many memory references for in'
/tmp/ccOq9cI7.s:19: Error: no such instruction: ldi r24,lo8(0)' /tmp/ccOq9cI7.s:20: Error: no such instruction: ldi r25,hi8(0)'
configure:3238: $? = 1
configure:3437: checking whether we are cross compiling
configure:3439: result: yes
configure:3443: checking for suffix of object files
configure:3469: avr-gcc -c conftest.c >&5
/tmp/ccN1pZ3f.s: Assembler messages:
/tmp/ccN1pZ3f.s:15: Error: too many memory references for in' /tmp/ccN1pZ3f.s:16: Error: too many memory references for in'
/tmp/ccN1pZ3f.s:19: Error: no such instruction: ldi r24,lo8(0)' /tmp/ccN1pZ3f.s:20: Error: no such instruction: ldi r25,hi8(0)'
configure:3473: $? = 1

I think this is the real error!

What can I do about this one, shall I get another version?

Thanks in advance

Andre