UML cross-platform build problems (was Re: [PATCH] include/linux/coda.h)

Jan Harkes
2001-05-22T16:57:04Z

On Tue, May 22, 2001 at 09:40:19AM -0700, Ryan Cumming wrote:
> On Tue, 22 May 2001, Alan Cox wrote:
>
> > If __linux__ is not defined by the cross compiler, then the cross compiler
> > is broken. A cross compiler has the same environment as the native compiler
> > for the target. The only stuff that should break (well should as in might) is
> > tools native built
> >
> > Or am I misunderstanding the report ?
>
> It is not a cross compiler, it is the FreeBSD native gcc. As I understood
> it, Linux is a self contained project and should be targetting the
> native platform, not Linux on that platform. A cross compiler should
> not be needed unless one is building for another CPU.

The problem is that the same coda.h header is also used as part of the
FreeBSD kernel to build a Coda kernel module. Both Linux and FreeBSD
have different include and typedef requirements for their kernel code.

There is no way for an identical coda.h header to recognize whether it
is built as part of the FreeBSD kernel or as part of a (UML) Linux
kernel, except if the parts that are OS dependent are not part of the
same header.

I agree that a UML kernel on FreeBSD should be a native binary and not
cross-compiled. However, this could be an UML specific problem and
-D__linux__ should be added to CFLAGS in arch/uml/Makefile as all
drivers and filesystems that are developed for different platforms and
share parts of their code are possibly affected.

Jan