Fix linker error in destroy under -betterC#2204
Fix linker error in destroy under -betterC#2204dlang-bot merged 1 commit intodlang:masterfrom JinShil:fix_destroy_link_error
Conversation
|
Thanks for your pull request, @JinShil! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + druntime#2204" |
|
If |
|
It is possible to make For example, did you know you can set the |
|
@JinShil Of course you're right. I was also writing under the mistaken assumption that slice copying not working in |
wilzbach
left a comment
There was a problem hiding this comment.
Though of course it would be great if betterC would support array copying out of the box, but well let's got step by step.
This is a followup to #2178
My fix was insufficient. Although it fixed the compiler error, there was still a linker error. Because we were copying two arrays, it was making a runtime call to
_d_arraycopy. Since the runtime is not linked in -betterC, it resulted in an unresolved reference error at link time.See the implementation of
_d_arraycopyatdruntime/src/rt/arraycat.d
Line 22 in 4a1d176
memcpy, so the array copy code was simply replaced with a direct call tomemcpy.The test case was also updated to compile and link.
Sorry for the mistake.