From: "Woodhouse, David" <david.woodhouse@intel.com>
To: "Jan-Simon Möller" <dl9pf@gmx.de>
Cc: "llvmlinux@lists.linuxfoundation.org"
<llvmlinux@lists.linuxfoundation.org>,
"x86@kernel.org" <x86@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [llvmlinux] [PATCH 3/4] x86: Allow building 16-bit code with -m16 with toolchains that support it
Date: Tue, 14 Jan 2014 23:59:03 +0000 [thread overview]
Message-ID: <1389743943.30533.138.camel@shinybook.infradead.org> (raw)
In-Reply-To: <3418146.9929lmqnex@aragorn.auenland.lan>
[-- Attachment #1: Type: text/plain, Size: 2321 bytes --]
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@intel.com Intel Corporation
[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 4370 bytes --]
next prev parent reply other threads:[~2014-01-14 23:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-08 11:21 [PATCH 1/4] x86: Remove duplication of 16-bit CFLAGS David Woodhouse
2014-01-08 11:21 ` [PATCH 2/4] x86, boot: Use __attribute__((used)) to ensure videocard structs are emitted David Woodhouse
2014-01-22 2:03 ` [tip:x86/build] " tip-bot for David Woodhouse
2014-01-22 12:25 ` tip-bot for David Woodhouse
2014-01-08 11:21 ` [PATCH 3/4] x86: Allow building 16-bit code with -m16 with toolchains that support it David Woodhouse
2014-01-14 19:14 ` [llvmlinux] " Jan-Simon Möller
2014-01-14 23:59 ` Woodhouse, David [this message]
2014-01-22 0:54 ` David Woodhouse
2014-01-29 12:11 ` [PATCH] x86: Build 16-bit code with -m16 where possible David Woodhouse
2014-01-29 12:16 ` [PATCH v2] " David Woodhouse
2014-01-29 17:51 ` [tip:x86/build] x86, build: " tip-bot for David Woodhouse
2014-01-29 17:57 ` tip-bot for David Woodhouse
2014-01-30 16:10 ` tip-bot for David Woodhouse
2014-01-31 10:23 ` [PATCH] x86: " Pavel Machek
2014-01-08 11:21 ` [PATCH 4/4] x86, boot: Work around clang PR18415 David Woodhouse
2014-01-08 12:04 ` [llvmlinux] " PaX Team
2014-01-08 13:03 ` [llvmlinux] [PATCH 1/4] x86: Remove duplication of 16-bit CFLAGS Jan-Simon Möller
2014-01-22 2:03 ` [tip:x86/build] " tip-bot for David Woodhouse
2014-01-22 12:25 ` tip-bot for David Woodhouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1389743943.30533.138.camel@shinybook.infradead.org \
--to=david.woodhouse@intel.com \
--cc=dl9pf@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=llvmlinux@lists.linuxfoundation.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®