[dmd-internals] Support of OpenBSD

Martin Nowak dawg at dawgfoto.de
Wed Aug 8 03:51:05 PDT 2012


On Tue, 07 Aug 2012 18:14:36 +0200, Konstantin Staver  
<mad.skipjack at gmail.com> wrote:

> Hi.
>
> I'm trying to port phobos2 and druntime2 to OpenBSD 5.1. I found next  
> problems:
>
Are you compiling HEAD?

> 1) D compiler loops with '-O -release' flags. For example:
> $ cat test.d
> module my_mod;
>
> void MyFunc()
> {
>     int[2] arr;
>     for (size_t i = 0; i < 2; ++i) {
>         arr[i] = 1;
>     }
> }
> $ pwd
> /home/walnut/work/druntime
> $ dmd -lib -oflib/libtest.a -m32 -O -release -Isrc ./test.d
> ^C
>
I will have a look at this. Can you recommend a live CD.

> 2) File druntime/src/rt/memory.d (http://goo.gl/iD3me). I don't know
> about gc_addRange params for OpenBSD :-(
>
You need to find bracket symbols for the relevant ELF sections.
You'll need to find writeable allocated sections and bracket symbols  
provided by the linker script.

What's your output of this?
----
SHELL=/bin/sh script sections.txt

echo "void main() {}" > main.d
dmd main
readelf --segments main
readelf --sections main

# ld --verbose for linker script
dmd main -L--verbose
exit
----

> 3) "Empty main()" program crashes with segfault.
>
> 4) "Hello world" program failed to build with flag "-g" or "-gc":
> $ cat hello.d
> import std.stdio;
> void main() { writeln("Hello, World!"); }
> $ dmd -gc hello.d
> Internal error: backend/cod3.c 2662
>
> 5) I don't know yet how implement poly from std.math (asm).
>
The only difference between OSes is the real padding, I guess it's 12byte  
as on linux and FreeBSD.

> I'll be glad to any help: tips, links to docs and etc.
>
> My work forks:
>  https://github.com/MadSkipjack/druntime
>  https://github.com/MadSkipjack/phobos
>
> Thanks.
> _______________________________________________
> dmd-internals mailing list
> dmd-internals at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-internals
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sections.txt
URL: <http://lists.puremagic.com/pipermail/dmd-internals/attachments/20120808/606192b3/attachment-0001.txt>


More information about the dmd-internals mailing list