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