On Tuesday, 5 May 2015 at 05:42:33 UTC, Kai Nacke wrote:
BTW: You can by-pass the Solaris ld by setting environment
variable LD_ALTEXEC to the ld binary you want to use.
Thanks for the tip: I set that to the binutils ld and got almost
all of druntime's tests to pass with a 64-bit binary. I only had
to comment out the additional druntime tests having to do with
exceptions. Maybe that's related to the link error
flamencofantasy pasted.
I also tried running the phobos unit tests, but I got a ton of
link errors, seemingly for stuff that should be there. I'll let
someone else track those down.
On Tuesday, 5 May 2015 at 14:19:00 UTC, flamencofantasy wrote:
However once I import std.stdio and make use of writeln the
build fails with the error below;
[root@smartmachine ~]# dmd hello.d
/opt/local/x86_64-sun-solaris2.11/bin/ld: error in
/opt/local/gcc47/lib/gcc/x86_64-sun-solaris2.11/4.7.4/crtend.o(.eh_frame);
no .eh_frame_hdr table will be created.
/opt/local/dmd/lib/libphobos2.a(file_8e0_5fb.o): In function
`_D3std4file15DirIteratorImpl4nextMFZb':
std/file.d:(.text._D3std4file15DirIteratorImpl4nextMFZb+0x7d):
undefined reference to `readdir64'
collect2: error: ld returned 1 exit status
--- errorlevel 1
[root@smartmachine ~]#
Hmm, I get no output when building and running the sample file
sieve.d. If I use core.stdc.stdio.printf instead, it works fine,
just not with std.stdio.writefln.
I did rebuild dmd, druntime and phobos with the binutils ld.
The linker will only be used for dmd, which won't matter since
it's C++ anyway. Druntime and phobos are libraries, so the
linker is unused until you build an executable that links against
them.
Should I give up?
Obviously dmd and phobos still have some issues to be fixed on
Solaris. It all depends on whether you'd like to pitch in on
fixing those. Alternatively, you can try building ldc, which Kai
has put some effort into getting working on Solaris/x86.