summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge (Mutabah) <acessdev@gmail.com>2019-02-09 08:50:51 +0800
committerGitHub <noreply@github.com>2019-02-09 08:50:51 +0800
commit646f23cf8f37566cf5d86b58ffc15566e687072f (patch)
tree7a9382c2a9581c02538f4c0cdf2e27708a3da7b7
parent7b6fa5c6e7d6838c2479280dd3f8d14a43c13899 (diff)
parentcbed0d2930168ef15bfdeb02c6f12991094b1480 (diff)
downloadmrust-646f23cf8f37566cf5d86b58ffc15566e687072f.tar.gz
Merge pull request #102 from kallisti5/haiku-target-support
targets: Add x86_64 and arm targets for Haiku
-rw-r--r--src/trans/target.cpp14
-rw-r--r--tools/common/target_detect.h9
2 files changed, 23 insertions, 0 deletions
diff --git a/src/trans/target.cpp b/src/trans/target.cpp
index 316749be..70996fb0 100644
--- a/src/trans/target.cpp
+++ b/src/trans/target.cpp
@@ -511,6 +511,20 @@ namespace
ARCH_X86_64
};
}
+ else if(target_name == "arm-unknown-haiku")
+ {
+ return TargetSpec {
+ "unix", "haiku", "gnu", {CodegenMode::Gnu11, true, "arm-unknown-haiku", {}, {}},
+ ARCH_ARM32
+ };
+ }
+ else if(target_name == "x86_64-unknown-haiku")
+ {
+ return TargetSpec {
+ "unix", "haiku", "gnu", {CodegenMode::Gnu11, false, "x86_64-unknown-haiku", {}, {}},
+ ARCH_X86_64
+ };
+ }
else
{
::std::cerr << "Unknown target name '" << target_name << "'" << ::std::endl;
diff --git a/tools/common/target_detect.h b/tools/common/target_detect.h
index 0812c363..1bfc7dd9 100644
--- a/tools/common/target_detect.h
+++ b/tools/common/target_detect.h
@@ -75,6 +75,15 @@
// - Apple devices
#elif defined(__APPLE__)
# define DEFAULT_TARGET_NAME "x86_64-apple-macosx"
+// - Haiku
+#elif defined(__HAIKU__)
+# if defined(__x86_64__)
+# define DEFAULT_TARGET_NAME "x86_64-unknown-haiku"
+# elif defined(__arm__)
+# define DEFAULT_TARGET_NAME "arm-unknown-haiku"
+# else
+# warning "Unable to detect a suitable default target (Haiku)"
+# endif
// - Unknown
#else
# warning "Unable to detect a suitable default target"