Bug 23517 – dmd with -g flag fails to link on macOS with unaligned pointer

Status
RESOLVED
Resolution
FIXED
Severity
blocker
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
Mac OS X
Creation time
2022-11-29T08:36:49Z
Last change time
2024-03-01T23:56:57Z
Keywords
backend, pull
Assigned to
No Owner
Creator
Paolo Invernizzi

Comments

Comment #0 by paolo.invernizzi — 2022-11-29T08:36:49Z
It looks like Apple's linker is getting tighter on what it will allow: ~/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
Comment #1 by snarwin+bugzilla — 2022-12-03T19:40:29Z
According to a post on the forums [1], this can be worked around by setting the environment variable `MACOSX_DEPLOYMENT_TARGET=11`. [1] https://forum.dlang.org/post/[email protected]
Comment #2 by dlang-bot — 2023-01-02T18:01:27Z
@ibuclaw updated dlang/dmd pull request #14772 "ci: Update cirrus macOS image to M1-based runners" mentioning this issue: - compiler/test/Makefile: Workaround issue 23517 https://github.com/dlang/dmd/pull/14772
Comment #3 by dlang-bot — 2023-01-02T19:15:31Z
dlang/dmd pull request #14772 "ci: Update cirrus macOS image to M1-based runners" was merged into stable: - 87897025ff69957250325520b7215361d45f4084 by Iain Buclaw: compiler/test/Makefile: Workaround issue 23517 https://github.com/dlang/dmd/pull/14772
Comment #4 by dlang-bot — 2023-01-02T21:23:18Z
@ibuclaw created dlang/dmd pull request #14775 "merge stable" mentioning this issue: - ci: Update cirrus macOS image to M1-based runners (#14772) * druntime/test: Force makefile to x86 on Apple ARM cpu (dmd does not support ARM) * ci: Update cirrus macOS image to M1-based runners * compiler/test/Makefile: Workaround issue 23517 https://github.com/dlang/dmd/pull/14775
Comment #5 by dlang-bot — 2023-01-02T23:23:10Z
dlang/dmd pull request #14775 "merge stable" was merged into master: - 2549fe3a643e5a6b65f44ad48e0ddac333c4cb68 by Iain Buclaw: ci: Update cirrus macOS image to M1-based runners (#14772) * druntime/test: Force makefile to x86 on Apple ARM cpu (dmd does not support ARM) * ci: Update cirrus macOS image to M1-based runners * compiler/test/Makefile: Workaround issue 23517 https://github.com/dlang/dmd/pull/14775
Comment #6 by dlang-bot — 2023-01-04T12:44:46Z
@ntrel updated dlang/dmd pull request #14779 "Fix Issue 19649 - Misleading error for duplicate constraints" mentioning this issue: - ci: Update cirrus macOS image to M1-based runners (#14772) * druntime/test: Force makefile to x86 on Apple ARM cpu (dmd does not support ARM) * ci: Update cirrus macOS image to M1-based runners * compiler/test/Makefile: Workaround issue 23517 https://github.com/dlang/dmd/pull/14779
Comment #7 by dlang-bot — 2023-01-09T14:10:16Z
@BorisCarvajal updated dlang/dmd pull request #14796 "Remove some special cases from dmd.typesem.resolveHelper" mentioning this issue: - ci: Update cirrus macOS image to M1-based runners (#14772) * druntime/test: Force makefile to x86 on Apple ARM cpu (dmd does not support ARM) * ci: Update cirrus macOS image to M1-based runners * compiler/test/Makefile: Workaround issue 23517 https://github.com/dlang/dmd/pull/14796
Comment #8 by dlang-bot — 2023-01-11T15:41:06Z
@SixthDot updated dlang/dmd pull request #14803 "fix issue 23620 - 'alias this' is not respected in static array lengt…" mentioning this issue: - ci: Update cirrus macOS image to M1-based runners (#14772) * druntime/test: Force makefile to x86 on Apple ARM cpu (dmd does not support ARM) * ci: Update cirrus macOS image to M1-based runners * compiler/test/Makefile: Workaround issue 23517 https://github.com/dlang/dmd/pull/14803
Comment #9 by dlang-bot — 2023-01-11T20:42:05Z
@WalterBright updated dlang/dmd pull request #14790 "fix Issue 23218 - cgxmm.d:1373 assert fail" mentioning this issue: - ci: Update cirrus macOS image to M1-based runners (#14772) * druntime/test: Force makefile to x86 on Apple ARM cpu (dmd does not support ARM) * ci: Update cirrus macOS image to M1-based runners * compiler/test/Makefile: Workaround issue 23517 https://github.com/dlang/dmd/pull/14790
Comment #10 by dlang-bot — 2023-01-13T20:24:43Z
@dkorpel created dlang/dmd pull request #14813 "Merge Stable into master" mentioning this issue: - ci: Update cirrus macOS image to M1-based runners (#14772) * druntime/test: Force makefile to x86 on Apple ARM cpu (dmd does not support ARM) * ci: Update cirrus macOS image to M1-based runners * compiler/test/Makefile: Workaround issue 23517 https://github.com/dlang/dmd/pull/14813
Comment #11 by dlang-bot — 2023-01-14T03:45:22Z
@WalterBright updated dlang/dmd pull request #14805 "fix Issue 23614 - ImportC: __int128 not supported" mentioning this issue: - ci: Update cirrus macOS image to M1-based runners (#14772) * druntime/test: Force makefile to x86 on Apple ARM cpu (dmd does not support ARM) * ci: Update cirrus macOS image to M1-based runners * compiler/test/Makefile: Workaround issue 23517 https://github.com/dlang/dmd/pull/14805
Comment #12 by dlang-bot — 2023-02-24T11:07:23Z
@RazvanN7 updated dlang/dmd pull request #14884 "Fix Issue 23709 - Cannot use synchronized on shared class with -preview=nosharedaccess" mentioning this issue: - ci: Update cirrus macOS image to M1-based runners (#14772) * druntime/test: Force makefile to x86 on Apple ARM cpu (dmd does not support ARM) * ci: Update cirrus macOS image to M1-based runners * compiler/test/Makefile: Workaround issue 23517 https://github.com/dlang/dmd/pull/14884
Comment #13 by dlang-bot — 2023-02-24T11:54:35Z
@RazvanN7 updated dlang/dmd pull request #14909 "Fix Issue 23732 - Cannot create shared instance of class with -preview=nosharedaccess" mentioning this issue: - ci: Update cirrus macOS image to M1-based runners (#14772) * druntime/test: Force makefile to x86 on Apple ARM cpu (dmd does not support ARM) * ci: Update cirrus macOS image to M1-based runners * compiler/test/Makefile: Workaround issue 23517 https://github.com/dlang/dmd/pull/14909
Comment #14 by dlang-bot — 2024-02-22T12:52:36Z
@ibuclaw created dlang/dmd pull request #16224 "Fix Bugzilla 23517 - dmd with -g flag fails to link on macOS with unaligned pointer" fixing this issue: - Fix Bugzilla 23517 - dmd with -g flag fails to link on macOS with unaligned pointer https://github.com/dlang/dmd/pull/16224
Comment #15 by dlang-bot — 2024-02-22T13:52:41Z
dlang/dmd pull request #16224 "Fix Bugzilla 23517 - dmd with -g flag fails to link on macOS with unaligned pointer" was merged into stable: - cc300fe4aab76681c05cd7cbd085bdeed0ee8f6e by Iain Buclaw: Fix Bugzilla 23517 - dmd with -g flag fails to link on macOS with unaligned pointer https://github.com/dlang/dmd/pull/16224
Comment #16 by dlang-bot — 2024-03-01T23:56:57Z
dlang/dmd pull request #16276 "merge stable" was merged into master: - 6f2a6f919df2eb5ba03700e969495f8c53ddfdcb by Iain Buclaw: Fix Bugzilla 23517 - dmd with -g flag fails to link on macOS with unaligned pointer https://github.com/dlang/dmd/pull/16276