December 09, 2004
[DMD 0.109 Linux, Fedora Core 1]

If I just compile the library with
the Makefile (linux.mak), it skips
all the tests and reports Success ?
(since it doesn't define -unittest)

If I add -release -unittest, then it
also skips the unittests but that is
probably documented somewhere in the
D versioning documentation (I hope?)

So I enabled "-O -unittest" and also a
"-O2 -g" for CFLAGS (for the C parts)
and that runs all the tests upon start
(one fails, BTW, but that's a beside...)


But: if I enable *all*: "-O -release -unittest",
then the unittest program segfaults upon launch!

GDB reports the following stacktrace, for ./unittest:
> (gdb) bt
> #0  0x080604d2 in _D3std3uri10URI_EncodeFAwkZAa ()
> #1  0x0806093f in _D3std3uri6encodeFAaZAa ()
> #2  0x0806098c in _D3std3uri9unittest0FZv ()
> #3  0x080609c8 in _modtest_3std3uri ()
> #4  0x08052d2e in _moduleUnitTests ()
> #5  0x080524c9 in main ()

So, I tried adding an extra -g, and then DMD barfs ?
> dmd -c -O -g -release -unittest std/regexp.d
> Internal error: ../ztc/elfobj.c 1251

It probably should not crash, not even with all flags ?


And "make unittest" should most likely delete libphobos.a
and rebuild it using -unittest flag to DMD, to be useful...

--anders


PS.
Trying to run linux.mak with the usual "make -j2" gives a few warnings:
> warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.