Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Full rebuild required on gcc-14, gcc-15?
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
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1846

PostPosted: Thu Nov 28, 2024 1:16 pm    Post subject: Full rebuild required on gcc-14, gcc-15? Reply with quote

[Administrator note: this post, and the first 12 responses, were originally attached to the topic gcc-14 - cannot build sys-apps/lm-sensors. -Hu]

Sorry if this is a bit OT but just to clarify: I keep seeing posts about a recompile of everything. That's not a requirement for gcc 14 is it? Also. will that be a requirement for gcc 15?

Thanks!
Tom
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2460

PostPosted: Thu Nov 28, 2024 1:28 pm    Post subject: Reply with quote

tld wrote:
That's not a requirement for gcc 14 is it? Also. will that be a requirement for gcc 15?

Thanks!
Tom


No and no. The fact that somebody does something odd doesn't mean anything.

Best Regards,
Georgi
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3920

PostPosted: Thu Nov 28, 2024 1:49 pm    Post subject: Reply with quote

I have no general answer.

Nevertheless when LTO is involved there, it should mentionned there are LTO step signature which must be matching when 2 packages are involved.
Let's supposed a dependency package D for package A has been LTO build in the past with a gcc that signs LTO level=X
Current gcc involved in building package A with LTO may be distant enough with the one used above to now sign LTO level=X+1 and would require the that very same LTO level=X+1 in the dependency package too. Build will break otherwise.

This happened here with D from gcc:13 and A build attempt with gcc:14.
It also happened with D from early gcc:14 and much later gcc:14.

Please note gcc ebuild doesn't inform when LTO step has changed.
This is something you get to know the hard way.

Back in the past I used to rebuild world after installing a new gcc.
I recall I had a feeling things to be snappier. Maybe better GUI environment.
Code:
wc -l /var/lib/portage/world
758 /var/lib/portage/world
is way too much nowadays.

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3920

PostPosted: Thu Nov 28, 2024 1:56 pm    Post subject: Reply with quote

Moreover, how to identify packages requiring clang/gcc tool stack?
Vast majority of such ebuilds don't tell easily.

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "


Last edited by CaptainBlood on Thu Nov 28, 2024 2:14 pm; edited 1 time in total
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2460

PostPosted: Thu Nov 28, 2024 2:03 pm    Post subject: Reply with quote

CaptainBlood wrote:
I have no general answer.

Nevertheless when LTO is involved there, it should mentionned there are LTO step signature which must be matching when 2 packages are involved.


I might be wrong but I think there's no way for that to be true. LTO should be transparent to the outside world. Packages depend on the ABI not the way the libraries were optimized. LTO information is lost once the optimization is finished. The optimization itself should not impact neither program correctness nor ABI - the only things visible/important to the outside world. Nothing from the optimization of one package should spill into another. That would break ABI/correctness.

CaptainBlood wrote:
Back in the past I used to rebuild world after installing a new gcc.
I recall I had a feeling things to be snappier. Maybe better GUI environment.


That's not necessary and has never been. /well maybe there were special cases but those must have been one offs/

Best Regards,
Georgi
Back to top
View user's profile Send private message
freke
Veteran
Veteran


Joined: 23 Jan 2003
Posts: 1032
Location: Somewhere in Denmark

PostPosted: Thu Nov 28, 2024 2:17 pm    Post subject: Reply with quote

tld wrote:
Sorry if this is a bit OT but just to clarify: I keep seeing posts about a recompile of everything. That's not a requirement for gcc 14 is it? Also. will that be a requirement for gcc 15?

Thanks!
Tom

Simply done to catch/find bugs/ebuilds that needs to fixed for the new versions, they're getting stricter and stricter on errors in the code.
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3920

PostPosted: Thu Nov 28, 2024 2:25 pm    Post subject: Reply with quote

