On Mar 8, 4:20 am, Christian Kamm <[email protected]> wrote:
> On Friday 06 March 2009 10:32 [email protected] wrote:
>
> > I'am trying to build llvmdc on freebsd8/amd64.  make ldc works well
> > with following patch.but I can't make runtime. rt_stackBottom() in ldc/
> > runtime/internal/memory.d(91) can't compile.
>
> No, while there's basic support for FreeBSD, it's not yet usable. As you've
> noticed, the runtime, in particular memory.d, still need quite a bit of work.
> If you're interested in getting this to work, I recommend you take a look at
> GDC's memory.d - as far as I remember it has some FreeBSD code.

Yes,I noticed as far as i found the error.The functions seems
simple.but how to add a dependence in cmake's configure files?And void
initStaticDataPtrs() in runtime/internal/memory.d(322) also need work
(Maybe it can works like tango/gdc's initStaticDataPtrs).

----------------------------------------------------------------------------------------------------------
--- a/runtime/internal/memory.d Mon Mar 09 03:44:11 2009 +0100
+++ b/runtime/internal/memory.d Mon Mar 09 17:14:03 2009 +0800
@@ -135,6 +135,15 @@
             return cast(void*) 0x8048000;
         }
     }
+    else version( freebsd )
+    {
+        void* stack_origin;
+
+        if( _d_gc_freebsd_stack(&stack_origin) )
+            return stack_origin;
+        else // No way to signal an error
+            return null;
+    }
     else
     {
         static assert( false, "Operating system not supported." );


------freebsd_gc.c------------------
#include <unistd.h>
#include <sys/types.h>
#include <sys/sysctl.h>

int _d_gcc_gc_freebsd_stack(void ** out_origin)
{
    int nm[2] = {CTL_KERN, KERN_USRSTACK};
    size_t len = sizeof(void *);
    int r = sysctl(nm, 2, out_origin, &len, NULL, 0);

    return ! r;
}

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/ldc-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to