From patchwork Tue Oct 13 21:29:12 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juergen Lock X-Patchwork-Id: 35901 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 362ADB7B7A for ; Wed, 14 Oct 2009 08:33:40 +1100 (EST) Received: from localhost ([127.0.0.1]:42194 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mxozx-0004n3-7C for incoming@patchwork.ozlabs.org; Tue, 13 Oct 2009 17:33:37 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MxozW-0004mi-Da for qemu-devel@nongnu.org; Tue, 13 Oct 2009 17:33:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MxozU-0004lO-LZ for qemu-devel@nongnu.org; Tue, 13 Oct 2009 17:33:09 -0400 Received: from [199.232.76.173] (port=34760 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MxozU-0004lL-IY for qemu-devel@nongnu.org; Tue, 13 Oct 2009 17:33:08 -0400 Received: from gelbbaer.kn-bremen.de ([78.46.108.116]:34468 helo=smtp.kn-bremen.de) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MxozU-0002ii-3e for qemu-devel@nongnu.org; Tue, 13 Oct 2009 17:33:08 -0400 Received: by smtp.kn-bremen.de (Postfix, from userid 10) id A02EB1E00367; Tue, 13 Oct 2009 23:33:05 +0200 (CEST) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.3/8.14.3) with ESMTP id n9DLTDqc029593; Tue, 13 Oct 2009 23:29:13 +0200 (CEST) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.3/8.14.3/Submit) id n9DLTCUF029592; Tue, 13 Oct 2009 23:29:12 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Tue, 13 Oct 2009 23:29:12 +0200 To: Juergen Lock Subject: [PATCH] multiboot.S patch for old as(1) (was: Re: [Qemu-devel] Some OpenBSD/amd64 build fixes) Message-ID: <20091013212912.GA11529@triton8.kn-bremen.de> References: <20090923203116.GF4859@overdrive.home.tratt.net> <20090923205502.GA4540@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20090923205502.GA4540@triton8.kn-bremen.de> User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: qemu-devel@nongnu.org, Laurence Tratt X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On Wed, Sep 23, 2009 at 10:55:02PM +0200, Juergen Lock wrote: > On Wed, Sep 23, 2009 at 09:31:16PM +0100, Laurence Tratt wrote: >[...] > > then the above error doesn't occur, but > > pc-bios/optionrom/multiboot.S dies as follows: > > > > $ > > AS optionrom/multiboot.o > > multiboot.S: Assembler messages: > > multiboot.S:116: Error: `%es:-4(%edi)' is not a valid 16 bit base/index > > expression > > $ > > > > What little Intel assembler I ever knew has long since departed from my > > brain, so I don't know why that error occurs, nor what a fix might be. > > > It occurs because of too old binutils (as(1) in this case), on FreeBSD > we now have a port for newer ones, > http://www.freshports.org/devel/binutils > so I depend on that and have the optionrom Makefile use the new as > like this: (the first change wrt CFLAGS is unrelated and has probably > been fixed in the meantime; it caused gmake to complain about > recursive use of CFLAGS.) > > Index: qemu/pc-bios/optionrom/Makefile > @@ -9,10 +9,13 @@ > > CFLAGS = -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin > CFLAGS += -I$(SRC_PATH) > -CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector,"") > +CFLAGS := $(CFLAGS) $(call cc-option, $(CFLAGS), -fno-stack-protector,"") > > build-all: multiboot.bin > > +%.o: %.S > + $(CC) -E $(CFLAGS) -o - -c $< |${LOCALBASE}/bin/as -V -Qy -o $@ > + > %.img: %.o > $(call quiet-command,$(LD) -Ttext 0 -e _start -s -o $@ $<," Building $(TARGET_DIR)$@") > That patch didn't seem to help on OpenBSD so I now finally got around making another one that just emits the bytes of the offending insn instead so people can keep using old assemblers: Signed-off-by: Juergen Lock --- a/pc-bios/optionrom/multiboot.S +++ b/pc-bios/optionrom/multiboot.S @@ -113,7 +113,10 @@ mmap_loop: /* entry size (mmap struct) & max buffer size (int15) */ movl $20, %ecx /* store entry size */ + /* old as(1) doesn't like this insn so emit the bytes instead: movl %ecx, %es:-4(%edi) + */ + .dc.b 0x26,0x67,0x66,0x89,0x4f,0xfc /* e820 */ movl $0x0000e820, %eax /* 'SMAP' magic */