Bug 18507 – Linker errors on FreeBSD related to .data.d_dso_rec

Status
NEW
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
FreeBSD
Creation time
2018-02-23T16:16:49Z
Last change time
2024-12-13T18:57:19Z
Assigned to
No Owner
Creator
Jonathan M Davis
Moved to GitHub: dmd#17844 →

Attachments

IDFilenameSummaryContent-TypeSize
1681test.dFile which reproduces the issuetext/plain13726

Comments

Comment #0 by issues.dlang — 2018-02-23T16:16:49Z
Created attachment 1681 File which reproduces the issue If the attached file is compiled with dmd -main -unittest test.d on x86_64 FreeBSD 11.1 then I get this linker error: /usr/bin/ld: test.o: no group info for section .data.d_dso_rec /usr/bin/ld: test.o: no group info for section .text.d_dso_init /usr/bin/ld: test.o: no group info for section .dtors.d_dso_dtor /usr/bin/ld: test.o: no group info for section .ctors.d_dso_ctor I have no idea if x86 has the same problem or not, but the problem does not seem to occur on 64-bit Linux. So, the problem seems to be FreeBSD-specific. I have no clue whether older versions of FreeBSD have the problem or not, but in theory, we're only supporting the latest version of FreeBSD, which is currently 11.1. I'm sorry that the example code is as disgusting-looking as it is, but it's the result of several runs of dustmite on one of my projects, and the linker errors seem to happen only under some fairly specific circumstances, since it doesn't take much to tweak the code to make the problem go away - though I did manage to get the actual project to into a state where it was very hard to make the problem go away. Fortunately for the project, after some serious refactoring to remove some templated stuff that didn't turn out to be necessary, the problem went away, so this isn't currently blocking my project, but we really shouldn't be getting linker errors like this - especially when other platforms have no problem with the exact same code.
Comment #1 by robert.schadek — 2024-12-13T18:57:19Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17844 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB