Hi Helge,

> I did compiled xrdp (CVS version) on my hppa/PARISC Linux box (see:
> http://www.parisc-linux.org).
> When starting xrdp, it failed with:
>        endian wrong, edit arch.h

I'm glad this run time check worked and pointed you in the right direction.

> This error message is even correct, since PARISC is big-endian,
> while the source code was somehow miscompiled as little-endian.
>
> The following patch does fix xrdp for me on PARISC Linux.
>
> First, in arch.h, the autodetection of the endianess by the value
> of __BYTE_ORDER doesn't work, if __BYTE_ORDER hasn't been defined
> yet. My first part of the patch fixes this by #including <endian.h>
> on Linux architectures if __BYTE_ORDER wasn't defined yet.
> I assume this patch will fix other (big-endian) Linux builds too.

There are 2 defines xrdp / parse.h need to compile properly.
One is either B_ENDIAN or L_ENDIAN need to be defined and also,
NEED_ALIGN needs to be defined on most non x86 machines.
The first part of your patch takes care of the endian but the align
still depends on __hppa__ being defined.  I assume it is for you.
Up to this point, I've tried to not have any includes in arch.h.
Since we still use __hppa__ for align and __hppa__ is always big
endian, I just put it in the define for B_ENDIAN.
The best solution we will move to eventually, is the autotools can
detect both of these and define them in config.h.
Then, arch.h can include config.h.

> The second part of my patch is a little more special.
> All Linux platforms/architectures normally have EAGAIN and
> EWOULDBLOCK error codes #defined to the same value.
> AFAIK, there is only one exception, which is PARISC-Linux.
> PARISC-Linux needs to keep compatibility to HP-UX, which has
> different values for EAGAIN and EWOULDBLOCK as well.
> The different values do break xrdp, since it was only testing for
> EWOULDBLOCK, although the Linux kernel on PARISC-Linux just returns
> EAGAIN instead.
> Testing for both return codes fixed this for me (and will for HP-UX as
> well).
> On platforms where EAGAIN and EWOULDBLOCK refer to the same value,
> the compiler will usually just optimize out the test for EAGAIN.

NP, this is fine.

> It would be nice, if you could apply this patch to CVS head.

Thanks, I'm looking at the other patch too.

Jay

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
xrdp-devel mailing list
xrdp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xrdp-devel

Reply via email to