[commit: ghc] ghc-8.4: llvm-targets: Add versioned ARM targets (f0f162b)

git at git.haskell.org git at git.haskell.org
Mon Aug 6 21:07:01 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.4
Link       : http://ghc.haskell.org/trac/ghc/changeset/f0f162b1cca33aeef8ff96caab3672b1059f537b/ghc

>---------------------------------------------------------------

commit f0f162b1cca33aeef8ff96caab3672b1059f537b
Author: Guillaume GARDET <guillaume.gardet at opensuse.org>
Date:   Fri May 18 08:56:28 2018 +0200

    llvm-targets: Add versioned ARM targets
    
    Namely armv6l-unknown-linux-gnueabihf and
    armv7l-unknown-linux-gnueabihf.
    
    (cherry picked from commit e4003b6dc6a84d870116de9f47057c15b1576f36)


>---------------------------------------------------------------

f0f162b1cca33aeef8ff96caab3672b1059f537b
 llvm-targets                          |  4 +++-
 utils/llvm-targets/gen-data-layout.sh | 35 +++++++++++++++++++++++------------
 2 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/llvm-targets b/llvm-targets
index 3c9da1e..b67ee6c 100644
--- a/llvm-targets
+++ b/llvm-targets
@@ -3,10 +3,12 @@
 ,("x86_64-unknown-windows", ("e-m:w-i64:64-f80:128-n8:16:32:64-S128", "x86-64", ""))
 ,("arm-unknown-linux-gnueabihf", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "arm1176jzf-s", "+strict-align"))
 ,("armv6-unknown-linux-gnueabihf", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "arm1136jf-s", "+strict-align"))
+,("armv6l-unknown-linux-gnueabihf", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "arm1176jzf-s", "+strict-align"))
 ,("armv7-unknown-linux-gnueabihf", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "generic", ""))
+,("armv7a-unknown-linux-gnueabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "generic", ""))
+,("armv7l-unknown-linux-gnueabihf", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "generic", ""))
 ,("aarch64-unknown-linux-gnu", ("e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128", "generic", "+neon"))
 ,("aarch64-unknown-linux", ("e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128", "generic", "+neon"))
-,("armv7a-unknown-linux-gnueabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "generic", ""))
 ,("i386-unknown-linux-gnu", ("e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128", "pentium4", ""))
 ,("i386-unknown-linux", ("e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128", "pentium4", ""))
 ,("x86_64-unknown-linux-gnu", ("e-m:e-i64:64-f80:128-n8:16:32:64-S128", "x86-64", ""))
diff --git a/utils/llvm-targets/gen-data-layout.sh b/utils/llvm-targets/gen-data-layout.sh
index 6f2aafc..3d9ded1 100755
--- a/utils/llvm-targets/gen-data-layout.sh
+++ b/utils/llvm-targets/gen-data-layout.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # llvm-target generator
 #
@@ -16,17 +16,28 @@
 # Add missing targets to the list below to have them included in
 # llvm-targets file.
 
-# Target sets
-WINDOWS_x86="i386-unknown-windows i686-unknown-windows x86_64-unknown-windows"
-LINUX_ARM="arm-unknown-linux-gnueabihf armv6-unknown-linux-gnueabihf armv7-unknown-linux-gnueabihf aarch64-unknown-linux-gnu aarch64-unknown-linux armv7a-unknown-linux-gnueabi"
-LINUX_x86="i386-unknown-linux-gnu i386-unknown-linux x86_64-unknown-linux-gnu x86_64-unknown-linux"
-ANDROID="armv7-unknown-linux-androideabi aarch64-unknown-linux-android"
-QNX="arm-unknown-nto-qnx-eabi"
-MACOS="i386-apple-darwin x86_64-apple-darwin"
-IOS="armv7-apple-ios arm64-apple-ios i386-apple-ios x86_64-apple-ios"
+# Target sets for which to generate the llvm-targets file
+TARGETS=(
+    # Windows x86
+    "i386-unknown-windows" "i686-unknown-windows" "x86_64-unknown-windows"
 
-# targets for which to generate the llvm-targets file
-TARGETS="${WINDOWS_x86} ${LINUX_ARM} ${LINUX_x86} ${ANDROID} ${QNX} ${MACOS} ${IOS}"
+    # Linux ARM
+    "arm-unknown-linux-gnueabihf" "armv6-unknown-linux-gnueabihf" "armv6l-unknown-linux-gnueabihf"
+    "armv7-unknown-linux-gnueabihf" "armv7a-unknown-linux-gnueabi" "armv7l-unknown-linux-gnueabihf"
+    "aarch64-unknown-linux-gnu" "aarch64-unknown-linux"
+    # Linux x86
+    "i386-unknown-linux-gnu" "i386-unknown-linux" "x86_64-unknown-linux-gnu" "x86_64-unknown-linux"
+    # Linux Android
+    "armv7-unknown-linux-androideabi" "aarch64-unknown-linux-android"
+
+    # QNX
+    "arm-unknown-nto-qnx-eabi"
+
+    # macOS
+    "i386-apple-darwin" "x86_64-apple-darwin"
+    # iOS
+    "armv7-apple-ios arm64-apple-ios" "i386-apple-ios x86_64-apple-ios"
+)
 
 # given the call to clang -c11 that clang --target -v generates,
 # parse the -target-cpu <CPU> and -target-feature <feature> from
@@ -61,7 +72,7 @@ FST=1
 FILE=_____dummy.c
 touch $FILE
 
-for target in $TARGETS; do
+for target in "${TARGETS[@]}"; do
     # find the cpu and attributes emitte by clang for the given $target
     CPU=""
     ATTR=()



More information about the ghc-commits mailing list