Commits

Wolfgang Steffens  committed 938f9d2

Fixes for compiling phobos2 for PowerPC.

== setjmp.d ==
Added definitions for __jmp_buf as per native setjmp.h

== Makefile.am/.in ==
Added -mregnames for properly assembling the threadasm.S

Added threadasm.o as core object to actually assemble threadasm.S
** This most likeley needs to be made PPC/conditionally only in order to work with non PPC targets **

== ldfuncs-ppclinux ==
Replaced all Clong_d occurances with __builtin_Clong
Aliasing Clong_d seems to be a phobos1 artifact. Followed the phobos2/config/ldfuncs-darwin here.

  • Participants
  • Parent commits 87241c8

Comments (0)

Files changed (4)

File d/druntime/core/sys/posix/setjmp.d

     {
         alias int[64] __jmp_buf;
     }
+    else version (PPC)
+    {
+        alias int[64 + (12*4)] __jmp_buf;
+    }
+    else version (PPC64)
+    {
+        alias long[64] __jmp_buf;   
+    }
     else
         static assert(0);
     struct __jmp_buf_tag

File d/phobos2/Makefile.am

 	$(CC) -o $@ $(OUR_CFLAGS) $(CFLAGS) -c $<
 
 .S.o:
-	$(CC) -o $@ $(OUR_CFLAGS) $(CFLAGS) -c $<
+	$(CC) -o $@ $(OUR_CFLAGS) $(CFLAGS) -mregnames -c $<
 
 %.t.o : %.d $(D_PREREQ_SRCS)
 	$(GDC) -o $@ $(ALL_DFLAGS) -fno-release -funittest -fversion=Unittest -c $<
 
 CORE_OBJS=core/atomic.o core/cpuid.o core/demangle.o core/exception.o \
 	  core/math.o core/memory.o core/runtime.o core/simd.o \
-	  core/thread.o core/time.o core/vararg.o core/sync/barrier.o \
+	  core/thread.o core/threadasm.o core/time.o core/vararg.o core/sync/barrier.o \
 	  core/sync/condition.o core/sync/config.o core/sync/exception.o \
 	  core/sync/mutex.o core/sync/rwmutex.o core/sync/semaphore.o
 

File d/phobos2/Makefile.in

 
 CORE_OBJS = core/atomic.o core/cpuid.o core/demangle.o core/exception.o \
 	  core/math.o core/memory.o core/runtime.o core/simd.o \
-	  core/thread.o core/time.o core/vararg.o core/sync/barrier.o \
+	  core/thread.o core/threadasm.o core/time.o core/vararg.o core/sync/barrier.o \
 	  core/sync/condition.o core/sync/config.o core/sync/exception.o \
 	  core/sync/mutex.o core/sync/rwmutex.o core/sync/semaphore.o
 
 	$(CC) -o $@ $(OUR_CFLAGS) $(CFLAGS) -c $<
 
 .S.o:
-	$(CC) -o $@ $(OUR_CFLAGS) $(CFLAGS) -c $<
+	$(CC) -o $@ $(OUR_CFLAGS) $(CFLAGS) -mregnames -c $<
 
 %.t.o : %.d $(D_PREREQ_SRCS)
 	$(GDC) -o $@ $(ALL_DFLAGS) -fno-release -funittest -fversion=Unittest -c $<

File d/phobos2/config/ldfuncs-ppclinux

 real frexp( double, int * ); alias frexp frexpl;
 int ilogb( double ); alias ilogb ilogbl;
 real scalbn( double, int ); alias scalbn scalbnl;
-real scalbln( double, Clong_t ); alias scalbln scalblnl;
+real scalbln( double, __builtin_Clong ); alias scalbln scalblnl;
 real fabs( double ); alias fabs fabsl;
 real cbrt( double ); alias cbrt cbrtl;
 real hypot( double, double ); alias hypot hypotl;
 real floor( double ); alias floor floorl;
 real nearbyint( double ); alias nearbyint nearbyintl;
 real rint( double ); alias rint rintl;
-Clong_t lrint( double ); alias lrint lrintl;
+__builtin_Clong lrint( double ); alias lrint lrintl;
 long llrint( double ); alias llrint llrintl;
 real round( double ); alias round roundl;
-Clong_t lround( double ); alias lround lroundl;
+__builtin_Clong lround( double ); alias lround lroundl;
 long llround( double ); alias llround llroundl;
 real trunc( double ); alias trunc truncl;
 real fmod( double, real); alias fmod fmodl;
 real frexpl( real, int * );
 int ilogbl( real );
 real scalbnl( real, int );
-real scalblnl( real, Clong_t );
+real scalblnl( real, __builtin_Clong );
 real fabsl( real );
 real cbrtl( real );
 real hypotl( real, real );
 real floorl( real );
 real nearbyintl( real );
 real rintl( real );
-Clong_t lrintl( real );
+__builtin_Clong lrintl( real );
 long llrintl( real );
 real roundl( real );
-Clong_t lroundl( real );
+__builtin_Clong lroundl( real );
 long llroundl( real );
 real truncl( real );
 real fmodl( real, real);