summaryrefslogtreecommitdiff
path: root/tools/common/target_detect.h
diff options
context:
space:
mode:
authorGreg V <greg@unrelenting.technology>2018-06-27 18:05:00 +0300
committerGreg V <greg@unrelenting.technology>2018-06-27 18:05:00 +0300
commit671d31dc2e3b3a2812d98acb8fc0e5a26ec5e3c0 (patch)
tree579dcf53d7321768ee7b1e12d7f6c873eda2121d /tools/common/target_detect.h
parentc2ca872f68fc94d6a87478364f2932426f7c747a (diff)
downloadmrust-671d31dc2e3b3a2812d98acb8fc0e5a26ec5e3c0.tar.gz
Add FreeBSD and DragonFly targets
Also adjust macOS comment. FreeBSD also uses clang and lld (current dev version even uses lld as /usr/bin/ld), function-sections/gc-sections are very well supported. It's probably a Mach-O issue on Macs.
Diffstat (limited to 'tools/common/target_detect.h')
-rw-r--r--tools/common/target_detect.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/common/target_detect.h b/tools/common/target_detect.h
index 995ab6a4..a4c44ba4 100644
--- a/tools/common/target_detect.h
+++ b/tools/common/target_detect.h
@@ -34,6 +34,19 @@
# else
# define DEFAULT_TARGET_NAME "i586-windows-gnu"
# endif
+// - FreeBSD
+#elif defined(__FreeBSD__)
+# if defined(__amd64__)
+# define DEFAULT_TARGET_NAME "x86_64-unknown-freebsd"
+# elif defined(__aarch64__)
+# define DEFAULT_TARGET_NAME "aarch64-unknown-freebsd"
+# elif defined(__arm__)
+# define DEFAULT_TARGET_NAME "arm-unknown-freebsd"
+# elif defined(__i386__)
+# define DEFAULT_TARGET_NAME "i686-unknown-freebsd"
+# else
+# warning "Unable to detect a suitable default target (FreeBSD)"
+# endif
// - NetBSD
#elif defined(__NetBSD__)
# if defined(__amd64__)
@@ -54,6 +67,9 @@
# else
# warning "Unable to detect a suitable default target (OpenBSD)"
# endif
+// - DragonFly
+#elif defined(__DragonFly__)
+# define DEFAULT_TARGET_NAME "x86_64-unknown-dragonfly"
// - Apple devices
#elif defined(__APPLE__)
# define DEFAULT_TARGET_NAME "x86_64-apple-macosx"