From patchwork Fri May 27 14:06:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 9138569 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 96F9A60467 for ; Fri, 27 May 2016 14:36:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89A011FFC7 for ; Fri, 27 May 2016 14:36:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E88A27B90; Fri, 27 May 2016 14:36:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 29F351FFC7 for ; Fri, 27 May 2016 14:36:40 +0000 (UTC) Received: from localhost ([::1]:46301 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6IsR-0008KP-Bh for patchwork-qemu-devel@patchwork.kernel.org; Fri, 27 May 2016 10:36:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6IOz-0004Pe-Qw for qemu-devel@nongnu.org; Fri, 27 May 2016 10:06:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6IOx-0004XK-OY for qemu-devel@nongnu.org; Fri, 27 May 2016 10:06:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56805) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6IOx-0004XB-J5 for qemu-devel@nongnu.org; Fri, 27 May 2016 10:06:11 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 215E8486C1; Fri, 27 May 2016 14:06:11 +0000 (UTC) Received: from [10.36.112.42] (ovpn-112-42.ams2.redhat.com [10.36.112.42]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4RE67fb003065 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 May 2016 10:06:09 -0400 To: "Richard W.M. Jones" , Peter Maydell References: <1464343604-517-1-git-send-email-pbonzini@redhat.com> <20160527133858.GR1683@redhat.com> From: Paolo Bonzini Message-ID: <35260c01-fb02-989e-f855-08591dbee9bf@redhat.com> Date: Fri, 27 May 2016 16:06:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160527133858.GR1683@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 27 May 2016 14:06:11 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: Re: [Qemu-devel] [PULL 00/31] Misc changes for 2016-05-27 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?Q?Marc_Mar=c3=ad?= , QEMU Developers Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP On 27/05/2016 15:38, Richard W.M. Jones wrote: > One way to solve this (which works for me) is as below. There are > some other approaches, eg. using -fno-leading-underscore, or using a > conditional macro to mangle the name. However I have no idea if there > is some preferred way. > > Rich. > > diff --git a/pc-bios/optionrom/linuxboot_dma.c b/pc-bios/optionrom/linuxboot_dma.c > index 86ef1ce..8509b28 100644 > --- a/pc-bios/optionrom/linuxboot_dma.c > +++ b/pc-bios/optionrom/linuxboot_dma.c > @@ -213,6 +213,9 @@ static uint32_t get_e801_addr(void) > return ret; > } > > +/* Force the asm name without leading underscore, even on Win32. */ > +extern void load_kernel(void) asm("load_kernel"); > + > void load_kernel(void) > { > void *setup_addr; Yes, that's what I wanted to do. I also need endif to work around what is likely a GCC bug. Paolo diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile index 2b11cd3..14e7f71 100644 --- a/pc-bios/optionrom/Makefile +++ b/pc-bios/optionrom/Makefile @@ -31,6 +31,7 @@ build-all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin ifdef CONFIG_WIN32 LD_EMULATION = i386pe +CFLAGS += -Wa,-32 else LD_EMULATION = elf_i386