On 05/09/16 18:48, Richard W.M. Jones wrote: > > 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 ...)
IIRC for a while we used to ship pre-compiled ACPI byte-code, for people who didn't have "iasl" installed. We could make this C source file gcc-only, and provide a pre-compiled assembly source file for those platforms that only have clang. Laszlo