summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander von Gluck IV <kallisti5@unixzen.com>2019-01-21 23:30:06 +0000
committerAlexander von Gluck IV <kallisti5@unixzen.com>2019-01-22 03:11:25 +0000
commitcbed0d2930168ef15bfdeb02c6f12991094b1480 (patch)
tree8d776ea98c3b87df974835eb55802d16bf8a1f1c
parent1a3c5dfcab0776c9a9a057303f823cec16386517 (diff)
downloadmrust-cbed0d2930168ef15bfdeb02c6f12991094b1480.tar.gz
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"