public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc install fails silently (AVR build)
@ 2012-07-17 18:31 Sylvain Leroux
  2012-07-18 19:37 ` Georg-Johann Lay
  2012-07-19 13:00 ` Kai Ruottu
  0 siblings, 2 replies; 7+ messages in thread
From: Sylvain Leroux @ 2012-07-17 18:31 UTC (permalink / raw)
  To: gcc-help

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

*But*, the cross compiler are present in the build directory:
  sh$ ls -l gcc/*cross*
-rwxr-xr-x 1 sylvain sylvain 1667242 Jul 17 19:52 gcc/gcc-cross
-rwxr-xr-x 1 sylvain sylvain 1680692 Jul 17 19:52 gcc/g++-cross


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 ???
ln: accessing `avr-gcc-4.7.1': No such file or directory
make[2]: [install-driver] Error 1 (ignored)       <<<<<<<  ERROR !!!
if [ -f gcc-cross ] ; then \
           if [ -d 
/tmp/gcc-4.7.1/lib/gcc/avr/4.7.1/../../../../avr/bin/. ] ; then \
             rm -f 
/tmp/gcc-4.7.1/lib/gcc/avr/4.7.1/../../../../avr/bin/gcc; \
             /usr/bin/install -c gcc-cross 
/tmp/gcc-4.7.1/lib/gcc/avr/4.7.1/../../../../avr/bin/gcc; \
           else true; fi; \
         else \
           rm -f /tmp/gcc-4.7.1/bin/avr-gcc-tmp; \
           ( cd /tmp/gcc-4.7.1/bin && \
             ln avr-gcc-4.7.1 avr-gcc-tmp && \
             mv -f avr-gcc-tmp avr-avr-gcc-4.7.1 ); \
         fi
-------8<----------

There is something strange here: the script try to link gcc on itself 
(ln avr-gcc-4.7.1 avr-gcc-4.7.1) in the destination folder just after 
having removed it if present (rm -f /tmp/gcc-4.7.1/bin/avr-gcc-4.7.1) 
and before actually copying it ???

Obviously something went bad there. I suspect I was doing the wrong way 
at configure-time: while I reconfigure without 
''--program-prefix=avr-'', ''make install'' install ''avr-gcc-4.7.1'' in 
the destination directory, but all the other binaries are without the 
''avr-'' prefix (like ''g++-4.7.1'').

Anyway, the really puzzling thing here is that in on case it works for 
g++ (''avr-g++-4.7.1'') but not gcc - and the other case this is the 
opposite... Is there any way to have all the executables installed with 
their name rewritten as ''avr-XXXX-4.7.1''?


I would be very grateful for any help or pointer with this issue,
Thanks in advance,
- Sylvain.


PS/I tried the same configuration with 4.6.3 and obtained the exact same 
result...

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gcc install fails silently (AVR build)
  2012-07-17 18:31 gcc install fails silently (AVR build) Sylvain Leroux
@ 2012-07-18 19:37 ` Georg-Johann Lay
  2012-07-18 21:01   ` Sylvain Leroux
  2012-07-19 13:00 ` Kai Ruottu
  1 sibling, 1 reply; 7+ messages in thread
From: Georg-Johann Lay @ 2012-07-18 19:37 UTC (permalink / raw)
  To: Sylvain Leroux; +Cc: gcc-help

Sylvain Leroux schrieb:
> 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
> 
> *But*, the cross compiler are present in the build directory:
>  sh$ ls -l gcc/*cross*
> -rwxr-xr-x 1 sylvain sylvain 1667242 Jul 17 19:52 gcc/gcc-cross
> -rwxr-xr-x 1 sylvain sylvain 1680692 Jul 17 19:52 gcc/g++-cross
> 
> 
> 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 ???
> ln: accessing `avr-gcc-4.7.1': No such file or directory
> make[2]: [install-driver] Error 1 (ignored)       <<<<<<<  ERROR !!!
> if [ -f gcc-cross ] ; then \
>           if [ -d /tmp/gcc-4.7.1/lib/gcc/avr/4.7.1/../../../../avr/bin/. 
> ] ; then \
>             rm -f 
> /tmp/gcc-4.7.1/lib/gcc/avr/4.7.1/../../../../avr/bin/gcc; \
>             /usr/bin/install -c gcc-cross 
> /tmp/gcc-4.7.1/lib/gcc/avr/4.7.1/../../../../avr/bin/gcc; \
>           else true; fi; \
>         else \
>           rm -f /tmp/gcc-4.7.1/bin/avr-gcc-tmp; \
>           ( cd /tmp/gcc-4.7.1/bin && \
>             ln avr-gcc-4.7.1 avr-gcc-tmp && \
>             mv -f avr-gcc-tmp avr-avr-gcc-4.7.1 ); \
>         fi
> -------8<----------
> 
> There is something strange here: the script try to link gcc on itself 
> (ln avr-gcc-4.7.1 avr-gcc-4.7.1) in the destination folder just after 
> having removed it if present (rm -f /tmp/gcc-4.7.1/bin/avr-gcc-4.7.1) 
> and before actually copying it ???
> 
> Obviously something went bad there. I suspect I was doing the wrong way 
> at configure-time: while I reconfigure without 
> ''--program-prefix=avr-'', ''make install'' install ''avr-gcc-4.7.1'' in 
> the destination directory, but all the other binaries are without the 
> ''avr-'' prefix (like ''g++-4.7.1'').
> 
> Anyway, the really puzzling thing here is that in on case it works for 
> g++ (''avr-g++-4.7.1'') but not gcc - and the other case this is the 
> opposite... Is there any way to have all the executables installed with 
> their name rewritten as ''avr-XXXX-4.7.1''?
> 
> 
> I would be very grateful for any help or pointer with this issue,
> Thanks in advance,
> - Sylvain.

You tried without the program suffix?

If you configure without program-suffix and -prefix, the default name of
the compiler will ne avr-gcc and also an avr-gcc-4.7.1 will be installed.

Maybe that coincidence confused the build script?

If you also downloaded the sources to /tmp/gcc-4.7.1 don't install
the compiler to that location.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gcc install fails silently (AVR build)
  2012-07-18 19:37 ` Georg-Johann Lay
@ 2012-07-18 21:01   ` Sylvain Leroux
  2012-07-18 21:32     ` [PATCH] " Sylvain Leroux
  2012-07-19 11:30     ` Georg-Johann Lay
  0 siblings, 2 replies; 7+ messages in thread
From: Sylvain Leroux @ 2012-07-18 21:01 UTC (permalink / raw)
  To: Georg-Johann Lay; +Cc: gcc-help

Hi Georg-Johann,
And thanks for your answer. Some comments inline:

On 07/18/2012 09:35 PM, Georg-Johann Lay wrote:
 > If you also downloaded the sources to /tmp/gcc-4.7.1 don't install
 > the compiler to that location.
gcc source, build and install are three different directories.


> You tried without the program suffix?
>
> If you configure without program-suffix and -prefix, the default name of
> the compiler will ne avr-gcc and also an avr-gcc-4.7.1 will be installed.
Just to make it clear, I was not able to find any combination of program 
suffix/prefix that leads to /all/ my binaries being installed as 
'avr-XXXX-4.7.1'...

I made some further tests:
(1) When I configure without program-suffix and -prefix, I indeed got 
gcc installed as 'avr-gcc-4.7.1' -- but all other binaries lack the 
'-4.7.1' suffix (including g++):
sh$ ../gcc-${VERSION}/configure --prefix=/tmp/gcc-${VERSION} \
                                 --target=avr --enable-languages=c,c++
sh$ make -j9 && make install
sh$ ls /tmp/gcc-4.7.1/bin/
avr-c++  avr-g++  avr-gcc-4.7.1  avr-gcc-nm      avr-gcov
avr-cpp  avr-gcc  avr-gcc-ar     avr-gcc-ranlib


(2) When I only add the '-4.7.1' suffix, gcc is still installed as 
'avr-gcc-4.7.1' and all other binaries have the correct suffix -- but no 
longer their prefix:
sh$ ../gcc-${VERSION}/configure --prefix=/tmp/gcc-${VERSION} \
                                 --target=avr --enable-languages=c,c++ \
                                 --program-suffix=-4.7.1
sh$ make -j9 && make install
sh$ ls /tmp/gcc-4.7.1/bin/
avr-gcc-4.7.1  cpp-4.7.1  gcc-4.7.1     gcc-nm-4.7.1      gcov-4.7.1
c++-4.7.1      g++-4.7.1  gcc-ar-4.7.1  gcc-ranlib-4.7.1

(3) When I only add the 'avr-' prefix things are going just like in (1) 
(without -prefix and -suffix): gcc is installed as 'avr-gcc-4.7.1' and 
all other binaries only have the 'avr-' prefix:
sh$ ../gcc-${VERSION}/configure --prefix=/tmp/gcc-${VERSION} \
                                 --target=avr --enable-languages=c,c++ \
                                 --program-prefix=avr-
sh$ make -j9 && make install
sh$ ls /tmp/gcc-4.7.1/bin/
avr-c++  avr-g++  avr-gcc-4.7.1  avr-gcc-nm      avr-gcov
avr-cpp  avr-gcc  avr-gcc-ar     avr-gcc-ranlib

(4) When I both configure with prefix 'avr-' and suffix '-4.7.1', I got 
all my binaries installed with the correct prefix and suffix -- except 
that gcc is /missing/ !
sh$ ../gcc-${VERSION}/configure --prefix=/tmp/gcc-${VERSION} \
                                 --target=avr --enable-languages=c,c++ \
                                 --program-prefix=avr- \
                                 --program-suffix=-4.7.1
sh$ make -j9 && make install
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

(5) When I use a different suffix and no prefix, gcc still is installed 
as ''avr-gcc-4.7.1' whereas the other binaries are installed with the 
requested suffix:
sh$ ../gcc-${VERSION}/configure --prefix=/tmp/gcc-${VERSION} \
                                 --target=avr --enable-languages=c,c++ \
                                 --program-suffix=-custom
sh$ make -j9 && make install
sh$ ls /tmp/gcc-4.7.1/bin/
avr-gcc-4.7.1  cpp-custom     gcc-custom     gcc-ranlib-custom  g++-custom
c++-custom     gcc-ar-custom  gcc-nm-custom  gcov-custom


It appears that for some reason the installation of gcc does not follow 
the same path as for the other binaries.


- Sylvain


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] Re: gcc install fails silently (AVR build)
  2012-07-18 21:01   ` Sylvain Leroux
@ 2012-07-18 21:32     ` Sylvain Leroux
  2012-07-19 11:30     ` Georg-Johann Lay
  1 sibling, 0 replies; 7+ messages in thread
From: Sylvain Leroux @ 2012-07-18 21:32 UTC (permalink / raw)
  To: gcc-help

On 07/18/2012 11:00 PM, Sylvain Leroux wrote:
> It appears that for some reason the installation of gcc does not follow
> the same path as for the other binaries.

By taking a closer look at the output of 'make install' it appears that 
gcc is in fact installed with the requested name, but removed just 
afterward:
-------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  (install)
rm -f /tmp/gcc-4.7.1/bin/avr-gcc-4.7.1                     (delete )
-------8<----------


I fixed the problem by swapping the two corresponding lines in the 
target 'install-driver' of the file ${GCCSRC}gcc/Makefile.in:

--- Makefile.in.orig	2012-07-18 23:16:01.000000000 +0200
+++ Makefile.in	2012-07-18 23:16:13.000000000 +0200
@@ -4650,10 +4650,10 @@
  # $(target_noncanonical)-gcc-$(version)
  # and also as either gcc (if native) or $(gcc_tooldir)/bin/gcc.
  install-driver: installdirs xgcc$(exeext)
  	-rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
-	-$(INSTALL_PROGRAM) xgcc$(exeext) 
$(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
  	-rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version)$(exeext)
+	-$(INSTALL_PROGRAM) xgcc$(exeext) 
$(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
  	-( cd $(DESTDIR)$(bindir) && \
  	   $(LN) $(GCC_INSTALL_NAME)$(exeext) 
$(target_noncanonical)-gcc-$(version)$(exeext) )
  	-if [ -f gcc-cross$(exeext) ] ; then \
  	  if [ -d $(DESTDIR)$(gcc_tooldir)/bin/. ] ; then \


I don't think this had any side effect - and should be safe for inclusion.


- Sylvain

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gcc install fails silently (AVR build)
  2012-07-18 21:01   ` Sylvain Leroux
  2012-07-18 21:32     ` [PATCH] " Sylvain Leroux
@ 2012-07-19 11:30     ` Georg-Johann Lay
  2012-07-19 12:46       ` Sylvain Leroux
  1 sibling, 1 reply; 7+ messages in thread
From: Georg-Johann Lay @ 2012-07-19 11:30 UTC (permalink / raw)
  To: Sylvain Leroux; +Cc: gcc-help

Sylvain Leroux schrieb:
> Hi Georg-Johann,
> And thanks for your answer. Some comments inline:
> 
> On 07/18/2012 09:35 PM, Georg-Johann Lay wrote:
>> If you also downloaded the sources to /tmp/gcc-4.7.1 don't install
>> the compiler to that location.
> gcc source, build and install are three different directories.
> 
> 
>> You tried without the program suffix?
>>
>> If you configure without program-suffix and -prefix, the default name of
>> the compiler will ne avr-gcc and also an avr-gcc-4.7.1 will be installed.
> Just to make it clear, I was not able to find any combination of program 
> suffix/prefix that leads to /all/ my binaries being installed as 
> 'avr-XXXX-4.7.1'...
> 
> I made some further tests:
> (1) When I configure without program-suffix and -prefix, I indeed got 
> gcc installed as 'avr-gcc-4.7.1' -- but all other binaries lack the 
> '-4.7.1' suffix (including g++):
> sh$ ../gcc-${VERSION}/configure --prefix=/tmp/gcc-${VERSION} \
>                                 --target=avr --enable-languages=c,c++
> sh$ make -j9 && make install
> sh$ ls /tmp/gcc-4.7.1/bin/
> avr-c++  avr-g++  avr-gcc-4.7.1  avr-gcc-nm      avr-gcov
> avr-cpp  avr-gcc  avr-gcc-ar     avr-gcc-ranlib

The ar, nm and ranlib prefixes look odd.
These tools are part of binutils and configured/installed with
binutils.

The gcc prefix/suffix has no effect on them, at least if you
don't build binutils in-tree.

> (2) When I only add the '-4.7.1' suffix, gcc is still installed as 
> 'avr-gcc-4.7.1' and all other binaries have the correct suffix -- but no 
> longer their prefix:
> sh$ ../gcc-${VERSION}/configure --prefix=/tmp/gcc-${VERSION} \
>                                 --target=avr --enable-languages=c,c++ \
>                                 --program-suffix=-4.7.1
> sh$ make -j9 && make install
> sh$ ls /tmp/gcc-4.7.1/bin/
> avr-gcc-4.7.1  cpp-4.7.1  gcc-4.7.1     gcc-nm-4.7.1      gcov-4.7.1
> c++-4.7.1      g++-4.7.1  gcc-ar-4.7.1  gcc-ranlib-4.7.1
> 
> (3) When I only add the 'avr-' prefix things are going just like in (1) 
> (without -prefix and -suffix): gcc is installed as 'avr-gcc-4.7.1' and 
> all other binaries only have the 'avr-' prefix:
> sh$ ../gcc-${VERSION}/configure --prefix=/tmp/gcc-${VERSION} \
>                                 --target=avr --enable-languages=c,c++ \
>                                 --program-prefix=avr-
> sh$ make -j9 && make install
> sh$ ls /tmp/gcc-4.7.1/bin/
> avr-c++  avr-g++  avr-gcc-4.7.1  avr-gcc-nm      avr-gcov
> avr-cpp  avr-gcc  avr-gcc-ar     avr-gcc-ranlib
> 
> (4) When I both configure with prefix 'avr-' and suffix '-4.7.1', I got 
> all my binaries installed with the correct prefix and suffix -- except 
> that gcc is /missing/ !
> sh$ ../gcc-${VERSION}/configure --prefix=/tmp/gcc-${VERSION} \
>                                 --target=avr --enable-languages=c,c++ \
>                                 --program-prefix=avr- \
>                                 --program-suffix=-4.7.1
> sh$ make -j9 && make install
> 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
> 
> (5) When I use a different suffix and no prefix, gcc still is installed 
> as ''avr-gcc-4.7.1' whereas the other binaries are installed with the 
> requested suffix:
> sh$ ../gcc-${VERSION}/configure --prefix=/tmp/gcc-${VERSION} \
>                                 --target=avr --enable-languages=c,c++ \
>                                 --program-suffix=-custom
> sh$ make -j9 && make install
> sh$ ls /tmp/gcc-4.7.1/bin/
> avr-gcc-4.7.1  cpp-custom     gcc-custom     gcc-ranlib-custom  g++-custom
> c++-custom     gcc-ar-custom  gcc-nm-custom  gcov-custom
> 
> 
> It appears that for some reason the installation of gcc does not follow 
> the same path as for the other binaries.
> 
> 
> - Sylvain

If you think it's a bug you can open a problem report.

You can post your patch to gcc-patches@ and discuss it there, and
maybe it's a good idea to also CC one of the build machinery maintainers
as listed in MAINTAINERS.

Johann

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gcc install fails silently (AVR build)
  2012-07-19 11:30     ` Georg-Johann Lay
@ 2012-07-19 12:46       ` Sylvain Leroux
  0 siblings, 0 replies; 7+ messages in thread
From: Sylvain Leroux @ 2012-07-19 12:46 UTC (permalink / raw)
  To: Georg-Johann Lay; +Cc: gcc-help

On 07/19/2012 01:28 PM, Georg-Johann Lay wrote:
> The ar, nm and ranlib prefixes look odd. These tools are part of
> binutils and configured/installed with binutils.
That surprised me too - as I was building from a clean gcc source
directory (i.e.: without I added binutils - or whatever else - in the
source tree).


> If you think it's a bug you can open a problem report.
Done: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54030

> You can post your patch to gcc-patches@ and discuss it there, and
> maybe it's a good idea to also CC one of the build machinery
> maintainers as listed in MAINTAINERS.
Done: http://gcc.gnu.org/ml/gcc-patches/2012-07/msg00905.html



- Sylvain

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gcc install fails silently (AVR build)
  2012-07-17 18:31 gcc install fails silently (AVR build) Sylvain Leroux
  2012-07-18 19:37 ` Georg-Johann Lay
@ 2012-07-19 13:00 ` Kai Ruottu
  1 sibling, 0 replies; 7+ messages in thread
From: Kai Ruottu @ 2012-07-19 13:00 UTC (permalink / raw)
  To: gcc-help

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 :(

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-07-19 13:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-17 18:31 gcc install fails silently (AVR build) Sylvain Leroux
2012-07-18 19:37 ` Georg-Johann Lay
2012-07-18 21:01   ` Sylvain Leroux
2012-07-18 21:32     ` [PATCH] " Sylvain Leroux
2012-07-19 11:30     ` Georg-Johann Lay
2012-07-19 12:46       ` Sylvain Leroux
2012-07-19 13:00 ` Kai Ruottu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).