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

  • From: Konstantinos Margaritis <markos@xxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 27 May 2008 16:41:34 +0300

On Τρι 27 Μαι 2008, Axel Dörfler wrote:
> Stephan Assmus <superstippi@xxxxxx> wrote:
> > The patch proposed in this message seems wrong to me, and also
> > the patch
> > that Konstantinos posted. I think the real problem is in this
> > file:
> >
> > headers/private/fs_shell/fssh_api_wrapper.h
> >
> > This is what get's included instead of ByteOrder.h if the
> > bfs_shell is
> > built for the host platform. I might be wrong on this, it is as
> > much as I
> > could find out when trying to follow the include paths of the
> > problematic
> > files. Maybe Ingo can shed some light on this?
>
> It was definitely wrong. I changed it now (in r25671), but I
> couldn't find the fssh_*() swapping functions, so maybe it won't
> help -- but maybe there is some build magic I missed :-)

I won't help, I tried using the fssh_*() functions myself. After a 
little research, I found that the problem is that BFS when used 
inside BeOS/Haiku includes ByteOrder.h properly. However when built 
outside BeOS/Haiku, ByteOrder.h (and many other os specific includes 
in headers/build/os/support and headers/build/os) are not included, 
not even the include path is passed in gcc flags. Instead fssh_* 
includes are used, but these define the same macros with different 
names, and also declare these extern functions :

extern double __fssh_swap_double(double arg);
extern float  __fssh_swap_float(float arg);
extern uint64_t __fssh_swap_int64(uint64_t arg);
extern uint32_t __fssh_swap_int32(uint32_t arg);
extern uint16_t __fssh_swap_int16(uint16_t arg);

And this is the problem. Bfs files still use the old macros, which use 
__swap_int*() (ie without the fssh_ part). 
The thing is I don't know enough of Haiku's internals to see what 
would be the right solution. So far I see 2 solutions:

a) Duplicate ByteOrder.h only for bfs_shell and make sure it uses only 
the BFS_ macros with __swap_int*
b) Fix BFS and bfs_shell so that it uses the FSSH_ macros when built 
with BUILDING_FS_SHELL is defined.

Right now, I know my patch was wrong (I chose a quick & dirty hack 
which worked though), but I just wanted to make sure I found a way to 
the right solution.

> Konstantinos Margaritis <markos@xxxxxxxx> wrote:
> > 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 :/
>
> That would be great - it has pretty much stalled for too long
> already! If you need any insights, feel free to ask. In a nutshell,
> the PPC port is still missing many arch_*() kernel functions (in
> src/system/kernel/ arch/ppc). IIRC the next stopping point was
> missing PCI support (to be able to identify the boot volumes).

I'll be happy to help there, be prepared for many questions here and 
on IRC :)

Regards

Konstantinos

Other related posts: