On Wed, Jan 29, 2014 at 8:52 AM, Jakub Jelinek <ja...@redhat.com> wrote: > On Wed, Jan 29, 2014 at 08:39:55AM -0800, H.J. Lu wrote: >> -m16 is used by Linux kernel, which checks if the compiler supports -m16 >> and uses it if it does. Adding gas --code16gcc check is an additional change >> in Linux kernel. Clang already supports -m16, which generates objects >> directly. Adding gas --code16gcc check doesn't help clang. Add -m16 >> to gcc makes gcc and clang consistent to Linux kernel build. > > Not everything clang/llvm comes up with is a good idea to follow (numerous > examples in mind, won't list them here, don't want to start a flamewar). > Given that .code16gcc is really a hack in the assembler, I really think it > would be much better idea to just let kernel use -Wa,--code16gcc for this > hack. > Sure, if somebody started a full-blown 16-bit code generation support as > opposed to .code16gcc, -m16 would make sense (unless it would be a separate > backend).
As for as Linux kernel is concerned, they want -m16 to generate 16-bit codes from C source, .code16gcc or a separate 16-bit backend make no difference to them. -- H.J.