Stream: t-compiler

Topic: #57038 cross compilation 64-bit atop 32-bit


pnkfelix (Dec 21 2018 at 13:12, on Zulip):

Maybe this is a silly question: Are we supposedly able to support using a 32-bit build of rustc (e.g. build/i686-unknown-linux-gnu/stage1/bin/rustc) to build a 64-bit target (e.g. --target=x86_64-unknown-linux-gnu)

nagisa (Dec 21 2018 at 13:15, on Zulip):

crossbuilds from any target to any target should work

pnkfelix (Dec 21 2018 at 13:15, on Zulip):

this may be problematic for tests like huge-enum.rs because of internal API's like FieldPlacement::count

nagisa (Dec 21 2018 at 13:15, on Zulip):

provided memory is sufficient and cross toolchain exists

pnkfelix (Dec 21 2018 at 13:15, on Zulip):

that is, I'm just playing locally with such a 32-bit build and then seeing the compiler ICE on that test

nagisa (Dec 21 2018 at 13:16, on Zulip):

@pnkfelix that’s a bug in the compiler

pnkfelix (Dec 21 2018 at 13:16, on Zulip):

maybe FieldPlacement::count should return u64 rather than usize ?

pnkfelix (Dec 21 2018 at 13:16, on Zulip):

okay

pnkfelix (Dec 21 2018 at 13:16, on Zulip):

I'll file it. Its obviously not high priority.

nagisa (Dec 21 2018 at 13:16, on Zulip):

yeah, there should be no usizes in the compiler usually, other than to refer to its own indexes and other memory-ey things.

pnkfelix (Dec 21 2018 at 13:23, on Zulip):

are there CI builds that correspond to this?

pnkfelix (Dec 21 2018 at 13:23, on Zulip):

my assumption is that there must not be, since this test would have been flagging this problem on any such CI build, right?

nagisa (Dec 21 2018 at 13:24, on Zulip):

to be fair this code is impossible to build one way or the other

nagisa (Dec 21 2018 at 13:25, on Zulip):

because that array is too large to fit into the 32-bit address sapce

pnkfelix (Dec 21 2018 at 13:25, on Zulip):

it is a compile-fail test, yes

nagisa (Dec 21 2018 at 13:25, on Zulip):

but a i686 compiler should definitely be able to build a x86_64 program which is valid here

pnkfelix (Dec 21 2018 at 13:25, on Zulip):

but I do wonder if there might be a variant that could get into this same issue...

nagisa (Dec 21 2018 at 13:26, on Zulip):

well other than the fact that the array would probably not fit on the disk (actually it would due to .bss)

nagisa (Dec 21 2018 at 13:26, on Zulip):

or in memory when the program is loaded

pnkfelix (Dec 21 2018 at 13:27, on Zulip):

might we sometimes call FieldLayout::count with such a count for something that is only constructed at runtime?

pnkfelix (Dec 21 2018 at 13:27, on Zulip):

(I don't know enough about the overall control flow here)

nagisa (Dec 21 2018 at 13:27, on Zulip):

I dont think so.

pnkfelix (Dec 21 2018 at 13:29, on Zulip):

hmm yeah the code in FieldPlacement::index_by_increasing_offset seems doomed

Last update: Nov 22 2019 at 05:45UTC