macOS Sonoma Linker Issue
Renato
renato at athaydes.com
Thu Dec 21 18:06:51 UTC 2023
On Sunday, 17 December 2023 at 12:08:40 UTC, Johan wrote:
> On Wednesday, 13 December 2023 at 18:32:50 UTC, Renato wrote:
>> On Wednesday, 4 October 2023 at 11:01:08 UTC, Johan wrote:
>>> On Tuesday, 3 October 2023 at 23:55:05 UTC, confuzzled wrote:
>>>> Any known workaround for this most recent issue on macOS
>>>> Sonoma? The file I'm compiling contains a blank main()
>>>> without any imports but this error shows up on everything
>>>> I've attempted to compile since upgrading to Sonoma.
>>>>
>>>> (dmd-2.105.2) confuzzled at test ~ % dmd add
>>>> ld: multiple errors: symbol count from symbol table and
>>>> dynamic symbol table differ in '/Users/confuzzled/add.o' in
>>>> '/Users/confuzzled/add.o'; address=0x0 points to section(2)
>>>> with no content in
>>>> '/Users/confuzzled/dlang/dmd-2.105.2/osx/lib/libphobos2.a[3177](config_a68_4c3.o)'
>>>> clang: error: linker command failed with exit code 1 (use -v
>>>> to see invocation)
>>>> Error: linker exited with status 1
>>>
>>> Try passing `-ld_classic` to the linker. (`dmd
>>> -L-ld_classic`)
>>>
>>> https://github.com/ldc-developers/ldc/issues/4501#issuecomment-1738295459
>>>
>>> -Johan
>>
>> Thanks, it worked for me as well on MacOS Sonoma! The issue
>> you've linked has been resolved now. I am completely new to D,
>> so if I may ask, how often do they release? The fix was merged
>> 2 weeks ago, should we expect a release within a few weeks or
>> it's not released that often?
>
> Release will not be in next weeks, first DMD 2.106.1 should be
> released, then probably a few weeks later LDC 1.36 will be
> released.
>
> -Johan
This problem is really serious, I think you should consider a
release sooner.
I am trying to get started with `dub` but this issue keeps
popping up.
All I did was this:
```
dub init myproject
dub add silly
dub build
```
silly is a nicer test runner, which is exactly what I wanted...
but the build fails with linker issues:
▶ dub build
dub build
Starting Performing "debug" build using
/Library/D/dmd/bin/dmd for x86_64.
Building pledged ~master: building configuration
[application]
Linking pledged
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 0x1000741C9
('anon' + 457 from
/Users/renato/.dub/cache/pledged/~master/build/application-debug-lpSnJT5zFAFHM32hZ8QYUw/pledged.o)
ld: warning: pointer not aligned at address 0x1000741E6
('anon' + 486 from
/Users/renato/.dub/cache/pledged/~master/build/application-debug-lpSnJT5zFAFHM32hZ8QYUw/pledged.o)
ld: warning: pointer not aligned at address 0x1000742C9
('anon' + 713 from
/Users/renato/.dub/cache/pledged/~master/build/application-debug-lpSnJT5zFAFHM32hZ8QYUw/pledged.o)
ld: warning: pointer not aligned at address 0x100074311
('anon' + 785 from
/Users/renato/.dub/cache/pledged/~master/build/application-debug-lpSnJT5zFAFHM32hZ8QYUw/pledged.o)
ld: warning: pointer not aligned at address 0x100074367
('anon' + 871 from
/Users/renato/.dub/cache/pledged/~master/build/application-debug-lpSnJT5zFAFHM32hZ8QYUw/pledged.o)
ld: warning: pointer not aligned at address 0x1000743A2
('anon' + 930 from
/Users/renato/.dub/cache/pledged/~master/build/application-debug-lpSnJT5zFAFHM32hZ8QYUw/pledged.o)
ld: warning: pointer not aligned at address 0x1000743BE
('anon' + 958 from
/Users/renato/.dub/cache/pledged/~master/build/application-debug-lpSnJT5zFAFHM32hZ8QYUw/pledged.o)
ld: warning: pointer not aligned at address 0x1000743FA
('anon' + 1018 from
/Users/renato/.dub/cache/pledged/~master/build/application-debug-lpSnJT5zFAFHM32hZ8QYUw/pledged.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
Error /Library/D/dmd/bin/dmd failed with exit code 1.
Unless silly is completely broken, it seems like this is a linker
issue again.
More information about the Digitalmars-d-learn
mailing list