mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-07-29 02:20:04 +02:00
Started changing target triple stuff, part of fixing #97
This commit is contained in:
19
dmd/mars.c
19
dmd/mars.c
@@ -829,8 +829,7 @@ int main(int argc, char *argv[], char** envp)
|
||||
global.params.isLE = true;
|
||||
global.params.is64bit = false;
|
||||
global.params.cpu = ARCHx86;
|
||||
global.params.tt_arch = "i686";
|
||||
global.params.data_layout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-f80:32:32-v64:64:64-v128:128:128-a0:0:64";
|
||||
//global.params.data_layout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-f80:32:32-v64:64:64-v128:128:128-a0:0:64";
|
||||
if (global.params.useInlineAsm) {
|
||||
VersionCondition::addPredefinedGlobalIdent("LLVM_InlineAsm_X86");
|
||||
}
|
||||
@@ -840,24 +839,21 @@ int main(int argc, char *argv[], char** envp)
|
||||
global.params.isLE = true;
|
||||
global.params.is64bit = true;
|
||||
global.params.cpu = ARCHx86_64;
|
||||
global.params.tt_arch = "x86_64";
|
||||
global.params.data_layout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64";
|
||||
//global.params.data_layout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64";
|
||||
}
|
||||
else if (strcmp(global.params.llvmArch,"ppc32")==0) {
|
||||
VersionCondition::addPredefinedGlobalIdent("PPC");
|
||||
global.params.isLE = false;
|
||||
global.params.is64bit = false;
|
||||
global.params.cpu = ARCHppc;
|
||||
global.params.tt_arch = "powerpc";
|
||||
global.params.data_layout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64";
|
||||
//global.params.data_layout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64";
|
||||
}
|
||||
else if (strcmp(global.params.llvmArch,"ppc64")==0) {
|
||||
VersionCondition::addPredefinedGlobalIdent("PPC64");
|
||||
global.params.isLE = false;
|
||||
global.params.is64bit = true;
|
||||
global.params.cpu = ARCHppc_64;
|
||||
global.params.tt_arch = "powerpc64";
|
||||
global.params.data_layout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64";
|
||||
//global.params.data_layout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64";
|
||||
}
|
||||
else {
|
||||
assert(0 && "Invalid arch");
|
||||
@@ -888,19 +884,16 @@ int main(int argc, char *argv[], char** envp)
|
||||
VersionCondition::addPredefinedGlobalIdent("Windows");
|
||||
VersionCondition::addPredefinedGlobalIdent("Win32");
|
||||
VersionCondition::addPredefinedGlobalIdent("mingw32");
|
||||
global.params.tt_os = "-pc-mingw32";
|
||||
break;
|
||||
|
||||
case OSLinux:
|
||||
VersionCondition::addPredefinedGlobalIdent("linux");
|
||||
VersionCondition::addPredefinedGlobalIdent("Posix");
|
||||
global.params.tt_os = "-pc-linux-gnu";
|
||||
break;
|
||||
|
||||
case OSMacOSX:
|
||||
VersionCondition::addPredefinedGlobalIdent("darwin");
|
||||
VersionCondition::addPredefinedGlobalIdent("Posix");
|
||||
global.params.tt_os = "-pc-darwin-gnu";
|
||||
break;
|
||||
|
||||
case OSFreeBSD:
|
||||
@@ -912,6 +905,10 @@ int main(int argc, char *argv[], char** envp)
|
||||
assert(false && "Target OS not supported");
|
||||
}
|
||||
|
||||
if (!global.params.targetTriple)
|
||||
global.params.targetTriple = DEFAULT_TARGET_TRIPLE;
|
||||
|
||||
Logger::println("Target triple: %s", global.params.targetTriple);
|
||||
|
||||
// Initialization
|
||||
Type::init();
|
||||
|
||||
@@ -142,9 +142,6 @@ struct Param
|
||||
// LDC stuff
|
||||
char *llvmArch;
|
||||
char forceBE;
|
||||
char *tt_arch;
|
||||
char *tt_os;
|
||||
char *data_layout;
|
||||
char output_ll;
|
||||
char output_bc;
|
||||
char output_s;
|
||||
@@ -154,6 +151,9 @@ struct Param
|
||||
char useInlineAsm;
|
||||
char fqnNames; // use fully qualified object names
|
||||
char noDefaultLib;
|
||||
|
||||
// target stuff
|
||||
char *targetTriple;
|
||||
};
|
||||
|
||||
struct Global
|
||||
|
||||
Reference in New Issue
Block a user