Thread overview
Invalid alignment on macOS with "-g": anyone have seen it?
Nov 28, 2022
Paolo Invernizzi
Nov 29, 2022
Paolo Invernizzi
Dec 01, 2022
aliak
Dec 01, 2022
aliak
Dec 01, 2022
aliak
November 28, 2022
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
November 28, 2022

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

November 29, 2022
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


December 01, 2022
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.
December 01, 2022
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

December 01, 2022
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"