Bug 54030 - make install does not honor --program-prefix/--program-suffix for 'gcc' (AVR build)
Summary: make install does not honor --program-prefix/--program-suffix for 'gcc' (AVR ...
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.7.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build, patch
Depends on:
Blocks:
 
Reported: 2012-07-19 12:23 UTC by Sylvain Leroux
Modified: 2024-04-10 23:11 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-07-26 00:00:00


Attachments
pr54030.diff tentative patch (331 bytes, patch)
2012-10-24 16:55 UTC, Georg-Johann Lay
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sylvain Leroux 2012-07-19 12:23:01 UTC
While building 4.7.1 for target AVR, make install honors  --program-prefix/--program-suffix for all installed binaries except for 'gcc'. This one is always installed as ''avr-gcc-4.7.1''

HOW TO REPRODUCE:
=================
I tested several combination of --progam-prefix/--program-suffix summerized below. Each time ../gcc-${VERSION} is a clean gcc source directory. I build on Debian Squeeze using debian-packaged gcc and tools.

I tested both with 4.7.1 and 4.6.3 with the same results:
(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
Comment 1 Andrew Pinski 2012-07-19 17:59:40 UTC
I don't think it is right to use --program-suffix == the version and --program-prefix == target.
Comment 2 Georg-Johann Lay 2012-07-26 08:48:05 UTC
Patch proposed here:

http://gcc.gnu.org/ml/gcc-patches/2012-07/msg00905.html
Comment 3 Georg-Johann Lay 2012-10-24 16:55:40 UTC
Created attachment 28520 [details]
pr54030.diff tentative patch

The patch from

http://gcc.gnu.org/ml/gcc-patches/2012-07/msg00905.html

has been approved in 

http://gcc.gnu.org/ml/gcc-patches/2012-07/msg00929.html

However, there are issues:

- No ChangeLog provided
- Patch in ML is against 4.7
- Patch in ML is not in a valid patch format
Comment 4 mrs@gcc.gnu.org 2012-10-24 17:42:14 UTC
Mine isn't an approval as I am not a maintainer.  I reviewed it because I know that part of the Makefile and I am familiar with what they want to do.  I did this to spur an actual reviewer to approve it.
Comment 5 Georg-Johann Lay 2012-10-27 21:25:32 UTC
(In reply to comment #4)
> I reviewed it because I know that part of the Makefile and I am
> familiar with what they want to do.

Waht would be a reasonable changelog? I am not familiar with that and all the $s there. The only I can see swapping "rm" and installing "xgcc".