From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azoM2-0001td-PW for qemu-devel@nongnu.org; Mon, 09 May 2016 12:48:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azoLx-0006v1-0y for qemu-devel@nongnu.org; Mon, 09 May 2016 12:48:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59178) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azoLw-0006ur-Qy for qemu-devel@nongnu.org; Mon, 09 May 2016 12:48:16 -0400 Date: Mon, 9 May 2016 17:48:14 +0100 From: "Richard W.M. Jones" Message-ID: <20160509164814.GS1683@redhat.com> References: <1461600281-23048-1-git-send-email-rjones@redhat.com> <20160509132449.GF3372@stefanha-x1.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v6] Add optionrom compatible with fw_cfg DMA version List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel , Marc =?iso-8859-1?Q?Mar=ED?= , Eduardo Habkost , "Michael S. Tsirkin" , Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , Laszlo Ersek , Richard Henderson Actually there's a rather more fundamental problem. In the current linuxboot_dma.c we use asm statements at the top and bottom of the file (outside any function). The asm statements define the header and what I assume is the footer of the file. At any rate, they encode the size of the file (the calculation `.byte (_end - _start) / 512'). Clang just rearranges everything in the file, so the _start and _end asm snippets appear together at the beginning of the input to the assembler, and nothing works after that. So that pretty much screws up the whole project of trying to write an option ROM in C. Of course we're well outside any standards here. Can we tell clang users to use the GCC/pre-compiled option ROMs :-? Any other ideas? I don't think I've missed a flag (GCC has -fno-toplevel-reorder, but clang 3.8 doesn't ...) Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v