From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from emailhub.stusta.mhn.de ([141.84.69.5]:57332 "EHLO mailhub.stusta.mhn.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758110AbXGJVmn (ORCPT ); Tue, 10 Jul 2007 17:42:43 -0400 Date: Tue, 10 Jul 2007 23:43:15 +0200 From: Adrian Bunk Subject: Re: [x86 setup 13/33] Header file to produce 16-bit code with gcc Message-ID: <20070710214315.GD3492@stusta.de> References: <11840359321823-git-send-email-hpa@zytor.com> <11840373002601-git-send-email-hpa@zytor.com> <108510B6-B9BE-49D4-BDCA-E25CA20CB29B@kernel.crashing.org> <200707101721.58937.ak@suse.de> <4693EF48.1080209@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4693EF48.1080209@zytor.com> Sender: linux-arch-owner@vger.kernel.org To: "H. Peter Anvin" Cc: Segher Boessenkool , Andi Kleen , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, akpm@linux-foundation.org List-ID: 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 .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: Can't you use the global CFLAGS and append your specific ones? > CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \ -g ??? > $(cflags-$(ARCH)) \ > -Wall -Wstrict-prototypes \ > -march=i386 -mregparm=3 \ Why -march=i386 ? > -include $(srctree)/$(src)/code16gcc.h \ > -fno-strict-aliasing -fomit-frame-pointer \ > $(call cc-option, -ffreestanding) \ No need to test, -ffreestanding is supported by all gcc versions we support. > $(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 cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed