www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - Speculative request for insight

reply Russel Winder <russel winder.org.uk> writes:
Hi,

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


ldc2 -I=3D. -Jsource/resources -J. -I/usr/include/d/gtkd-3/ -I/home/users/r=
ussel/Built/include/d -I/home/users/russel/Built/include/d/yaml -I/home/use=
rs/russel/Built/include/d -g -of=3Dme-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/user=
s/russel/Built/lib -L-ldyaml source/about.d source/channel_names.d source/c=
onfiguration.d source/control_window.d source/frontend_manager.d source/fro=
ntend_window.d source/inotify_daemon.d source/main.d source/preference_dial=
og.d source/preferences.d
/home/users/russel/Built/lib/libdyaml.so: undefined reference to `_D3std4co=
nv__T7toCharsVii10TaVEQBd5ascii10LetterCasei1TmZQBrFNaNbNiNfmZ6Result5empty=
MFNaNbNdNiNfZb'
/home/users/russel/Built/lib/libdyaml.so: undefined reference to `_D3std4co=
nv__T7toCharsVii10TaVEQBd5ascii10LetterCasei1TmZQBrFNaNbNiNfmZ6Result8popFr=
ontMFNaNbNiNfZv'
/home/users/russel/Built/lib/libdyaml.so: undefined reference to `_D3std4co=
nv__T7toCharsVii10TaVEQBd5ascii10LetterCasei1TmZQBrFNaNbNiNfmZSQCsQCr__TQCp=
Vii10TaVQCki1TmZQDiFNaNbNiNfmZ6Result'
/home/users/russel/Built/lib/libdyaml.so: undefined reference to `_D3std4co=
nv__T7toCharsVii10TaVEQBd5ascii10LetterCasei1TmZQBrFNaNbNiNfmZ6Result6lengt=
hMFNaNbNdNiNfZm'
/home/users/russel/Built/lib/libdyaml.so: undefined reference to `_D3std4co=
nv__T7toCharsVii10TaVEQBd5ascii10LetterCasei1TmZQBrFNaNbNiNfmZ6Result5front=
MFNaNbNdNiNfZa'


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

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 sa=
me
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


--=20
Russel.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
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 2018
next sibling parent reply Johan Engelen <j j.nl> writes:
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 2018
parent reply Russel Winder <russel winder.org.uk> writes:
On Thu, 2018-05-17 at 17:33 +0000, Johan Engelen via digitalmars-d-ldc wrot=
e:
[=E2=80=A6]
=20
 Can you try the Dub build method with LDC and see if that does=20
 work?
dub build --compiler=3Dldc2 Complete successfully. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 18 2018
parent reply David Nadlinger <code klickverbot.at> writes:
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 2018
parent reply Basile B. <b2.temp gmx.com> writes:
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 20 2018
parent Johan Engelen <j j.nl> writes:
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
May 22 2018
prev sibling parent Basile B. <b2.temp gmx.com> writes:
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 17 2018