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

From: H. Peter Anvin
Date: Tue Jul 10 2007 - 16:46:33 EST


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 file as a prelude before the main thing. Neither will help
> Linux right now of course.
>

-m16 is the right thing, and it also provides a proper hook for
eventually having a real 16-bit backend (there are at least two projects
for doing that.)

For now, I have:

CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
$(cflags-$(ARCH)) \
-Wall -Wstrict-prototypes \
-march=i386 -mregparm=3 \
-include $(srctree)/$(src)/code16gcc.h \
-fno-strict-aliasing -fomit-frame-pointer \
$(call cc-option, -ffreestanding) \
$(call cc-option, -fno-unit-at-a-time) \
$(call cc-option, -fno-toplevel-reorder) \
$(call cc-option, -fno-stack-protector) \
$(call cc-option, -mpreferred-stack-boundary=2)

... since that will require less violence to eventually hack in the
proper -m16 option if/when it becomes available.

-hpa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/