[ldc-dev] compiling phobos 1.058 by LDC 0.9.2 on FreeBSD

9 views
Skip to first unread message

sohgo

unread,
May 3, 2010, 4:13:25 AM5/3/10
to LDC - the LLVM D compiler
I have tried to compile phobos 1.058 by LDC 0.9.2 on FreeBSD 7.3R.
First, I added "import std.moduleinit;" to object.d. After that, I run
"gmake -f freebsd.mak DMD=ldmd", then I met compilation errors. I
wonder if they are bugs of LDC?

ldmd -c -O -release -w internal/object.d
Assertion failed: (finalinit->getType() == ir->classInfo->getType()-
>getContainedType(0) && "__ClassZ initializer does not match the
ClassInfo type"), function DtoDefineClassInfo, file /home/amber/sohgo/
d/ldc/gen/classes.cpp, line 830.
gmake: *** [object.o] Abort trap: 6 (core dumped)

ldmd -c -O -release -w std/perf.d
std/perf.d(36): Error: class std.perf.PerformanceCounterScope!
(PerformanceCounter).PerformanceCounterScope storage class has no
effect: auto
std/perf.d(130): Error: template instance
std.perf.PerformanceCounterScope!(PerformanceCounter) error
instantiating

ldmd -c -O -release -w internal/trace.d
internal/trace.d(867): Error: not allowed in naked function

ldmd -c -O -release -w std/loader.d
std/loader.d(485): Error: class std.loader.ExeModule storage class has
no effect: auto

--
You received this message because you are subscribed to the Google Groups "LDC - the LLVM D compiler" group.
To post to this group, send email to ldc...@googlegroups.com.
To unsubscribe from this group, send email to ldc-dev+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ldc-dev?hl=en.

Tomas Lindquist Olsen

unread,
May 3, 2010, 10:19:17 AM5/3/10
to LDC - the LLVM D compiler
On May 3, 10:13 am, sohgo <sohgo.takeu...@gmail.com> wrote:
> I have tried to compile phobos 1.058 by LDC 0.9.2 on FreeBSD 7.3R.
> First, I added "import std.moduleinit;" to object.d. After that, I run
> "gmake -f freebsd.mak DMD=ldmd", then I met compilation errors. I
> wonder if they are bugs of LDC?
>
> ldmd -c -O -release -w internal/object.d
> Assertion failed: (finalinit->getType() == ir->classInfo->getType()->getContainedType(0) && "__ClassZ initializer does not match the
>
> ClassInfo type"), function DtoDefineClassInfo, file /home/amber/sohgo/
> d/ldc/gen/classes.cpp, line 830.
> gmake: *** [object.o] Abort trap: 6 (core dumped)
>
> ldmd -c -O -release -w std/perf.d
> std/perf.d(36): Error: class std.perf.PerformanceCounterScope!
> (PerformanceCounter).PerformanceCounterScope storage class has no
> effect: auto
> std/perf.d(130): Error: template instance
> std.perf.PerformanceCounterScope!(PerformanceCounter) error
> instantiating
>
> ldmd -c -O -release -w internal/trace.d
> internal/trace.d(867): Error: not allowed in naked function
>
> ldmd -c -O -release -w std/loader.d
> std/loader.d(485): Error: class std.loader.ExeModule storage class has
> no effect: auto
>

LDC does not support phobos, instead you should get the Tango runtime
library and give that a try.

Hope it helps

sohgo

unread,
May 4, 2010, 12:03:31 AM5/4/10
to LDC - the LLVM D compiler


On 5月3日, 午後11:19, Tomas Lindquist Olsen <tomas.l.ol...@gmail.com>
wrote:
Thanks for your reply.

I have read http://www.dsource.org/projects/ldc/wiki/Docs#Violationsofthespecification
.
I understood the reason why the LDC did not support phobos.
The phobos uses some features that the LDC cannot implement with LLVM.
I guess that some of the above errors are due to these issues.
But if other issues were contained in the above errors, they would
help improving the LDC?

Christian Kamm

unread,
May 4, 2010, 3:19:34 AM5/4/10
to ldc...@googlegroups.com
On Tuesday 04 May 2010 06:03 sohgo wrote:
> But if other issues were contained in the above errors, they would
> help improving the LDC?

They're all LDC/DMD incompatibilities:

> > > ldmd -c -O -release -w internal/object.d
> > > Assertion failed: (finalinit->getType() ==
> > > ir->classInfo->getType()->getContainedType(0) && "__ClassZ initializer
> > > does not match the
> > > ClassInfo type"), function DtoDefineClassInfo, file /home/amber/sohgo/
> > > d/ldc/gen/classes.cpp, line 830.
> > > gmake: *** [object.o] Abort trap: 6 (core dumped)
> > >
> > > ldmd -c -O -release -w internal/trace.d
> > > internal/trace.d(867): Error: not allowed in naked function

Both are due to Phobos not supporting LDC.

> > > ldmd -c -O -release -w std/perf.d
> > > std/perf.d(36): Error: class std.perf.PerformanceCounterScope!
> > > (PerformanceCounter).PerformanceCounterScope storage class has no
> > > effect: auto
> > > std/perf.d(130): Error: template instance
> > > std.perf.PerformanceCounterScope!(PerformanceCounter) error
> > > instantiating
> > >
> > > ldmd -c -O -release -w std/loader.d
> > > std/loader.d(485): Error: class std.loader.ExeModule storage class has
> > > no effect: auto

This is caused by Phobos using 'auto class C' where it means to say 'scope
class C'. DMD still supports this ancient syntax, LDC does not.

Regards,
Christian

sohgo

unread,
May 4, 2010, 5:14:02 AM5/4/10
to LDC - the LLVM D compiler

On 5月4日, 午後4:19, Christian Kamm <k...@incasoftware.de> wrote:
> On Tuesday 04 May 2010 06:03 sohgo wrote:
>
> > But if other issues were contained in the above errors, they would
> > help improving the LDC?
>
> They're all LDC/DMD incompatibilities:

Thanks for the detailed explanation.
I have understood the current relationship between LDC and Phobos.

Thanks again.
Reply all
Reply to author
Forward
0 new messages