Commit 297879a7 authored by Ben Gamari's avatar Ben Gamari 🐢

Add support for FreeBSD arm

Test Plan: Tested on armv6, armv7 and aarch64 on FreeBSD 12-CURRENT.

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, erikd, carter

Differential Revision: https://phabricator.haskell.org/D4810
parent 6fbe5f27
...@@ -651,6 +651,14 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS], ...@@ -651,6 +651,14 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
$3="$$3 -D_HPUX_SOURCE" $3="$$3 -D_HPUX_SOURCE"
$5="$$5 -D_HPUX_SOURCE" $5="$$5 -D_HPUX_SOURCE"
;; ;;
arm*freebsd*)
# On arm/freebsd, tell gcc to generate Arm
# instructions (ie not Thumb).
$2="$$2 -marm"
$3="$$3 -Wl,-z,noexecstack"
$4="$$4 -z noexecstack"
;;
arm*linux*) arm*linux*)
# On arm/linux and arm/android, tell gcc to generate Arm # On arm/linux and arm/android, tell gcc to generate Arm
# instructions (ie not Thumb). # instructions (ie not Thumb).
...@@ -659,6 +667,10 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS], ...@@ -659,6 +667,10 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
$4="$$4 -z noexecstack" $4="$$4 -z noexecstack"
;; ;;
aarch64*freebsd*)
$3="$$3 -Wl,-z,noexecstack"
$4="$$4 -z noexecstack"
;;
aarch64*linux*) aarch64*linux*)
$3="$$3 -Wl,-z,noexecstack" $3="$$3 -Wl,-z,noexecstack"
$4="$$4 -z noexecstack" $4="$$4 -z noexecstack"
...@@ -1902,6 +1914,10 @@ case "$1" in ...@@ -1902,6 +1914,10 @@ case "$1" in
# converts the canonicalized target into someting llvm can understand # converts the canonicalized target into someting llvm can understand
AC_DEFUN([GHC_LLVM_TARGET], [ AC_DEFUN([GHC_LLVM_TARGET], [
case "$2-$3" in case "$2-$3" in
*-freebsd*-gnueabihf)
llvm_target_vendor="unknown"
llvm_target_os="freebsd-gnueabihf"
;;
hardfloat-*eabi) hardfloat-*eabi)
llvm_target_vendor="unknown" llvm_target_vendor="unknown"
llvm_target_os="$3""hf" llvm_target_os="$3""hf"
......
...@@ -23,4 +23,7 @@ ...@@ -23,4 +23,7 @@
,("aarch64-apple-ios", ("e-m:o-i64:64-i128:128-n32:64-S128", "generic", "+neon")) ,("aarch64-apple-ios", ("e-m:o-i64:64-i128:128-n32:64-S128", "generic", "+neon"))
,("i386-apple-ios", ("e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128", "yonah", "")) ,("i386-apple-ios", ("e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128", "yonah", ""))
,("x86_64-apple-ios", ("e-m:o-i64:64-f80:128-n8:16:32:64-S128", "core2", "")) ,("x86_64-apple-ios", ("e-m:o-i64:64-f80:128-n8:16:32:64-S128", "core2", ""))
,("aarch64-unknown-freebsd", ("e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128", "generic", "+neon"))
,("armv6-unknown-freebsd-gnueabihf", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "arm1176jzf-s", "+strict-align"))
,("armv7-unknown-freebsd-gnueabihf", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "generic", "+strict-align"))
] ]
...@@ -39,6 +39,9 @@ TARGETS=( ...@@ -39,6 +39,9 @@ TARGETS=(
"i386-apple-darwin" "x86_64-apple-darwin" "i386-apple-darwin" "x86_64-apple-darwin"
# iOS # iOS
"armv7-apple-ios arm64-apple-ios" "i386-apple-ios x86_64-apple-ios" "armv7-apple-ios arm64-apple-ios" "i386-apple-ios x86_64-apple-ios"
# FreeBSD ARM
"aarch64-unknown-freebsd" "armv6-unknown-freebsd-gnueabihf" "armv7-unknown-freebsd-gnueabihf"
) )
# given the call to clang -c11 that clang --target -v generates, # given the call to clang -c11 that clang --target -v generates,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment