aboutsummaryrefslogtreecommitdiff
path: root/lang/ghc/files
diff options
context:
space:
mode:
authorGleb Popov <arrowd@FreeBSD.org>2018-08-31 08:51:33 +0000
committerGleb Popov <arrowd@FreeBSD.org>2018-08-31 08:51:33 +0000
commit12c54d92690e99bd70feb75f83e092c3df9a6fba (patch)
tree1c817ea769886f1a334866f09422eb9d32a3009c /lang/ghc/files
parent5217212a38cdd7da14fb30935ac22b5fa483f9d6 (diff)
downloadports-12c54d92690e99bd70feb75f83e092c3df9a6fba.tar.gz
ports-12c54d92690e99bd70feb75f83e092c3df9a6fba.zip
Notes
Diffstat (limited to 'lang/ghc/files')
-rw-r--r--lang/ghc/files/extra-patch-aclocal.m454
-rw-r--r--lang/ghc/files/patch-configure22
-rw-r--r--lang/ghc/files/patch-configure.ac4
-rw-r--r--lang/ghc/files/patch-llvm-targets10
4 files changed, 88 insertions, 2 deletions
diff --git a/lang/ghc/files/extra-patch-aclocal.m4 b/lang/ghc/files/extra-patch-aclocal.m4
new file mode 100644
index 000000000000..8adc3e28b4e3
--- /dev/null
+++ b/lang/ghc/files/extra-patch-aclocal.m4
@@ -0,0 +1,54 @@
+--- aclocal.m4.orig 2018-03-25 21:22:32 UTC
++++ aclocal.m4
+@@ -648,6 +648,14 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
+ $3="$$3 -D_HPUX_SOURCE"
+ $5="$$5 -D_HPUX_SOURCE"
+ ;;
++ arm*freebsd*)
++ # On arm/freebsd, tell gcc to generate Arm
++ # instructions (ie not Thumb) and to link using the gold linker.
++ # Forcing LD to be ld.gold is done in FIND_LD m4 macro.
++ $2="$$2 -marm"
++ $3="$$3 -Wl,-z,noexecstack"
++ $4="$$4 -z noexecstack"
++ ;;
+ arm*linux*)
+ # On arm/linux and arm/android, tell gcc to generate Arm
+ # instructions (ie not Thumb).
+@@ -656,6 +664,11 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
+ $4="$$4 -z noexecstack"
+ ;;
+
++ aarch64*freebsd*)
++ $3="$$3 -Wl,-z,noexecstack"
++ $4="$$4 -z noexecstack"
++ ;;
++
+ aarch64*linux*)
+ $3="$$3 -Wl,-z,noexecstack"
+ $4="$$4 -z noexecstack"
+@@ -1917,6 +1930,10 @@ case "$1" in
+ # converts the canonicalized target into someting llvm can understand
+ AC_DEFUN([GHC_LLVM_TARGET], [
+ case "$2-$3" in
++ *-freebsd*-gnueabihf)
++ llvm_target_vendor="unknown"
++ llvm_target_os="freebsd-gnueabihf"
++ ;;
+ hardfloat-*eabi)
+ llvm_target_vendor="unknown"
+ llvm_target_os="$3""hf"
+@@ -2361,13 +2378,6 @@ AC_DEFUN([FIND_LD],[
+ [enable_ld_override=yes])
+
+ find_ld() {
+- # Make sure the user didn't specify LD manually.
+- if test "z$LD" != "z"; then
+- AC_CHECK_TARGET_TOOL([LD], [ld])
+- LD_NO_GOLD=$LD
+- return
+- fi
+-
+ # Manually iterate over possible names since we want to ensure that, e.g.,
+ # if ld.lld is installed but gcc doesn't support -fuse-ld=lld, that we
+ # then still try ld.gold and -fuse-ld=gold.
diff --git a/lang/ghc/files/patch-configure b/lang/ghc/files/patch-configure
new file mode 100644
index 000000000000..a3ff7aea111a
--- /dev/null
+++ b/lang/ghc/files/patch-configure
@@ -0,0 +1,22 @@
+--- configure.orig 2018-03-06 20:04:54 UTC
++++ configure
+@@ -9108,6 +9108,19 @@ $as_echo_n "checking Setting up CFLAGS, LDFLAGS, IGNOR
+ IGNORE_LINKER_LD_FLAGS="$IGNORE_LINKER_LD_FLAGS -z noexecstack"
+ ;;
+
++ arm*freebsd*)
++ # On arm/freebsd, tell gcc to generate Arm
++ # instructions (ie not Thumb).
++ CFLAGS="$CFLAGS -marm"
++ LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"
++ IGNORE_LINKER_LD_FLAGS="$IGNORE_LINKER_LD_FLAGS -z noexecstack"
++ ;;
++
++ aarch64*freebsd*)
++ LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"
++ IGNORE_LINKER_LD_FLAGS="$IGNORE_LINKER_LD_FLAGS -z noexecstack"
++ ;;
++
+ powerpc-ibm-aix*)
+ # We need `-D_THREAD_SAFE` to unlock the thread-local `errno`.
+ CFLAGS="$CFLAGS -D_THREAD_SAFE"
diff --git a/lang/ghc/files/patch-configure.ac b/lang/ghc/files/patch-configure.ac
index 5a4a978d08ba..4d19057acf95 100644
--- a/lang/ghc/files/patch-configure.ac
+++ b/lang/ghc/files/patch-configure.ac
@@ -1,11 +1,11 @@
---- configure.ac.orig 2018-03-06 16:48:53 UTC
+--- configure.ac.orig 2018-04-17 19:30:22 UTC
+++ configure.ac
@@ -447,6 +447,9 @@ XCODE_VERSION()
dnl ** Building a cross compiler?
dnl --------------------------------------------------------------
CrossCompiling=NO
+
-+build=`echo $build | sed -e 's/amd64-/x86_64-/g; s/-freebsd.*$/-freebsd/g'`
++build=`echo $build | sed -e 's/amd64-/x86_64-/g; s/armv[[67]]-/arm-/g; s/-freebsd.*$/-freebsd/g'`
+
# If 'host' and 'target' differ, then this means we are building a cross-compiler.
if test "$TargetPlatform" != "$HostPlatform" ; then
diff --git a/lang/ghc/files/patch-llvm-targets b/lang/ghc/files/patch-llvm-targets
new file mode 100644
index 000000000000..8ea0574f54a7
--- /dev/null
+++ b/lang/ghc/files/patch-llvm-targets
@@ -0,0 +1,10 @@
+--- llvm-targets.orig 2018-03-17 14:04:41 UTC
++++ llvm-targets
+@@ -20,4 +20,7 @@
+ ,("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", ""))
+ ,("x86_64-apple-ios", ("e-m:o-i64:64-f80:128-n8:16:32:64-S128", "core2", ""))
++,("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"))
++,("aarch64-unknown-freebsd", ("e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128", "generic", "+neon"))
+ ]