Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] gcc-config -l outputs only major versions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
blinker
n00b
n00b


Joined: 21 Aug 2009
Posts: 25

PostPosted: Fri Mar 28, 2025 6:38 am    Post subject: [SOLVED] gcc-config -l outputs only major versions Reply with quote

Hello,
I noticed a recent change in the output of
Code:
gcc-config -l


I was expecting the traditional format with the Major.Minor.Build version numbers like this
Code:
 [1] x86_64-pc-linux-gnu-14.2.1 *


Now it only shows the major version even if I have version 14.2.1_p20250301 installed
Code:
 [1] x86_64-pc-linux-gnu-14 *



As an example, in the past, I could have installed multiple versions on gcc and get something similar to :
Code:
 [1] x86_64-pc-linux-gnu-10.1.1
 [2] x86_64-pc-linux-gnu-10.1.2
 [3] x86_64-pc-linux-gnu-10.2.5 *


gcc-config --help still indicate the version should be in Major.Minor.Build format
Quote:
Profile names are of the form: <CTARGET>-<version> (like 'i686-pc-linux-gnu-3.2.1')
<version> (like '3.2.1')


I am trying to clarify this because I configured distcc and the wiki states that
Quote:
In order to use distcc, all of the computers on the network need to have the same GCC versions. For example, mixing 3.3.x (where the x varies) is okay, but mixing 3.3.x with 3.2.x may result in compilation errors or runtime errors.



Could this be a recent change and what are the implications?
- Are we now limited to one major version of gcc installed at a time ?
- If I install two versions of gcc 14, witch one will be used by distcc?
- should the distcc warning be changed to say that mixing 3.x.x (where the x varies) is OK?

Am I missing something else?


Last edited by blinker on Sat Apr 05, 2025 9:23 pm; edited 1 time in total
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2913

PostPosted: Fri Mar 28, 2025 7:56 am    Post subject: Re: gcc-config -l outputs only major versions Reply with quote

Quote:
Could this be a recent change and what are the implications?
Not really recent at this point, this was setup in 2019 in preparation for the upcoming gcc-10 release and gcc-9.x was the last one to do the full version thing. So your example with 10.x wouldn't have been possible unless I'm missing something.
Quote:
- Are we now limited to one major version of gcc installed at a time ?
You can e.g. install one 13 and one 14 at same time, but not 14.a.a and 14.b.b at same time.
Quote:
- If I install two versions of gcc 14, witch one will be used by distcc?
As noted above, you can't install two versions of gcc-14 with current ebuilds at same time (not counting cross). They also now share the same install location and would conflict (gcc is built with --with-major-version-only which results in having only /14/ in its install path rather than /14.x.x/).
Quote:
- should the distcc warning be changed to say that mixing 3.x.x (where the x varies) is OK?
I don't think it's generally ok. Even for patch versions I find it questionable (not that I use distcc to know this well), personally I'd rather keep all distcc machines on the exact same gcc version even if it can work. Either way, ideally just keep them updated in sync and there will be no need to have multiple of the same major version (for non-gentoo distcc hosts, they'd be lacking our patches and differ in likely incompatible ways anyway).

Some documentation/messages may still need updating though, like that --help message.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55113
Location: 56N 3W

PostPosted: Fri Mar 28, 2025 10:30 am    Post subject: Reply with quote

blinker,

The way gcc is slotted has changed, since a long time.
You can and could have only one version per slot.

distcc is a PITA as it cannot request and check compiler versions on helpers and will use whatever is selected by gcc-config.
It's your problem to ensure that versions are *identical* to stop horrible things happening
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
blinker
n00b
n00b


Joined: 21 Aug 2009
Posts: 25

PostPosted: Fri Mar 28, 2025 4:38 pm    Post subject: [SOLVED] gcc-config -l outputs only major versions Reply with quote

Thanks guys,

Quote:
The way gcc is slotted has changed, since a long time.

That confirms what I expected.

Quote:
Not really recent at this point

Sorry about that. I update my system usually every 2 years :oops: and want to change this.
I am currently
1) Implementing a distcc farm with all the old laptops and PC I svaged over the years to help with the time it takes to update
2) will be using LVM snapshots before and after the emerge world just in case the update does not go as planned



Quote:
personally I'd rather keep all distcc machines on the exact same gcc version

Me too but i guess during the upgrades of GCC where the major or minor changes, i will have to turn off distcc


Thanks for your help.
Verry appreciated.


Last edited by blinker on Sat Apr 05, 2025 9:21 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55113
Location: 56N 3W

PostPosted: Fri Mar 28, 2025 4:53 pm    Post subject: Reply with quote

blinker,

Exactly. Build gcc in one place so that it will run on any system in your build farm.
Once its done, distribute the binary to them all.
Select the new gcc everywhere.

You may even be able to use gcc from the binhost project, so you don't build it at all.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9979
Location: almost Mile High in the USA

PostPosted: Fri Mar 28, 2025 7:44 pm    Post subject: Reply with quote

I try to stick to specific versions... I had been sticking to gcc11 on all my machines but slowly migrating to gcc13.

Kind of unfortunate in the past, x.y and x.(y+1) weren't totally compatible. Currently I have a "small" preprocessed gcc benchmark sourcecode that I use to compare my machines and it was preprocessed with gcc11. Does not work with gcc13.

Incidentally my "benchmark" for gcc most of my "workhorse" computers compile about the same amount of time. I have a bunch of computers that take 2 to 3 minutes to complete. However after this 2 to 3 minute I have a few more machines that fall off the cliff that take 4 to 6 minutes or more...

Which is unfortunate. I have an old Atom board with 16GiB ECC memory I want to replace my 8GiB (non ECC) Core2 Quad server (cannot upgrade further) with. The Core2 Quad, if it doesn't swap, is more than twice as fast as the Atom, and I don't think the Atom is half the power (since the rest of the machine also consumes power...) I swapping will be the final say else I don't even use the Atom as part of the distcc farm since it's so slow.

I'm tempted to crossdev an amd64 gcc for my 32-bit laptops to see how fast they compile... LOL. Or do the 32-bit gcc's already capable of building 64-bit like 64-bit gcc's able to build 32-bit as-is? hmm...maybe it will work...
Code:
i686vm:~$ cat aaa.c
void main() {}
i686vm:~$ gcc -march=x86-64 -m64 -o aaa.o -c aaa.c
i686vm:~$ file aaa.o
aaa.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
i686vm:~$

_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum