www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Invalid alignment on macOS with "-g": anyone have seen it?

reply Paolo Invernizzi <paolo.invernizzi gmail.com> writes:
Hi all,

Is this a know issue?

It happens only with "-g" on a simple hello world

```
~/dlang/dmd-2.101.0/osx/bin/dmd -g hello.d
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: alignment (1) of atom 'anon' is too small and may 
result in unaligned pointers
ld: warning: pointer not aligned at address 0x10007023A ('anon' + 
570 from hello.o)
ld: warning: pointer not aligned at address 0x100070257 ('anon' + 
599 from hello.o)
ld: warning: pointer not aligned at address 0x100070347 ('anon' + 
839 from hello.o)
ld: warning: pointer not aligned at address 0x100070382 ('anon' + 
898 from hello.o)
ld: warning: pointer not aligned at address 0x10007039E ('anon' + 
926 from hello.o)
ld: warning: pointer not aligned at address 0x1000703D6 ('anon' + 
982 from hello.o)
ld: warning: pointer not aligned at address 0x100070429 ('anon' + 
1065 from hello.o)
ld: warning: pointer not aligned at address 0x100070459 ('anon' + 
1113 from hello.o)
ld: warning: pointer not aligned at address 0x100070475 ('anon' + 
1141 from hello.o)
ld: unaligned pointer(s) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to 
see invocation)
Error: linker exited with status 1

```

Ventura 13.0.1 - Intel
Nov 28 2022
parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On 11/28/22 12:27 PM, Paolo Invernizzi wrote:
 Hi all,
 
 Is this a know issue?
 
 It happens only with "-g" on a simple hello world
 
 Ventura 13.0.1 - Intel
Oh boy. I've seen similar problems with Mac on ARM via ldc2: https://github.com/ldc-developers/ldc/issues/3864 I thought it was ARM/LDC specific, but looks like Apple's linker is getting tighter on what it will allow. This needs addressing ASAP. Can you file a bug report? I'm hesitant to upgrade to 13 now... -Steve
Nov 28 2022
parent reply Paolo Invernizzi <paolo.invernizzi gmail.com> writes:
On Monday, 28 November 2022 at 19:36:10 UTC, Steven Schveighoffer 
wrote:
 On 11/28/22 12:27 PM, Paolo Invernizzi wrote:
 Hi all,
 
 Is this a know issue?
 
 It happens only with "-g" on a simple hello world
 
 Ventura 13.0.1 - Intel
Oh boy. I've seen similar problems with Mac on ARM via ldc2: https://github.com/ldc-developers/ldc/issues/3864 I thought it was ARM/LDC specific, but looks like Apple's linker is getting tighter on what it will allow. This needs addressing ASAP. Can you file a bug report? I'm hesitant to upgrade to 13 now... -Steve
Thank you Steve, done: https://issues.dlang.org/show_bug.cgi?id=23517
Nov 29 2022
parent reply aliak <something something.com> writes:
On Tuesday, 29 November 2022 at 08:37:24 UTC, Paolo Invernizzi 
wrote:
 On Monday, 28 November 2022 at 19:36:10 UTC, Steven 
 Schveighoffer wrote:
 On 11/28/22 12:27 PM, Paolo Invernizzi wrote:
 Hi all,
 
 Is this a know issue?
 
 It happens only with "-g" on a simple hello world
 
 Ventura 13.0.1 - Intel
Oh boy. I've seen similar problems with Mac on ARM via ldc2: https://github.com/ldc-developers/ldc/issues/3864 I thought it was ARM/LDC specific, but looks like Apple's linker is getting tighter on what it will allow. This needs addressing ASAP. Can you file a bug report? I'm hesitant to upgrade to 13 now... -Steve
Thank you Steve, done: https://issues.dlang.org/show_bug.cgi?id=23517
Oh noes. Does anyone know of a workaround? I was just thinking advent of code has started and I have not used d in a loooong time so let's use it.
Dec 01 2022
parent reply aliak <something something.com> writes:
On Thursday, 1 December 2022 at 22:13:29 UTC, aliak wrote:
 On Tuesday, 29 November 2022 at 08:37:24 UTC, Paolo Invernizzi 
 wrote:
 On Monday, 28 November 2022 at 19:36:10 UTC, Steven 
 Schveighoffer wrote:
 [...]
Thank you Steve, done: https://issues.dlang.org/show_bug.cgi?id=23517
Oh noes. Does anyone know of a workaround? I was just thinking advent of code has started and I have not used d in a loooong time so let's use it.
I just used dub run btw
Dec 01 2022
parent aliak <something something.com> writes:
On Thursday, 1 December 2022 at 22:14:53 UTC, aliak wrote:
 On Thursday, 1 December 2022 at 22:13:29 UTC, aliak wrote:
 On Tuesday, 29 November 2022 at 08:37:24 UTC, Paolo Invernizzi 
 wrote:
 On Monday, 28 November 2022 at 19:36:10 UTC, Steven 
 Schveighoffer wrote:
 [...]
Thank you Steve, done: https://issues.dlang.org/show_bug.cgi?id=23517
Oh noes. Does anyone know of a workaround? I was just thinking advent of code has started and I have not used d in a loooong time so let's use it.
I just used dub run btw
Ok you can work around like: "MACOSX_DEPLOYMENT_TARGET=11 dub run"
Dec 01 2022