Bug 23119 – Compiling glui example results in linker error

Status
NEW
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Mac OS X
Creation time
2022-05-17T15:16:17Z
Last change time
2024-12-13T19:22:53Z
Keywords
backend, link-failure
Assigned to
No Owner
Creator
Steven Schveighoffer
Moved to GitHub: dmd#18106 →

Comments

Comment #0 by schveiguy — 2022-05-17T15:16:17Z
According to https://github.com/dlang/dmd/blob/e9ba29d71b557fe079e95ee6554f116b24159bab/src/dmd/toobj.d#L524-L528 it appears the compiler intentionally does not produce working object files on Mach-O 64 bit. I ran into such a case. dub run glui:example-scroll This results in the following error: ``` Performing "debug" build using /Users/steves/.dvm/compilers/dmd-2.100.0/osx/bin/dmd for x86_64. ddmp 0.0.1-0.dev.3: target for configuration "library" is up to date. stdx-allocator 2.77.5: target for configuration "library" is up to date. libdparse 0.14.0: target for configuration "library" is up to date. fluent-asserts 0.13.3: target for configuration "library" is up to date. glui 0.5.0+commit.2.ge5c75a0: target for configuration "raylib3" is up to date. glui:example-scroll 0.5.0+commit.2.ge5c75a0: building configuration "application"... Linking... ld: in .dub/build/raylib3-debug-posix.osx.darwin-x86_64-dmd_v2.100.0-C3319142170DADE6FCBC42540E140297/libglui.a(style_macros_2be_a0bf.o), in section __TEXT,__textcoal_nt reloc 0: symbol index out of range clang: error: linker command failed with exit code 1 (use -v to see invocation) Error: linker exited with status 1 ``` This matches the description in the source (added with this PR: https://github.com/dlang/dmd/pull/10680) Note: you have to change the source for glui at the moment, or it won't build at all. Comment out the offending version line to see the error. I have a PR to fix this, will update once it is merged/released.
Comment #1 by bugzilla — 2022-05-17T15:32:55Z
But the linked=to line in toobj.d specifically excludes OBJ_MACH because of the error.
Comment #2 by schveiguy — 2022-05-17T17:08:13Z
I am completely ignorant on the compiler code. Iain noticed the same message in the comment and thought it might be related. But in any case, I *am* getting this error. So it may be happening elsewhere.
Comment #3 by schveiguy — 2022-05-17T17:10:40Z
A further note, until I upgraded xcode, I was not having errors. So it's likely some increase in strictness that the linker now requires.
Comment #4 by robert.schadek — 2024-12-13T19:22:53Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18106 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB