New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate TypeInfo objects as in template instances #3958
Conversation
I guess the build failures are caused by core.sys.linux.link and others not being part of the files to be compiled into druntime, but only merely imported. This is expected. However, I compiled this PR for Win32, and added checks for non-existing RTInfo as in #2480. The unittests build, but running the tests caused these error when building d_do_test:
|
I've updated druntime locally to build anything from the MANIFEST file and could build d_do_test (no idea how this is related), but now the test suite fails (with the RTInfo check):
It shows that using -allinst for TypeInfo does not really work, because it can generate wrong TypeInfo. |
I added the "Needs Approval" label because this PR changes what files need to be compiled. |
Can we move forward with this? Does it need a forum discussion? I implemented a different RTInfo for a variant of the precise GC, that is just a bit more complex and hit more link errors which #2480 could not fix. #2480 fights the symptoms, as many other fixes have tried with respect to TypeInfo, opEqual, opCmp, etc. The approach here removes the root of the problem, though it changes use of di-files slightly. |
I just ran across this pull request by accident, and I'm wondering if it would help a address a problem that I'm currently facing with I'm trying to use D for bare-metal, resource-constrained embedded systems (Proof of concept). Due to the way I'm not qualified to understand this implementation and what it specifically provides, so I ask: Would this pull request help tame Please advise. I'm desperate for a solution to this. I haven't been able to move forward with my ideas for almost a year because of this problem. |
This is outdated. |
TypeInfo
s and template instances are very similar, they are "generated" when the type is used ≒ the template is instantiated. And they are placed in COMDAT section to allow objcode duplication from each compilations.From 2.064, dmd has supported strict instantiation algorithm (#2550) to reduce executable size. I think we should modify
TypeInfo
generation algorithm to follow it.From Walter's suggestion (#2480 (comment)), this PR still supports old sloppy TypeInfo generation algorithm by
-allinst
switch.This PR is based on #3948.