patches/glibc/ports-2.10.1/390-cross-compile-nptl.patch
changeset 1625 fde082da9813
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc/ports-2.10.1/390-cross-compile-nptl.patch	Fri Nov 13 21:37:18 2009 +0100
     1.3 @@ -0,0 +1,52 @@
     1.4 +A little hack for cross-compiling NPTL
     1.5 +
     1.6 +http://sourceware.org/ml/libc-alpha/2005-02/msg00043.html
     1.7 +
     1.8 +diff -durN glibc-2.10.1.orig/nptl/sysdeps/pthread/configure glibc-2.10.1/nptl/sysdeps/pthread/configure
     1.9 +--- glibc-2.10.1.orig/nptl/sysdeps/pthread/configure	2009-05-17 14:19:31.000000000 +0200
    1.10 ++++ glibc-2.10.1/nptl/sysdeps/pthread/configure	2009-11-13 00:50:43.000000000 +0100
    1.11 +@@ -78,6 +78,10 @@
    1.12 + fi
    1.13 + { echo "$as_me:$LINENO: result: $libc_cv_forced_unwind" >&5
    1.14 + echo "${ECHO_T}$libc_cv_forced_unwind" >&6; }
    1.15 ++if test $libc_cv_forced_unwind = no -a $build_cpu != $host_cpu; then
    1.16 ++  echo "$as_me:$LINENO: forcing libc_cv_forced_unwind = yes for cross-compile"
    1.17 ++  libc_cv_forced_unwind=yes
    1.18 ++fi
    1.19 + if test $libc_cv_forced_unwind = yes; then
    1.20 +   cat >>confdefs.h <<\_ACEOF
    1.21 + #define HAVE_FORCED_UNWIND 1
    1.22 +@@ -141,6 +145,10 @@
    1.23 + { echo "$as_me:$LINENO: result: $libc_cv_c_cleanup" >&5
    1.24 + echo "${ECHO_T}$libc_cv_c_cleanup" >&6; }
    1.25 +   CFLAGS="$old_CFLAGS"
    1.26 ++  if test $libc_cv_c_cleanup = no -a $build_cpu != $host_cpu; then
    1.27 ++    echo "$as_me:$LINENO: result: forcing libc_cv_c_cleanup = yes for cross-compile"
    1.28 ++    libc_cv_c_cleanup=yes
    1.29 ++  fi
    1.30 +   if test $libc_cv_c_cleanup = no; then
    1.31 +     { { echo "$as_me:$LINENO: error: the compiler must support C cleanup handling" >&5
    1.32 + echo "$as_me: error: the compiler must support C cleanup handling" >&2;}
    1.33 +diff -durN glibc-2.10.1.orig/nptl/sysdeps/pthread/configure.in glibc-2.10.1/nptl/sysdeps/pthread/configure.in
    1.34 +--- glibc-2.10.1.orig/nptl/sysdeps/pthread/configure.in	2003-12-03 07:50:01.000000000 +0100
    1.35 ++++ glibc-2.10.1/nptl/sysdeps/pthread/configure.in	2009-11-13 00:50:43.000000000 +0100
    1.36 +@@ -28,6 +28,9 @@
    1.37 + struct _Unwind_Context *context;
    1.38 + _Unwind_GetCFA (context)],
    1.39 + libc_cv_forced_unwind=yes, libc_cv_forced_unwind=no)])
    1.40 ++if test $libc_cv_forced_unwind = no -a $build_cpu != $host_cpu; then
    1.41 ++  libc_cv_forced_unwind=yes
    1.42 ++fi
    1.43 + if test $libc_cv_forced_unwind = yes; then
    1.44 +   AC_DEFINE(HAVE_FORCED_UNWIND)
    1.45 + dnl Check for C cleanup handling.
    1.46 +@@ -41,6 +44,9 @@
    1.47 +   puts ("test")],
    1.48 + libc_cv_c_cleanup=yes, libc_cv_c_cleanup=no)])
    1.49 +   CFLAGS="$old_CFLAGS"
    1.50 ++  if test $libc_cv_c_cleanup = no -a $build_cpu != $host_cpu; then
    1.51 ++    libc_cv_c_cleanup=yes
    1.52 ++  fi
    1.53 +   if test $libc_cv_c_cleanup = no; then
    1.54 +     AC_MSG_ERROR([the compiler must support C cleanup handling])
    1.55 +   fi