<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>--&nbsp;<div>dwmw2<div>(Apologies&nbsp;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>&gt; I have this working with LLVM/Clang, and a PR is filed for GCC because<br>&gt; the current hacks we have to do to *try* to ensure that .code16gcc is<br>&gt; the first thing in the asm output are horrid.<br>&gt; <br>&gt; Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;<br>&gt; ---<br>&gt;&nbsp; arch/x86/Makefile | 15 +++++++++++----<br>&gt;&nbsp; 1 file changed, 11 insertions(+), 4 deletions(-)<br>&gt; <br>&gt; diff --git a/arch/x86/Makefile b/arch/x86/Makefile<br>&gt; index ef19271..60fc67d 100644<br>&gt; --- a/arch/x86/Makefile<br>&gt; +++ b/arch/x86/Makefile<br>&gt; @@ -13,14 +13,21 @@ endif<br>&gt; <br>&gt;&nbsp; # How to compile the 16-bit code.&nbsp; Note we always compile for -march=i386;<br>&gt;&nbsp; # that way we can complain to the user if the CPU is insufficient.<br>&gt; -REALMODE_CFLAGS        := -m32 -g -Os -D__KERNEL__ -DDISABLE_BRANCH_PROFILING \<br>&gt; +#<br>&gt; +# We really want GCC to have a -m16 option like clang, so that we don't<br>&gt; +# have to play these evil and unreliable tricks to ensure that our<br>&gt; +# asm(".code16gcc") is first in the asm output. http://gcc.gnu.org/PR59672<br>&gt; +CODE16GCC_CFLAGS := -m32 -include $(srctree)/arch/x86/boot/code16gcc.h \<br>&gt; +                &nbsp;&nbsp;&nbsp; $(call cc-option, -fno-toplevel-reorder,\<br>&gt; +                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $(call cc-option, -fno-unit-at-a-time))<br>&gt; +M16_CFLAGS         := -m16<br>&gt; +<br>&gt; +REALMODE_CFLAGS        := -g -Os -D__KERNEL__ -DDISABLE_BRANCH_PROFILING \<br>&gt; +                &nbsp;&nbsp; $(call cc-option, $(M16_CFLAGS), $(CODE16GCC_CFLAGS)) \<br>&gt;&nbsp;                 &nbsp;&nbsp; -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \<br>&gt; -                &nbsp;&nbsp; -include $(srctree)/arch/x86/boot/code16gcc.h \<br>&gt;&nbsp;                 &nbsp;&nbsp; -fno-strict-aliasing -fomit-frame-pointer -fno-pic \<br>&gt;&nbsp;                 &nbsp;&nbsp; -mno-mmx -mno-sse \<br>&gt;&nbsp;                 &nbsp;&nbsp; $(call cc-option, -ffreestanding) \<br>&gt; -                &nbsp;&nbsp; $(call cc-option, -fno-toplevel-reorder,\<br>&gt; -                &nbsp;&nbsp; $(call cc-option, -fno-unit-at-a-time)) \<br>&gt;&nbsp;                 &nbsp;&nbsp; $(call cc-option, -fno-stack-protector) \<br>&gt;&nbsp;                 &nbsp;&nbsp; $(call cc-option, -mpreferred-stack-boundary=2)<br>&gt;&nbsp; export REALMODE_CFLAGS<br><br>_______________________________________________<br>LLVMLinux mailing list<br>LLVMLinux@lists.linuxfoundation.org<br>https://lists.linuxfoundation.org/mailman/listinfo/llvmlinux<br></body>