digitalmars.D.learn - now I need -allinst when dmd compiles the unittest
- kdevel (11/11) Dec 01 2023 If I not use -allinst the linker complains when using the current
- Steven Schveighoffer (17/28) Dec 04 2023 Are you using -checkaction=context? I have discovered that this
- kdevel (6/13) Dec 16 2023 Right.
If I not use -allinst the linker complains when using the current msgpack-d v1.0.5, e.g. [...]msgpack-d/src/msgpack/package.d:203: undefined reference to `pure nothrow nogc safe immutable(char)[] core.internal.dassert._d_assert_fail!(int)._d_assert_fail!(int). d_assert_fail(scope const(immutable(char)[]), scope ref const(int), scope ref const(int))' [...]msgpack-d/src/msgpack/packer.d:1326: undefined reference to `pure nothrow nogc safe immutable(char)[] core.internal.dassert._d_assert_fail!(const(int))._d_assert_fail!(int). d_assert_fail(scope const(immutable(char)[]), scope ref const(int), scope const(int))' [...]/msgpack-d/src/msgpack/unpacker.d:1505: undefined reference to `pure nothrow nogc safe immutable(char)[] core.internal.dassert._d_assert_fail!(int)._d_assert_fail!(int). d_assert_fail(scope const(immutable(char)[]), scope ref const(int), scope ref const(int))'
Dec 01 2023
On Friday, 1 December 2023 at 22:00:52 UTC, kdevel wrote:If I not use -allinst the linker complains when using the current msgpack-d v1.0.5, e.g. [...]msgpack-d/src/msgpack/package.d:203: undefined reference to `pure nothrow nogc safe immutable(char)[] core.internal.dassert._d_assert_fail!(int)._d_assert_fail!(int). d_assert_fail(scope const(immutable(char)[]), scope ref const(int), scope ref const(int))' [...]msgpack-d/src/msgpack/packer.d:1326: undefined reference to `pure nothrow nogc safe immutable(char)[] core.internal.dassert._d_assert_fail!(const(int))._d_assert_fail!(int). d_assert_fail(scope const(immutable(char)[]), scope ref const(int), scope const(int))' [...]/msgpack-d/src/msgpack/unpacker.d:1505: undefined reference to `pure nothrow nogc safe immutable(char)[] core.internal.dassert._d_assert_fail!(int)._d_assert_fail!(int). d_assert_fail(scope const(immutable(char)[]), scope ref const(int), scope ref const(int))'Are you using -checkaction=context? I have discovered that this happens if you build with -checkaction=context, but druntime has not been built with it, or you are using betterC. What happens is that an assert failure will trigger a call to a druntime function, and the compiler thinks that function is already instantiated in druntime, so it skips emitting the function, and expects druntime to be linked. I'm unsure whether druntime has the appropriate checkaction functions built by default, but definitely if you use betterC it won't be linked. For reference: https://issues.dlang.org/show_bug.cgi?id=22374 https://issues.dlang.org/show_bug.cgi?id=22902 https://issues.dlang.org/show_bug.cgi?id=19937 You even reported one of these... -Steve
Dec 04 2023
On Tuesday, 5 December 2023 at 03:36:04 UTC, Steven Schveighoffer wrote:Are you using -checkaction=context?Right.[...] For reference: https://issues.dlang.org/show_bug.cgi?id=22374 https://issues.dlang.org/show_bug.cgi?id=22902 https://issues.dlang.org/show_bug.cgi?id=19937 You even reported one of these...Thanks for reminding me of these unfixed errors. Wouldn't it be advisable to automatically invoke -allinst whenever -checkaction=context is encountered?
Dec 16 2023