Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign uprustc puts zero-initalized structs in .data instead of .bss if they contain padding #41315
Comments
This comment has been minimized.
This comment has been minimized.
|
Looking at LLVM IR: @_ZN1t12DMA_RECORDER17h7409bdfe01c28df8E =
internal global { i1, [8388608 x i8], [7 x i8], i64 }
{ i1 false, [8388608 x i8] zeroinitializer, [7 x i8] undef, i64 0 }, align 8It looks like that the padding |
whitequark
changed the title
rustc puts zero-initalized structs in .data instead of .bss if they contain `bool` fields
rustc puts zero-initalized structs in .data instead of .bss if they contain padding
Apr 15, 2017
This comment has been minimized.
This comment has been minimized.
|
So I'm not sure what to do here. This is clearly also an LLVM issue, but with LLVM being supported down to 3.7, fixing just LLVM doesn't seem enough. |
This comment has been minimized.
This comment has been minimized.
|
If it's indeed an LLVM bug, fixing LLVM and cherry-picking the patch into https://github.com/rust-lang/llvm/ may be the best we can do. This is often the case with LLVM issues, even with blatant miscompiles (e.g., #40593). |
nagisa
added
A-codegen
A-LLVM
I-slow
labels
Apr 16, 2017
This comment has been minimized.
This comment has been minimized.
|
I tagged this as |
This comment has been minimized.
This comment has been minimized.
|
Relevant thread on llvm-dev: http://lists.llvm.org/pipermail/llvm-dev/2017-April/112305.html (well, not a thread just yet) |
Mark-Simulacrum
added
C-enhancement
and removed
C-enhancement
labels
Jul 26, 2017
This comment has been minimized.
This comment has been minimized.
|
Still reproduces on 1.20 and |
This comment has been minimized.
This comment has been minimized.
|
I have a patch for this here. It's been accepted, so now it just needs to be merged and then we should be able to cherry-pick it. |
jyknight
pushed a commit
to jyknight/llvm-monorepo
that referenced
this issue
Feb 6, 2018
chapuni
pushed a commit
to llvm-project/llvm-project-20170507
that referenced
this issue
Feb 6, 2018
chapuni
pushed a commit
to llvm-project/llvm-project-submodule
that referenced
this issue
Feb 6, 2018
chapuni
pushed a commit
to llvm-project/llvm
that referenced
this issue
Feb 6, 2018
earl
pushed a commit
to earl/llvm-mirror
that referenced
this issue
Feb 6, 2018
This comment has been minimized.
This comment has been minimized.
|
This has now been merged in. Should be ready for cherry-picking! |
EricWF
added a commit
to efcs/llvm
that referenced
this issue
Feb 7, 2018
EricWF
added a commit
to efcs/llvm
that referenced
this issue
Feb 19, 2018
This comment has been minimized.
This comment has been minimized.
Yay! Thanks @varkor! If someone wants to drive this to the finish line the backporting process looks like this:
Feel free to cc me on those PRs. I can only r+ the rust-lang/rust PR, though. |
varkor
added a commit
to varkor/llvm
that referenced
this issue
Mar 9, 2018
varkor
referenced this issue
Mar 9, 2018
Merged
Place undefined globals in .bss instead of .data #109
This comment has been minimized.
This comment has been minimized.
|
@japaric: thanks for laying out the steps! I always meant to follow up here, but never got around to it (and wasn't sure what the process was on the rust/llvm end). I've followed the first steps: hopefully we can soon get this fix in for good! :) |
whitequark commentedApr 15, 2017
E.g.:
(and this results in a 8MB file, etc).
Note that this works: