Bug 23839 – Bogus unresolved ".eh" symbol error on macOS

Status
ASSIGNED
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Mac OS X
Creation time
2023-04-14T16:47:36Z
Last change time
2024-12-13T19:28:18Z
Keywords
backend, link-failure
Assigned to
No Owner
Creator
Sönke Ludwig
Moved to GitHub: dmd#20260 →

Attachments

IDFilenameSummaryContent-TypeSize
1870repro.zipReproduction case, run ./test.shapplication/zip1380

Comments

Comment #0 by sludwig — 2023-04-14T16:47:36Z
Created attachment 1870 Reproduction case, run ./test.sh The full error message when running the attached ./test.sh on DMD 2.103.0 is the following: --- Undefined symbols for architecture x86_64: "_c.ImageBuffer.copySubImage.eh", referenced from: __D1c11ImageBuffer6__ctorMFZCQBaQBb in lib.a(c_210_43d.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Error: linker exited with status 1 --- This appears to be a low-level bug involing a wrong index into a symbol table or a wrong binary offset of some kind, as adding or removing symbols in one place leads to different methods being affected. The original code base had multiple unresolved ".eh" symbols and multiple places that allegedly referenced those. I tried to reduce the code further for quite a long time (coming from a large code base), but couldn't really do it, changing almost anything will now make the error go away, removing the "import std;" in particular was not possible. Changing the length of string constants or symbol names will also shift the error to different methods. Compiling the same code in the same manner with LDC works without issues.
Comment #1 by ibuclaw — 2024-02-23T23:51:05Z
Current version of ld now emits: --- ld: invalid r_symbolnum=17 in 'lib.a[459](c_1c8_43d.o)' clang: error: linker command failed with exit code 1 (use -v to see invocation) Error: linker exited with status 1 --- Switching to ld_classic emits: --- Undefined symbols for architecture x86_64: "_c.ImageBuffer.copySubImage.eh", referenced from: __D1c11ImageBuffer6__ctorMFZCQBaQBb in lib.a(c_1c8_43d.o) ld: symbol(s) not found 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 #2 by robert.schadek — 2024-12-13T19:28:18Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20260 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB