Patches for ghc-6.12.3-1
Just for the record. I don't know if they are needed for ghc 7.0.4 and
7.4.1, but here are the patches I would have used if the cross-compile
of 6.12.3-1 had succeeded. Fortunately the direct compilation from
6.6->6.10>6.12.3->7.0.4->7.4.1? by Samuel was successful.
diff -ur ghc6-6.12.3/aclocal.m4 ghc-6.12.3.buggy/aclocal.m4
--- ghc6-6.12.3/aclocal.m4 2010-06-09 20:10:08.000000000 +0200
+++ ghc-6.12.3.buggy/aclocal.m4 2012-02-03 10:50:58.000000000 +0100
@@ -123,7 +123,7 @@
# A variation of AC_CHECK_SIZEOF for computing the alignment restrictions of a
# given type. Defines ALIGNMENT_TYPE.
AC_DEFUN([FP_CHECK_ALIGNMENT],
-[AS_LITERAL_IF([$1], [],
+[AS_LITERAL_IF(m4_translit([[$1]], [*], [p]), [],
[AC_FATAL([$0: requires literal arguments])])[]dnl
AC_CHECK_TYPE([$1], [], [], [$3])[]dnl
m4_pushdef([fp_Cache], [AS_TR_SH([fp_cv_alignment_$1])])[]dnl
@@ -1279,7 +1279,7 @@
hppa*)
$2="hppa"
;;
- i386)
+ i386|i486|i586|i686)
$2="i386"
;;
ia64)
diff -ur ghc6-6.12.3/libraries/base/aclocal.m4 ghc-6.12.3.buggy/libraries/base/aclocal.m4
--- ghc6-6.12.3/libraries/base/aclocal.m4 2010-06-09 20:10:18.000000000 +0200
+++ ghc-6.12.3.buggy/libraries/base/aclocal.m4 2012-02-03 10:51:49.000000000 +0100
@@ -179,7 +179,7 @@
# prototype text as its second argument. It also calls AC_LANG_PROGRAM
# instead of AC_LANG_CALL
AC_DEFUN([FP_SEARCH_LIBS_PROTO],
-[AS_VAR_PUSHDEF([ac_Search], [ac_cv_search_$3])dnl
+[AS_VAR_PUSHDEF([ac_Search], [ac_cv_search_$1])dnl
AC_CACHE_CHECK([for library containing $1], [ac_Search],
[ac_func_search_save_LIBS=$LIBS
AC_LANG_CONFTEST([AC_LANG_PROGRAM([$2], [$3])])
Index: ghc6-6.12.3/rts/posix/OSThreads.c
===================================================================
--- ghc6-6.12.3.orig/rts/posix/OSThreads.c 2010-06-09 21:10:14.000000000 +03
00
+++ ghc6-6.12.3/rts/posix/OSThreads.c 2010-07-17 12:17:25.000000000 +0300
@@ -7,10 +7,10 @@
*
* --------------------------------------------------------------------------*/
-#if defined(__linux__)
+#if defined(__linux__) || defined(__GLIBC__)
/* We want GNU extensions in DEBUG mode for mutex error checking */
/* We also want the affinity API, which requires _GNU_SOURCE */
-#define _GNU_SOURCE
+#define _GNU_SOURCE 1
#endif
#include "PosixSource.h"
Index: ghc6-6.12.3/driver/mangler/ghc-asm.lprl
===================================================================
--- ghc6-6.12.3.orig/driver/mangler/ghc-asm.lprl 2012-02-03 11:22:59.000000000 +0100
+++ ghc-6.12.3/driver/mangler/ghc-asm.lprl 2012-02-03 10:16:04.000000000 +0100
@@ -160,7 +160,7 @@
$T_HDR_vector = "\.text\n\t\.align 4\n"; # NB: requires padding
#--------------------------------------------------------#
- } elsif ( $TargetPlatform =~ /^i386-.*-(solaris2|linux|gnu|freebsd|dragonfly|netbsd|openbsd|kfreebsdgnu)$/m ) {
+ } elsif ( $TargetPlatform =~ /^i386-.*-(solaris2|linux|gnu|freebsd|dragonfly|netbsd|openbsd|kfreebsdgnu|gnu*)$/m ) {
$T_STABBY = 0; # 1 iff .stab things (usually if a.out format)
$T_US = ''; # _ if symbols have an underscore on the front
@@ -216,7 +216,7 @@
$T_HDR_vector = "\.text\n\t\.align 8\n";
#--------------------------------------------------------#
- } elsif ( $TargetPlatform =~ /^x86_64-.*-(linux|openbsd|freebsd|dragonfly|netbsd)$/m ) {
+ } elsif ( $TargetPlatform =~ /^x86_64-.*-(linux|openbsd|freebsd|dragonfly|netbsd|kfreebsdgnu|gnu*)$/m ) {
$T_STABBY = 0; # 1 iff .stab things (usually if a.out format)
$T_US = ''; # _ if symbols have an underscore on the front
Index: ghc6-6.12.3/rts/Linker.c
===================================================================
--- ghc6-6.12.3.orig/rts/Linker.c 2012-02-03 11:22:59.000000000 +0100
+++ ghc-6.12.3/rts/Linker.c 2012-02-03 10:16:04.000000000 +0100
@@ -13,8 +13,8 @@
/* Linux needs _GNU_SOURCE to get RTLD_DEFAULT from <dlfcn.h> and
MREMAP_MAYMOVE from <sys/mman.h>.
*/
-#ifdef __linux__
-#define _GNU_SOURCE
+#ifdef defined(__linux__) || defined(__GLIBC__)
+#define _GNU_SOURCE 1
#endif
#include "Rts.h"
@@ -63,7 +63,7 @@
#include <sys/wait.h>
#endif
-#if defined(linux_HOST_OS) || defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS) || defined(darwin_HOST_OS)
+#if defined(linux_HOST_OS) || defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS) || defined(darwin_HOST_OS) || defined(kfreebsdgnu_HOST_OS) || defined(gnu_HOST_OS)
#define USE_MMAP
#include <fcntl.h>
#include <sys/mman.h>
@@ -74,7 +74,7 @@
#endif
-#if defined(linux_HOST_OS) || defined(solaris2_HOST_OS) || defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS)
+#if defined(linux_HOST_OS) || defined(solaris2_HOST_OS) || defined(freebsd_HOST_OS) || defined(kfreebsdgnu_HOST_OS) || defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS) || defined(gnu_HOST_OS)
# define OBJFORMAT_ELF
#elif defined(cygwin32_HOST_OS) || defined (mingw32_HOST_OS)
# define OBJFORMAT_PEi386
@@ -1410,7 +1410,7 @@
} else {
if ((W_)result > 0x80000000) {
// oops, we were given memory over 2Gb
-#if defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS)
+#if defined(freebsd_HOST_OS) || defined(kfreebsdgnu_HOST_OS) || defined(dragonfly_HOST_OS) || defined(gnu_HOST_OS)
// Some platforms require MAP_FIXED. This is normally
// a bad idea, because MAP_FIXED will overwrite
// existing mappings.
Reply to: