Stream: t-compiler

Topic: LNK1189 "library limit of 65535 obj exceeded" (#53014)


mw (Apr 04 2019 at 15:03, on Zulip):

@pnkfelix The code here already supports shrinking the number of CGUs to a defined value:

mw (Apr 04 2019 at 15:03, on Zulip):

https://github.com/rust-lang/rust/blob/e43f99ce576152d4b2f7315d491c4210211228d6/src/librustc_mir/monomorphize/partitioning.rs#L235-L241

pnkfelix (Apr 04 2019 at 15:03, on Zulip):

does that readily generalize to incremental ?

mw (Apr 04 2019 at 15:03, on Zulip):

yes

pnkfelix (Apr 04 2019 at 15:04, on Zulip):

k

mw (Apr 04 2019 at 15:04, on Zulip):

you basically just need to adjust the policy

mw (Apr 04 2019 at 15:04, on Zulip):

if you set only an upper limit then test cases should not be affected

mw (Apr 04 2019 at 15:05, on Zulip):

it might make sense to generally set a limit of X here

pnkfelix (Apr 04 2019 at 15:05, on Zulip):

okay. so maybe I'll even have something we can readily beta-backport, soon

mw (Apr 04 2019 at 15:05, on Zulip):

1000?

mw (Apr 04 2019 at 15:05, on Zulip):

10000?

mw (Apr 04 2019 at 15:05, on Zulip):

666!

mw (Apr 04 2019 at 15:05, on Zulip):

seems like a sensible choice

mw (Apr 04 2019 at 15:06, on Zulip):

I'm a bit surprised though that we reach 65536 rust modules in a single crate

mw (Apr 04 2019 at 15:06, on Zulip):

that seems like a lot, even for librustc

pnkfelix (Apr 04 2019 at 18:33, on Zulip):

that seems like a lot, even for librustc

yes. it makes me wonder if there is something else going on.

pnkfelix (Apr 04 2019 at 18:33, on Zulip):

but we will see.

Zoxc (Apr 04 2019 at 22:25, on Zulip):

@mw I'm pretty sure objects refer to symbols here. I'll try to bisect the cause of this for debug builds (takes soo long though). I do know that release builds have fewer than 64k symbols in librustc.

mw (Apr 05 2019 at 08:36, on Zulip):

@Zoxc yes, that makes sense. In that case, reducing the number of object files won't help.

Zoxc (Apr 06 2019 at 06:07, on Zulip):

@mw I bisected the debug build regression to https://github.com/rust-lang/rust/pull/48779.
rustc.dll exports goes from 3980 symbols to 3992 symbols.

Zoxc (Apr 06 2019 at 11:42, on Zulip):

Doing a current release build with -Z share-generics=on bumps it to 57658

Zoxc (Apr 06 2019 at 13:12, on Zulip):

mingw release builds have 45964 symbols for rustc.dll, it kind of seems like -Z share-generics is forced on somehow?

Zoxc (Apr 06 2019 at 13:18, on Zulip):

I don't see any overrides for mingw. Maybe we set the wrong symbol visibility for it?

Zoxc (Apr 06 2019 at 14:28, on Zulip):

It seems like mingw + incremental compilation causes generic functions to be exported from dlls even without -Z share-generics. I had incremental off when building rustc, so there's some other cause to this too.

Zoxc (Apr 06 2019 at 15:11, on Zulip):

I think this due to us explictly listing which functions we want to export, but only on msvc

Last update: Nov 22 2019 at 04:30UTC