Thread overview
Speculative request for insight
May 20
Basile B.
May 17
Basile B.
May 17
Hi,

My first attempt to use D-YAML has resulted in this error:


ldc2 -I=. -Jsource/resources -J. -I/usr/include/d/gtkd-3/ -I/home/users/russel/Built/include/d -I/home/users/russel/Built/include/d/yaml -I/home/users/russel/Built/include/d -g -of=me-tv -L-L/usr/lib/x86_64-linux-gnu/ -L-lgtkd-3 -L-ldl -L-L/home/users/russel/Built/lib -L-ldinotify -L-L/home/users/russel/Built/lib -L-ldyaml source/about.d source/channel_names.d source/configuration.d source/control_window.d source/frontend_manager.d source/frontend_window.d source/inotify_daemon.d source/main.d source/preference_dialog.d source/preferences.d
/home/users/russel/Built/lib/libdyaml.so: undefined reference to `_D3std4conv__T7toCharsVii10TaVEQBd5ascii10LetterCasei1TmZQBrFNaNbNiNfmZ6Result5emptyMFNaNbNdNiNfZb'
/home/users/russel/Built/lib/libdyaml.so: undefined reference to `_D3std4conv__T7toCharsVii10TaVEQBd5ascii10LetterCasei1TmZQBrFNaNbNiNfmZ6Result8popFrontMFNaNbNiNfZv'
/home/users/russel/Built/lib/libdyaml.so: undefined reference to `_D3std4conv__T7toCharsVii10TaVEQBd5ascii10LetterCasei1TmZQBrFNaNbNiNfmZSQCsQCr__TQCpVii10TaVQCki1TmZQDiFNaNbNiNfmZ6Result'
/home/users/russel/Built/lib/libdyaml.so: undefined reference to `_D3std4conv__T7toCharsVii10TaVEQBd5ascii10LetterCasei1TmZQBrFNaNbNiNfmZ6Result6lengthMFNaNbNdNiNfZm'
/home/users/russel/Built/lib/libdyaml.so: undefined reference to `_D3std4conv__T7toCharsVii10TaVEQBd5ascii10LetterCasei1TmZQBrFNaNbNiNfmZ6Result5frontMFNaNbNdNiNfZa'


I reported it on the D-YAML issues on GitHub:

https://github.com/dlang-community/D-YAML/issues/136

but the apparent claim is that it isn't a D-YAML issue per se, that this same problem arises in other contexts.

It is the case that the Dub build of the same code completes fine, so there is a hint that it might be an LDC specific issue.

So I am grasping at straws a bit I know, but does anyone here have any thoughts as to what might be wrong?

I am using Debian Sid, with packaged LDC:

|> ldc2 --version
LDC - the LLVM D compiler (1.8.0):
  based on DMD v2.078.3 and LLVM 5.0.2
  built with LDC - the LLVM D compiler (0.17.5)
  Default target: x86_64-pc-linux-gnu
  Host CPU: penryn
  http://dlang.org - http://wiki.dlang.org/LDC


-- 
Russel.
==========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk


May 17
On Thursday, 17 May 2018 at 09:16:04 UTC, Russel Winder wrote:
> 
> /home/users/russel/Built/lib/libdyaml.so: undefined reference to `_D3std4conv__T7toCharsVii10TaVEQBd5ascii10LetterCasei1TmZQBrFNaNbNiNfmZ6Result5emptyMFNaNbNdNiNfZb'

LDC's macOS Phobos 1.8.0 also doesn't contain
_D3std4conv__T7toCharsVii10TaVEQBd5ascii10LetterCasei1TmZQBrFNaNbNiNfmZ6Result5emptyMFNaNbNdNiNfZb
pure nothrow @property @nogc @safe bool std.conv.toChars!(10, char, 1, ulong).toChars(ulong).Result.empty()

but does contain
_D3std4conv__T7toCharsVii10TaVEQBd5ascii10LetterCasei1TlZQBrFNaNbNiNflZ6Result5emptyMFNaNbNdNiNfZb
pure nothrow @property @nogc @safe bool std.conv.toChars!(10, char, 1, long).toChars(long).Result.empty()

Looks like the compiler made a wrong template culling decision. Are you sure this does not occur with DMD?

> It is the case that the Dub build of the same code completes fine, so there is a hint that it might be an LDC specific issue.

Can you try the Dub build method with LDC and see if that does work?

Template instantiation bugs sometimes arise in separate compilation cases (what you are doing here). Would be a big help if you can dustmite it.

- Johan

May 17
On Thursday, 17 May 2018 at 09:16:04 UTC, Russel Winder wrote:
> Hi,
>
> My first attempt to use D-YAML has resulted in this error:
>
>
> [...]
>
> I reported it on the D-YAML issues on GitHub:
>
> https://github.com/dlang-community/D-YAML/issues/136
>
> but the apparent claim is that it isn't a D-YAML issue per se, that this same problem arises in other contexts.
>
> It is the case that the Dub build of the same code completes fine, so there is a hint that it might be an LDC specific issue.

For me too DUB build is fine.
My report was here: https://issues.dlang.org/show_bug.cgi?id=18234, although not very reduced it should still show the issue with almost the same linker errors.

Initially i used DMD (and tried with LDC yesterday after  your report) so this is not a LDC issue either.

May 18
On Thu, 2018-05-17 at 17:33 +0000, Johan Engelen via digitalmars-d-ldc wrote: […]
> 
> Can you try the Dub build method with LDC and see if that does work?

dub build --compiler=ldc2

Complete successfully.

-- 
Russel.
==========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk


May 20
On Friday, 18 May 2018 at 11:01:07 UTC, Russel Winder wrote:
> dub build --compiler=ldc2
>
> Complete successfully.

Yep, looks like it is https://issues.dlang.org/show_bug.cgi?id=18234 indeed, then.

This might either be due to over-zealous template instance elision, or due to unstable mangled names (e.g. because of attribute inference differing between the library and the executable compilation runs) – both front-end issues which we would inherit.

 — David
May 20
On Sunday, 20 May 2018 at 17:53:14 UTC, David Nadlinger wrote:
> On Friday, 18 May 2018 at 11:01:07 UTC, Russel Winder wrote:
>> dub build --compiler=ldc2
>>
>> Complete successfully.
>
> Yep, looks like it is https://issues.dlang.org/show_bug.cgi?id=18234 indeed, then.
>
> This might either be due to over-zealous template instance elision

Yeah that's the problem. This supposition gave me the idea to test with the
"-allinst" switch, which works for DMD. I don't know if LDC has it too.


May 22
On Sunday, 20 May 2018 at 21:51:47 UTC, Basile B. wrote:
> On Sunday, 20 May 2018 at 17:53:14 UTC, David Nadlinger wrote:
>>
>> This might either be due to over-zealous template instance elision
>
> Yeah that's the problem. This supposition gave me the idea to test with the
> "-allinst" switch, which works for DMD. I don't know if LDC has it too.

LDC also has that switch.

-Johan