Bug 50639 - -flto=jobserver broken on large LTO build
Summary: -flto=jobserver broken on large LTO build
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: 50679
  Show dependency treegraph
 
Reported: 2011-10-06 21:08 UTC by Andi Kleen
Modified: 2018-04-19 17:23 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andi Kleen 2011-10-06 21:08:06 UTC
On a -j8 Linux kernel LTO build with -flto=jobserver I always end up with


make[3]: *** read jobs pipe: No such file or directory.  Stop.
make[3]: *** Waiting for unfinished jobs....
lto-wrapper: make returned 2 exit status
/usr/local/bin/ld-plugin: lto-wrapper failed

at the final link stage. The link is actually succeeding, but something
confuses jobserver

It works with -flto=8. The message comes from make.

It could be a regression, but it's hard to say because older much builds
usually ran into other problems.
Comment 1 Nix 2012-01-23 01:18:58 UTC
I can confirm the same symptoms while bootstrapping GCC on the head of the GCC 4.6 branch, with a bootstrap-lto profiledbootstrap, and GNU make 3.82. During the stage3 (profilegenerate) libgcc build, the build suddenly stops with:

make[6]: *** read jobs pipe: No such file or directory.  Stop.
make[6]: *** Waiting for unfinished jobs....
lto-wrapper: make returned 2 exit status
/usr/bin/ld: lto-wrapper failed
collect2: ld returned 1 exit status
make[5]: *** [libgcc_s.so] Error 1

This failure appears consistent, so whatever it is it's not a race (or, if it is, it's fearfully easy to hit).
Comment 2 Andi Kleen 2018-04-18 17:52:55 UTC
FWIW the problem disappeared for me at some point (could have been newer kernel or different make). I don't see it anymore.

I think it was some problems with the pipes used by the job server losing a token
Comment 3 Richard Biener 2018-04-19 09:01:40 UTC
So fixed.
Comment 4 Andi Kleen 2018-04-19 17:23:39 UTC
I doubt it's fixed. It's a race so can be unstable.

Especially since judging from the growing cc list other people keep seeing it

It may not be something that gcc can fix, if anything it's more likely in make or in Linux.