Bug 195054 - sys-apps/gcc-config-1.4.0-r3 generates incorrectly suffixed env.d entries (CTARGET-VER instead of CTARGET)
Bug#: 195054 Product:  Gentoo Linux Version: unspecified Platform: x86
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: toolchain@gentoo.org Reported By: palglowr@gmail.com
Component: Core system
URL: 
Summary: sys-apps/gcc-config-1.4.0-r3 generates incorrectly suffixed env.d entries (CTARGET-VER instead of CTARGET)
Keywords:  
Status Whiteboard: 
Opened: 2007-10-08 05:03 0000
Description:   Opened: 2007-10-08 05:03 0000
1.system has been emerged multiple gccs
2.gcc-config 2 (i686-pc-linux-gnu-4.2.0) -> generate
env.d/05gcc-i686-pc-linux-gnu-4.2.0
3.gcc-config 3 (i686-pc-linux-gnu-4.2.1) -> generate
env.d/05gcc-i686-pc-linux-gnu-4.2.1

thus, shell has string-ordered path to gcc after "source /etc/profile".
"gcc -v" and "gcc-config -l"report using minimum version of gcc.

Reproducible: Always

Steps to Reproduce:

------- Comment #1 From SpanKY 2007-10-08 11:41:01 0000 -------
post the output of:
ls -l /etc/env.d/05* /etc/env.d/gcc/

run `gcc-config -x 2 >& log.2` and `gcc-config -x 3 >& log.3` and post the
files as attachments

------- Comment #2 From Shunichi Fuji 2007-10-08 14:41:00 0000 -------
Created an attachment (id=132920) [details]
ls -l /etc/env.d/05* /etc/env.d/gcc/

------- Comment #3 From Shunichi Fuji 2007-10-08 14:46:08 0000 -------
Created an attachment (id=132924) [details]
gcc-config -x 2 >& log.2

------- Comment #4 From Shunichi Fuji 2007-10-08 14:46:34 0000 -------
Created an attachment (id=132926) [details]
gcc-config -x 3 >& log.3

------- Comment #5 From Shunichi Fuji 2007-10-09 07:20:48 0000 -------
i see that /etc/env.d/gcc/.NATIVE symlink was changed properly.

------- Comment #6 From Dennis Schridde 2007-10-09 09:52:23 0000 -------
I can confirm this.
In /etc/env.d/gcc/ gcc-config creates config-CTARGET-VERSION files, while it
seems as if it previously generated only one config-CTARGET file.

------- Comment #7 From Vladimir G. Ivanovic 2007-10-09 10:13:44 0000 -------
I had the same problem on AMD64. 

After I emerged gcc-4.2.1, even though `gcc-config x86_64-pc-linux-gnu-4.2.1'
completed without error, `gcc-config -l' always pointed to
x86_64-pc-linux-gnu-4.2.0. 

After un-emerging gcc-4.2.0, `gcc-config -l' returned with the error "Active
gcc profile is invalid!". 

I tracked the problem down to the contents of
/etc/env.d/gcc/config-x86_64-pc-linux-gnu which still containted
"CURRENT=x86_64-pc-linux-gnu-4.2.0" and to the contents of 
/etc/env.d/05gcc-x86_64-pc-linux-gnu which refered to 4.2.0 rather than 4.2.1.

I made config-x86_64-pc-linux-gnu a copy of config-x86_64-pc-linux-gnu-4.2.1
and made 05gcc-x86_64-pc-linux-gnu a copy of 05gcc-x86_64-pc-linux-gnu-4.2.1.

Since neither config-x86_64-pc-linux-gnu-4.2.0 nor
05gcc-x86_64-pc-linux-gnu-4.2.0 were now owned by a package, I deleted them.

All seems well. `gcc -v' indicates it's gcc-4.2.1 and `gcc-config -l' returns "
[1] x86_64-pc-linux-gnu-4.2.1 *". (As Shunichi-san noted in Comment #5, the
.NATIVE link was correct and wasn't changed.) Two test compiles completed
without error and their programs ran correctly.

I am using sys-devel/gcc-config-1.4.0-r3.

------- Comment #8 From SpanKY 2007-10-11 05:27:24 0000 -------
fixed with 1.4.0-r4

------- Comment #9 From Jakub Moc (RETIRED) 2007-10-11 13:43:16 0000 -------
*** Bug 195490 has been marked as a duplicate of this bug. ***

------- Comment #10 From Jakub Moc (RETIRED) 2007-10-13 18:00:54 0000 -------
*** Bug 195727 has been marked as a duplicate of this bug. ***