Re: [PATCH] fake pre-processor macros when building on non-FreeBSD system

2011-07-13 Thread Robert Millan
2011/7/13 Nathan Whitehorn : > The one I meant was the third one. Linux and FreeBSD happen, though not > entirely by chance, to use almost exactly the same ABI on most platforms > (but not all!). Assuming, and requiring, interchangeability of ABIs here > thus seems like a poor choice. Once you've d

Re: [PATCH] fake pre-processor macros when building on non-FreeBSD system

2011-07-12 Thread Alexander Kabaev
On Tue, 12 Jul 2011 23:59:05 +0200 Robert Millan wrote: > 2011/7/12 Alexander Kabaev : > > The fact that Linux compiler with manually undefined and re-defined > > platform macros can compile is a coincidence and is not guaranteed > > to work and certainly is not a goal of FreeBSD project so this

Re: [PATCH] fake pre-processor macros when building on non-FreeBSD system

2011-07-12 Thread Nathan Whitehorn
On 07/12/11 17:33, Robert Millan wrote: 2011/7/12 Nathan Whitehorn: On 07/12/11 16:06, Robert Millan wrote: Why would one need to build a cross-compiler in order to compile userland-agnostic code for the same CPU architecture? This would be like requiring a cross-compiler in order to build thi

Re: [PATCH] fake pre-processor macros when building on non-FreeBSD system

2011-07-12 Thread Robert Millan
2011/7/12 Nathan Whitehorn : > On 07/12/11 16:06, Robert Millan wrote: >> Why would one need to build a cross-compiler in order to compile >> userland-agnostic code for the same CPU architecture?  This would be >> like requiring a cross-compiler in order to build things like GRUB or >> SeaBIOS. > >

Re: [PATCH] fake pre-processor macros when building on non-FreeBSD system

2011-07-12 Thread Nathan Whitehorn
On 07/12/11 16:06, Robert Millan wrote: 2011/7/12 Alexander Kabaev: Whatever happened to using a proper cross-tool to do the job? Why would one need to build a cross-compiler in order to compile userland-agnostic code for the same CPU architecture? This would be like requiring a cross-compiler

Re: [PATCH] fake pre-processor macros when building on non-FreeBSD system

2011-07-12 Thread Oliver Pinter
On 7/12/11, Robert Millan wrote: > 2011/7/12 Oliver Pinter : >> +.if ${OPSYS} != "FreeBSD" >> >> and what's the status example on NetBSD? > > I didn't think of it. There are some instances of __NetBSD__ and also > __OpenBSD__ in the kernel tree, and the same problem can be fixed for > these two s

Re: [PATCH] fake pre-processor macros when building on non-FreeBSD system

2011-07-12 Thread Robert Millan
2011/7/12 Alexander Kabaev : > The fact that Linux compiler with manually undefined and re-defined > platform macros can compile is a coincidence and is not guaranteed to > work and certainly is not a goal of FreeBSD project so this can be > broken at any moment. There must be some missunderstandi

Re: [PATCH] fake pre-processor macros when building on non-FreeBSD system

2011-07-12 Thread Alexander Kabaev
On Tue, 12 Jul 2011 23:06:12 +0200 Robert Millan wrote: > 2011/7/12 Alexander Kabaev : > > Whatever happened to using a proper cross-tool to do the job? > > Why would one need to build a cross-compiler in order to compile > userland-agnostic code for the same CPU architecture? This would be > l

Re: [PATCH] fake pre-processor macros when building on non-FreeBSD system

2011-07-12 Thread Robert Millan
2011/7/12 Alexander Kabaev : > Whatever happened to using a proper cross-tool to do the job? Why would one need to build a cross-compiler in order to compile userland-agnostic code for the same CPU architecture? This would be like requiring a cross-compiler in order to build things like GRUB or S

Re: [PATCH] fake pre-processor macros when building on non-FreeBSD system

2011-07-12 Thread Alexander Kabaev
On Tue, 12 Jul 2011 22:00:56 +0200 Robert Millan wrote: > 2011/7/12 Oliver Pinter : > > +.if ${OPSYS} != "FreeBSD" > > > > and what's the status example on NetBSD? > > I didn't think of it. There are some instances of __NetBSD__ and also > __OpenBSD__ in the kernel tree, and the same problem ca

Re: [PATCH] fake pre-processor macros when building on non-FreeBSD system

2011-07-12 Thread Robert Millan
2011/7/12 Oliver Pinter : > +.if ${OPSYS} != "FreeBSD" > > and what's the status example on NetBSD? I didn't think of it. There are some instances of __NetBSD__ and also __OpenBSD__ in the kernel tree, and the same problem can be fixed for these two systems with minimal effort. Here's a new vers

[PATCH] fake pre-processor macros when building on non-FreeBSD system

2011-07-12 Thread Robert Millan
When building kernel code on a non-FreeBSD system, kernel source still expects pre-processor macros to be those of a FreeBSD system. If __linux__ is defined, build will break. If __FreeBSD__ isn't defined, build will break too. This small patch "fakes" the pre-processor macros of FreeBSD so that