Bug 23139 – object files containing several big static initializers require --no-relax to link

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2022-05-25T09:57:17Z
Last change time
2024-12-13T19:23:07Z
Keywords
link-failure
Assigned to
No Owner
Creator
basile-z
Moved to GitHub: dmd#20112 →

Comments

Comment #0 by b2.temp — 2022-05-25T09:57:17Z
For the following code ```d __gshared int[10000][10000] a; __gshared int[10000][10000] b; __gshared int[10000][10000] c; __gshared int[10000][10000] d; __gshared int[10000][10000] e; __gshared int[10000][10000] f; __gshared int[10000][10000] g; void main(string[] args){} ``` compiled without special argument, linking fails and an error message suggest to add the argument `--no-relax`. 1. this suggests that "--relax" is passed to the linker 2. the problem does not happen when using a list in the declarator, e.g ```d __gshared int[10000][10000] a,b,c,d,e,f,g; void main(string[] args){} ``` this suggests that the first version use distinct initializers for each variable, which, if verified seems wrong, as here only the type specific initializer is used. 3. with -L--no-relax linking always work. Is the compiler able to add this argument dynamically ?
Comment #1 by b2.temp — 2022-05-25T10:08:10Z
dmd does not pass --relax to cc. Not sure if something is actionable then.
Comment #2 by maxhaton — 2022-05-25T10:28:50Z
Which distro/linker etc?
Comment #3 by b2.temp — 2022-05-25T12:07:27Z
dist: Fedora, linker: ld.bfd, otherwise it's really like described in the standards fields so linux + amd64.
Comment #4 by robert.schadek — 2024-12-13T19:23:07Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20112 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB