lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1389743943.30533.138.camel@shinybook.infradead.org>
Date:	Tue, 14 Jan 2014 23:59:03 +0000
From:	"Woodhouse, David" <david.woodhouse@...el.com>
To:	Jan-Simon Möller <dl9pf@....de>
CC:	"llvmlinux@...ts.linuxfoundation.org" 
	<llvmlinux@...ts.linuxfoundation.org>,
	"x86@...nel.org" <x86@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [llvmlinux] [PATCH 3/4] x86: Allow building 16-bit code with
 -m16 with toolchains that support it

On Tue, 2014-01-14 at 20:14 +0100, Jan-Simon Möller wrote:
> Hi David,
> 
> what version of clang did you use btw ?

This is LLVM HEAD + extra patches at git://,
http://git.infradead.org/users/dwmw2/llvm.git and the following patch to
clang HEAD:

diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td
index 948b448..9eeace1 100644
--- a/include/clang/Driver/Options.td
+++ b/include/clang/Driver/Options.td
@@ -964,6 +964,7 @@ def lazy__framework : Separate<["-"], "lazy_framework">, Flags<[LinkerInput]>;
 def lazy__library : Separate<["-"], "lazy_library">, Flags<[LinkerInput]>;
 def EL : Flag<["-"], "EL">, Flags<[DriverOption]>;
 def EB : Flag<["-"], "EB">, Flags<[DriverOption]>;
+def m16 : Flag<["-"], "m16">, Group<m_Group>, Flags<[DriverOption, CoreOption]>;
 def m32 : Flag<["-"], "m32">, Group<m_Group>, Flags<[DriverOption, CoreOption]>;
 def mqdsp6_compat : Flag<["-"], "mqdsp6-compat">, Group<m_Group>, Flags<[DriverOption,CC1Option]>,
   HelpText<"Enable hexagon-qdsp6 backward compatibility">;
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index 253a083..8248149 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -1911,12 +1911,20 @@ static llvm::Triple computeTargetTriple(StringRef DefaultTargetTriple,
     return Target;
 
   // Handle pseudo-target flags '-m32' and '-m64'.
-  if (Arg *A = Args.getLastArg(options::OPT_m32, options::OPT_m64)) {
+  if (Arg *A = Args.getLastArg(options::OPT_m32, options::OPT_m64, options::OPT_m16)) {
     llvm::Triple::ArchType AT;
     if (A->getOption().matches(options::OPT_m32))
       AT = Target.get32BitArchVariant().getArch();
-    else
+    else if (A->getOption().matches(options::OPT_m64))
       AT = Target.get64BitArchVariant().getArch();
+    else if (A->getOption().matches(options::OPT_m16)) {
+      AT = Target.get32BitArchVariant().getArch();
+      if (AT == llvm::Triple::x86)
+        Target.setEnvironment(llvm::Triple::CODE16);
+      else
+        AT = llvm::Triple::UnknownArch;
+    }
+
     if (AT != llvm::Triple::UnknownArch)
       Target.setArch(AT);
   }
-- 
1.8.3.1



-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@...el.com                              Intel Corporation

Download attachment "smime.p7s" of type "application/x-pkcs7-signature" (4370 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