<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body ><div>Head. With a trivial patch to add -m16 support, that I think I need to update since someone changed that code in clang this week. Will send new patch in a few hours when I get home.</div><div><br></div><div>And llvm from git://git.infradead.org/~dwmw2/llvm.git for the 16-bit support.</div><div><br></div>-- <div>dwmw2<div>(Apologies for HTML and top-posting; Android mailer is broken.)</div></div><br><br>-------- Original message --------<br>From: Jan-Simon Möller <dl9pf@gmx.de> <br>Date:14/01/2014 19:14 (GMT+00:00) <br>To: llvmlinux@lists.linuxfoundation.org <br>Cc: x86@kernel.org,David Woodhouse <David.Woodhouse@intel.com>,        linux-kernel@vger.kernel.org <br>Subject: Re: [llvmlinux] [PATCH 3/4] x86: Allow building 16-bit code with
        -m16 with toolchains that support it <br><br>Hi David,<br><br>what version of clang did you use btw ?<br><br>-- <br><br>Dipl.-Ing.<br>Jan-Simon Möller<br><br>jansimon.moeller@gmx.de<br>Am Mittwoch, 8. Januar 2014, 11:21:22 schrieb David Woodhouse:<br>> I have this working with LLVM/Clang, and a PR is filed for GCC because<br>> the current hacks we have to do to *try* to ensure that .code16gcc is<br>> the first thing in the asm output are horrid.<br>> <br>> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com><br>> ---<br>> arch/x86/Makefile | 15 +++++++++++----<br>> 1 file changed, 11 insertions(+), 4 deletions(-)<br>> <br>> diff --git a/arch/x86/Makefile b/arch/x86/Makefile<br>> index ef19271..60fc67d 100644<br>> --- a/arch/x86/Makefile<br>> +++ b/arch/x86/Makefile<br>> @@ -13,14 +13,21 @@ endif<br>> <br>> # How to compile the 16-bit code. Note we always compile for -march=i386;<br>> # that way we can complain to the user if the CPU is insufficient.<br>> -REALMODE_CFLAGS        := -m32 -g -Os -D__KERNEL__ -DDISABLE_BRANCH_PROFILING \<br>> +#<br>> +# We really want GCC to have a -m16 option like clang, so that we don't<br>> +# have to play these evil and unreliable tricks to ensure that our<br>> +# asm(".code16gcc") is first in the asm output. http://gcc.gnu.org/PR59672<br>> +CODE16GCC_CFLAGS := -m32 -include $(srctree)/arch/x86/boot/code16gcc.h \<br>> +                 $(call cc-option, -fno-toplevel-reorder,\<br>> +                 $(call cc-option, -fno-unit-at-a-time))<br>> +M16_CFLAGS         := -m16<br>> +<br>> +REALMODE_CFLAGS        := -g -Os -D__KERNEL__ -DDISABLE_BRANCH_PROFILING \<br>> +                 $(call cc-option, $(M16_CFLAGS), $(CODE16GCC_CFLAGS)) \<br>>                  -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \<br>> -                 -include $(srctree)/arch/x86/boot/code16gcc.h \<br>>                  -fno-strict-aliasing -fomit-frame-pointer -fno-pic \<br>>                  -mno-mmx -mno-sse \<br>>                  $(call cc-option, -ffreestanding) \<br>> -                 $(call cc-option, -fno-toplevel-reorder,\<br>> -                 $(call cc-option, -fno-unit-at-a-time)) \<br>>                  $(call cc-option, -fno-stack-protector) \<br>>                  $(call cc-option, -mpreferred-stack-boundary=2)<br>> export REALMODE_CFLAGS<br><br>_______________________________________________<br>LLVMLinux mailing list<br>LLVMLinux@lists.linuxfoundation.org<br>https://lists.linuxfoundation.org/mailman/listinfo/llvmlinux<br></body>