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