[haiku-development] [PATCH] Attempts to build haiku on linux/ppc

  • From: Konstantinos Margaritis <markos@xxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 27 May 2008 14:48:10 +0300


First post on the list, hello everyone!

Ok, I wanted to try the ppc port of haiku and I got the latest svn and 
folllowed the instructions online, built the compiler/binutils/etc 
and started the build. Build failed immediately on the host tools, in 
particular bfs_shell. 
I found that __swap_*() functions were not being declared anywhere but 
were used in bfs_endian.h. I did a little testing around, I found a 
simple fix (I hardly think it's the right way, but I'd gladly prepare 
a proper patch with some pointer in the right direction). I attach 
the diff between current svn and my version -which compiles on ppc. I 
got some more failures afterwards, but I was told they was due to 
some changes in the Device Manager, so I'll try again later.



PS. I'm doing PowerPC/Cell coding for a living (in particular 
AltiVec/SPU optimizations, incl. a library with altivec optimized 
libc replacement functions, 3d, math stuff, etc) and I'd gladly help 
in the ppc port of Haiku, it will take me some time to understand its 
internals though :/
PS2. I was a very early BeOS user (my 603@180Mhz with BeOS was the 
fastest system I ever used, still beats many XP/Vista PCs out there, 
imho :). Thanks to Haiku I can have that experience again, thanks 
Index: src/add-ons/kernel/file_systems/bfs/bfs_endian.h
--- src/add-ons/kernel/file_systems/bfs/bfs_endian.h    (revision 25669)
+++ src/add-ons/kernel/file_systems/bfs/bfs_endian.h    (working copy)
@@ -28,6 +28,22 @@
        || defined(BFS_BIG_ENDIAN_ONLY) && B_HOST_IS_LENDIAN
                /* host is big endian, BFS is little endian or vice versa */
+#ifdef __cplusplus
+extern "C" {
+extern double __swap_double(double arg);
+extern float  __swap_float(float arg);
+extern uint64 __swap_int64(uint64 uarg);
+extern uint32 __swap_int32(uint32 uarg);
+extern uint16 __swap_int16(uint16 uarg);
+#ifdef __cplusplus
 #      define BFS_ENDIAN_TO_HOST_INT16(value) __swap_int16(value)
 #      define BFS_ENDIAN_TO_HOST_INT32(value) __swap_int32(value)
 #      define BFS_ENDIAN_TO_HOST_INT64(value) __swap_int64(value)

Other related posts: