[PATCH] [x32] Add X32 support to driver
Saleem Abdulrasool
compnerd at compnerd.org
Wed Jun 18 23:01:45 PDT 2014
================
Comment at: lib/Basic/Targets.cpp:3262
@@ -3260,4 +3261,3 @@
SuitableAlign = 128;
- IntMaxType = SignedLong;
- UIntMaxType = UnsignedLong;
- Int64Type = SignedLong;
+ if (IsX32) {
+ SizeType = UnsignedInt;
----------------
I think chaining the assignment here similar to above might be nicer.
================
Comment at: lib/Basic/Targets.cpp:3273
@@ -3265,2 +3272,3 @@
- DescriptionString = "e-m:e-i64:64-f80:128-n8:16:32:64-S128";
+ DescriptionString = (IsX32)
+ ? "e-m:e-p:32:32-i64:64-f80:128-n8:16:32:64-S128"
----------------
The two data layouts are identical except for the pointer size. Can you factor that out so that its more obvious and less redundant please?
================
Comment at: lib/Driver/ToolChains.cpp:2977
@@ -2955,1 +2976,3 @@
+ if (Triple.getEnvironment() == llvm::Triple::GNUX32)
+ return "libx32";
----------------
Can you add a check that arch is x86_64? Right now, you could make up ppc64---gnux32 if Im not mistaken.
================
Comment at: lib/Driver/Tools.cpp:6730
@@ -6729,1 +6729,3 @@
CmdArgs.push_back("--64");
+ } else if (getToolChain().getTriple().getEnvironment() ==
+ llvm::Triple::GNUX32) {
----------------
Can you do this inside the x86_64 case? Or is there a reason to make this its own case?
================
Comment at: lib/Driver/Tools.cpp:6928
@@ -6924,1 +6927,3 @@
return "/lib64/ld-linux.so.2";
+ else if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUX32)
+ return "/libx32/ld-linux-x32.so.2";
----------------
Can you extend this to check the arch?
================
Comment at: lib/Driver/Tools.cpp:7040
@@ -7034,1 +7039,3 @@
CmdArgs.push_back("elf64_s390");
+ else if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUX32)
+ CmdArgs.push_back("elf32_x86_64");
----------------
Here as well.
http://reviews.llvm.org/D4180
More information about the cfe-commits
mailing list