Re: [x86 setup 13/33] Header file to produce 16-bit code with gcc

2007-07-10 Thread Brian Gerst
Adrian Bunk wrote: > On Tue, Jul 10, 2007 at 01:42:48PM -0700, H. Peter Anvin wrote: >> Segher Boessenkool wrote: >>> Well at least with -fno-toplevel-reorder it is guaranteed >>> to work (not the same thing as "is working", heh, but fairly >>> close). >>> >>> It seems to me GCC should grow an opti

Re: [x86 setup 13/33] Header file to produce 16-bit code with gcc

2007-07-10 Thread Brian Gerst
Pawel Dziepak wrote: > On 7/10/07, Segher Boessenkool <[EMAIL PROTECTED]> wrote: >> > The alternative, of course, is to compile to an .s file and insert >> > .code16gcc into the .s file. This makes the Makefile uglier, but >> > would >> > be more resilient against oddball gcc changes. >> >> This w

Re: [x86 setup 13/33] Header file to produce 16-bit code with gcc

2007-07-10 Thread Segher Boessenkool
Looks good, except you don't want -fno-unit-at-a-time if -fno-toplevel-reorder works. And of course it would be good to get rid of -fno-strict-aliasing, but let's not go there today ;-P OK, how does this look: CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \

Re: [x86 setup 13/33] Header file to produce 16-bit code with gcc

2007-07-10 Thread H. Peter Anvin
Adrian Bunk wrote: >> >> For now, I have: > > Can't you use the global CFLAGS and append your specific ones? > No. A lot of the x86-64 flags don't work with -m32. >> CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \ > > -g ??? Leaves debugging information in setup.elf. It is

Re: [x86 setup 13/33] Header file to produce 16-bit code with gcc

2007-07-10 Thread H. Peter Anvin
Segher Boessenkool wrote: > >> For now, I have: >> >> CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \ >>$(cflags-$(ARCH)) \ >>-Wall -Wstrict-prototypes \ >>-march=i386 -mregparm=3 \ >>-include $(srctr

Re: [x86 setup 13/33] Header file to produce 16-bit code with gcc

2007-07-10 Thread Adrian Bunk
On Tue, Jul 10, 2007 at 01:42:48PM -0700, H. Peter Anvin wrote: > Segher Boessenkool wrote: > > > > Well at least with -fno-toplevel-reorder it is guaranteed > > to work (not the same thing as "is working", heh, but fairly > > close). > > > > It seems to me GCC should grow an option to insert .co

Re: [x86 setup 13/33] Header file to produce 16-bit code with gcc

2007-07-10 Thread H. Peter Anvin
Pawel Dziepak wrote: > > Unfortunately, .code16gcc is still experimental (at least binutils' > website says that). What is worse, it says that it is possible that > 16bit code produced on GCC won't work on pre-80386 processors (before > switching to protected mode you have to think about cpu as a

Re: [x86 setup 13/33] Header file to produce 16-bit code with gcc

2007-07-10 Thread Segher Boessenkool
It seems to me GCC should grow an option to insert .code16gcc by itself (-m16 perhaps?) -m16 is the right thing, Probably not actually, -m16 might have 16-bit "int" etc. -mabi=16 is closer to what other architectures do here. and it also provides a proper hook for eventually having a real 1

Re: [x86 setup 13/33] Header file to produce 16-bit code with gcc

2007-07-10 Thread Pawel Dziepak
On 7/10/07, Segher Boessenkool <[EMAIL PROTECTED]> wrote: > The alternative, of course, is to compile to an .s file and insert > .code16gcc into the .s file. This makes the Makefile uglier, but > would > be more resilient against oddball gcc changes. This would be even more fragile. The exact

Re: [x86 setup 13/33] Header file to produce 16-bit code with gcc

2007-07-10 Thread H. Peter Anvin
Segher Boessenkool wrote: > >> I'm a bit surprised about the claim w.r.t. -fno-unit-at-a-time (although >> I guess that is the default and one would thus typically not see this.) > > -fno-unit-at-a-time is the default on three year old compilers, > yes. Newer compilers have unit-at-a-time enable

Re: [x86 setup 13/33] Header file to produce 16-bit code with gcc

2007-07-10 Thread H. Peter Anvin
Segher Boessenkool wrote: > > Well at least with -fno-toplevel-reorder it is guaranteed > to work (not the same thing as "is working", heh, but fairly > close). > > It seems to me GCC should grow an option to insert .code16gcc > by itself (-m16 perhaps?) Or GAS could get a flag to include > a fi

Re: [x86 setup 13/33] Header file to produce 16-bit code with gcc

2007-07-10 Thread Segher Boessenkool
gcc for i386 can be used with the assembly prefix ".code16gcc" to generate 16-bit (real-mode) code. This header file provides the assembly prefix. This only works correctly with newer GCCs if you pass the -fno-toplevel-reorder option (and it only works on older GCC versions by accident). And o

Re: [x86 setup 13/33] Header file to produce 16-bit code with gcc

2007-07-10 Thread Segher Boessenkool
gcc for i386 can be used with the assembly prefix ".code16gcc" to generate 16-bit (real-mode) code. This header file provides the assembly prefix. This only works correctly with newer GCCs if you pass the -fno-toplevel-reorder option (and it only works on older GCC versions by accident). And

Re: [x86 setup 13/33] Header file to produce 16-bit code with gcc

2007-07-10 Thread H. Peter Anvin
H. Peter Anvin wrote: > > I'm a bit surprised about the claim w.r.t. -fno-unit-at-a-time (although > I guess that is the default and one would thus typically not see this.) > Got any pointers why that would cause a global asm() to be scrambled > around? > Never mind. It's quite right there in

Re: [x86 setup 13/33] Header file to produce 16-bit code with gcc

2007-07-10 Thread H. Peter Anvin
Andi Kleen wrote: > On Tuesday 10 July 2007 16:16:29 Segher Boessenkool wrote: >>> gcc for i386 can be used with the assembly prefix ".code16gcc" to >>> generate >>> 16-bit (real-mode) code. This header file provides the assembly >>> prefix. >> This only works correctly with newer GCCs if you

Re: [x86 setup 13/33] Header file to produce 16-bit code with gcc

2007-07-10 Thread Andi Kleen
On Tuesday 10 July 2007 16:16:29 Segher Boessenkool wrote: > > gcc for i386 can be used with the assembly prefix ".code16gcc" to > > generate > > 16-bit (real-mode) code. This header file provides the assembly > > prefix. > > This only works correctly with newer GCCs if you pass the > -fno-to

Re: [x86 setup 13/33] Header file to produce 16-bit code with gcc

2007-07-10 Thread Segher Boessenkool
gcc for i386 can be used with the assembly prefix ".code16gcc" to generate 16-bit (real-mode) code. This header file provides the assembly prefix. This only works correctly with newer GCCs if you pass the -fno-toplevel-reorder option (and it only works on older GCC versions by accident). Th