Code:
/var/log/portage/media-gfx:splashutils-1.5.4.4-r9:20241027-213142.log.gz:lto1: fatal error: bytecode stream in file '/usr/lib64/libjpeg.a' generated with LTO version 14.0 instead of the expected 13.1
Code:
/var/log/portage/app-emulation:qemu-8.2.3:20240908-140310.log.gz:lto1: fatal error: bytecode stream in file '/usr/lib64/libz.a' generated with LTO version 13.1 instead of the expected 14.0
Code:
/var/log/portage/dev-qt:qt3d-5.15.14:20241107-160924.log.gz:lto1: fatal error: bytecode stream in file '/usr/lib64/libQt5OpenGLExtensions.a' generated with LTO version 13.1 instead of the expected 14.0
Code:
/var/log/portage/x11-libs:motif-2.3.8-r5:20241105-133058.log.gz:lto1: fatal error: bytecode stream in file '/usr/lib64/libfl.a' generated with LTO version 13.1 instead of the expected 14.0


Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "


Last edited by CaptainBlood on Thu Nov 28, 2024 2:31 pm; edited 1 time in total
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3920

PostPosted: Thu Nov 28, 2024 2:30 pm    Post subject: Reply with quote

World should be avoided.

Wise cherry picking specific packages to rebuild may have interesting benefit locally.

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1991

PostPosted: Thu Nov 28, 2024 3:13 pm    Post subject: Reply with quote

logrusx wrote:
CaptainBlood wrote:
I have no general answer.

Nevertheless when LTO is involved there, it should mentionned there are LTO step signature which must be matching when 2 packages are involved.


I might be wrong but I think there's no way for that to be true. LTO should be transparent to the outside world. Packages depend on the ABI not the way the libraries were optimized. LTO information is lost once the optimization is finished. The optimization itself should not impact neither program correctness nor ABI - the only things visible/important to the outside world. Nothing from the optimization of one package should spill into another. That would break ABI/correctness.



The issue is with static libraries. See bug 926120.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22736

PostPosted: Thu Nov 28, 2024 3:17 pm    Post subject: Reply with quote

LTO bytecode in static archives can cause problems, yes. The solution to that is (1) don't build static archives if you can avoid it, and (2) if you cannot avoid it, prioritize rebuilding the packages that provide those static archives. Most packages will not have built static archives, and so will not need to be rebuilt due to a newer LTO bytecode version. On my system, I have more than 10 times as many shared objects in /usr/lib64 than I have static archives. Of those static archives I reviewed for this post, none came from packages that respect USE=static-libs. Only 26 packages would need to be rebuilt to cover all my static archives, out of more than 1000+ packages if I ran emerge -e @world.
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3920

PostPosted: Thu Nov 28, 2024 3:29 pm    Post subject: Reply with quote

I understand I might be problematic if binary packages D are involved... Maybe not.

The solution here is to rebuild dependancy package with later gcc.
Then rebuild any installed packages that relies on it with later gcc.

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3920

PostPosted: Thu Nov 28, 2024 3:34 pm    Post subject: Reply with quote

@Hu
I was just answering
Quote:
I think there's no way for that to be true

A corner case likely, that nevertheless exist.

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22736

PostPosted: Thu Nov 28, 2024 3:39 pm    Post subject: Reply with quote

While emerge --emptytree will achieve that result, it is a very expensive way to achieve a result that could be achieved far more cheaply with some targeted intervention. I sought to explain the cheap way (rebuild exactly those packages you need), and document how much cheaper it can be. For my system, it is a difference of 26 versus 1000+ packages, and most of those 26 look relatively cheap to build, so the time and power savings is even more favorable than just 26/1000, since I don't have to rebuild huge packages like llvm and firefox, because those didn't install any static archives.

The Gentoo bug that sam_ linked shows that there is interest in making this work without user intervention, but for now, users who globally apply LTO, even to packages that install static archives, will need to give the package manager a bit of extra guidance when doing a compiler upgrade.

logrusx is mostly correct though: LTO should not change ABI, and the problem is one case where LTO information is not discarded by the end of the build, and is instead persisted in a static archive for later builds to find and trip over.
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