diff options
author | Moritz Angermann <moritz.angermann@gmail.com> | 2017-09-21 21:28:29 +0800 |
---|---|---|
committer | Moritz Angermann <moritz.angermann@gmail.com> | 2017-09-23 21:23:03 +0800 |
commit | c2373b7b09939027742626e4a7bbba05ea1f6850 (patch) | |
tree | 6384f1dbffad7e3e55d1403f62a993ebf1264560 /aclocal.m4 | |
parent | 65943a3cf1edb65506b3c076d6654b4994235e2f (diff) | |
download | haskell-c2373b7b09939027742626e4a7bbba05ea1f6850.tar.gz |
Additional LLVM_TARGET logic.
Summary:
This should help resolve the
compilcation that came up in Trac #14261
Test Plan: validate on various platforms
Reviewers: trofi, bgamari, austin, hvr
Reviewed By: trofi
Subscribers: rwbarton, thomie, erikd
GHC Trac Issues: #14261
Differential Revision: https://phabricator.haskell.org/D4004
Diffstat (limited to 'aclocal.m4')
-rw-r--r-- | aclocal.m4 | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/aclocal.m4 b/aclocal.m4 index 203d11f289..30fd220b11 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -109,6 +109,8 @@ AC_DEFUN([FPTOOLS_SET_PLATFORM_VARS], GHC_CONVERT_OS([$target_os], [$TargetArch], [TargetOS]) fi + GHC_LLVM_TARGET([$target_cpu],[$target_vendor],[$target_os],[LlvmTarget]) + GHC_SELECT_FILE_EXTENSIONS([$host], [exeext_host], [soext_host]) GHC_SELECT_FILE_EXTENSIONS([$target], [exeext_target], [soext_target]) windows=NO @@ -137,12 +139,12 @@ AC_DEFUN([FPTOOLS_SET_PLATFORM_VARS], TargetOS_CPP=` echo "$TargetOS" | sed -e 's/\./_/g' -e 's/-/_/g'` # we intend to pass trough --targets to llvm as is. - LLVMTarget_CPP=` echo "$target"` + LLVMTarget_CPP=` echo "$LlvmTarget"` echo "GHC build : $BuildPlatform" echo "GHC host : $HostPlatform" echo "GHC target : $TargetPlatform" - echo "LLVM target: $target" + echo "LLVM target: $LlvmTarget" AC_SUBST(BuildPlatform) AC_SUBST(HostPlatform) @@ -1880,6 +1882,24 @@ case "$1" in esac ]) +# GHC_LLVM_TARGET(target_cpu, target_vendor, target_os, llvm_target_var) +# -------------------------------- +# converts the canonicalized target into someting llvm can understand +AC_DEFUN([GHC_LLVM_TARGET], [ + case "$2-$3" in + hardfloat-*eabi) + llvm_target_vendor="unknown" + llvm_target_os="$3""hf" + ;; + *) + GHC_CONVERT_VENDOR([$2],[llvm_target_vendor]) + GHC_CONVERT_OS([$3],[$1],[llvm_target_os]) + ;; + esac + $4="$1-$llvm_target_vendor-$llvm_target_os" +]) + + # GHC_CONVERT_VENDOR(vendor, target_var) # -------------------------------- # converts vendor from gnu to ghc naming, and assigns the result to $target_var |