Fix build of libgo on powerpc by:

- backporting a fix for the ppc backend from upstream
- telling libgo configure not to try to link to libffi_convenience on ppc

issue brought up and fix tested by ajacoutot@, "go ahead" kettenis@
This commit is contained in:
pascal 2012-02-26 22:32:36 +00:00
parent a9e83bd435
commit fe79b79bb5
2 changed files with 31 additions and 7 deletions

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-gcc_config_rs6000_rs6000_c,v 1.1 2012/02/26 22:32:36 pascal Exp $
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51623
--- gcc/config/rs6000/rs6000.c.orig Tue Feb 21 09:54:58 2012
+++ gcc/config/rs6000/rs6000.c Tue Feb 21 09:55:36 2012
@@ -16613,7 +16613,7 @@ rs6000_assemble_integer (rtx x, unsigned int size, int
if (TARGET_RELOCATABLE
&& in_section != toc_section
&& in_section != text_section
- && !unlikely_text_section_p (in_section)
+ && (in_section && (in_section->common.flags & SECTION_CODE)) == 0
&& !recurse
&& GET_CODE (x) != CONST_INT
&& GET_CODE (x) != CONST_DOUBLE

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-libgo_configure,v 1.3 2012/01/26 13:17:22 pascal Exp $
$OpenBSD: patch-libgo_configure,v 1.4 2012/02/26 22:32:36 pascal Exp $
--- libgo/configure.orig Mon Feb 21 05:17:20 2011
+++ libgo/configure Wed Jan 25 17:49:19 2012
+++ libgo/configure Tue Feb 21 00:17:14 2012
@@ -644,6 +644,8 @@ LIBGO_IS_LINUX_FALSE
LIBGO_IS_LINUX_TRUE
LIBGO_IS_FREEBSD_FALSE
@ -19,7 +19,18 @@ $OpenBSD: patch-libgo_configure,v 1.3 2012/01/26 13:17:22 pascal Exp $
shlibpath_var=LD_LIBRARY_PATH
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
case $host_os in
@@ -13213,6 +13215,7 @@ fi
@@ -13191,6 +13193,10 @@ fi
# architectures don't support it. FIXME: We should set a default
# based on the host.
+case ${host} in
+powerpc*-*-*) with_libffi_default=no ;;
+esac
+
# Check whether --with-libffi was given.
if test "${with_libffi+set}" = set; then :
withval=$with_libffi; :
@@ -13213,6 +13219,7 @@ fi
is_darwin=no
is_freebsd=no
@ -27,7 +38,7 @@ $OpenBSD: patch-libgo_configure,v 1.3 2012/01/26 13:17:22 pascal Exp $
is_linux=no
is_rtems=no
is_solaris=no
@@ -13220,6 +13223,7 @@ GOOS=unknown
@@ -13220,6 +13227,7 @@ GOOS=unknown
case ${host} in
*-*-darwin*) is_darwin=yes; GOOS=darwin ;;
*-*-freebsd*) is_freebsd=yes; GOOS=freebsd ;;
@ -35,7 +46,7 @@ $OpenBSD: patch-libgo_configure,v 1.3 2012/01/26 13:17:22 pascal Exp $
*-*-linux*) is_linux=yes; GOOS=linux ;;
*-*-rtems*) is_rtems=yes; GOOS=rtems ;;
*-*-solaris2*) is_solaris=yes; GOOS=solaris ;;
@@ -13240,6 +13244,14 @@ else
@@ -13240,6 +13248,14 @@ else
LIBGO_IS_FREEBSD_FALSE=
fi
@ -50,7 +61,7 @@ $OpenBSD: patch-libgo_configure,v 1.3 2012/01/26 13:17:22 pascal Exp $
if test $is_linux = yes; then
LIBGO_IS_LINUX_TRUE=
LIBGO_IS_LINUX_FALSE='#'
@@ -13706,13 +13718,13 @@ fi
@@ -13706,13 +13722,13 @@ fi
PTHREAD_LIBS=
@ -67,7 +78,7 @@ $OpenBSD: patch-libgo_configure,v 1.3 2012/01/26 13:17:22 pascal Exp $
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -13743,7 +13755,7 @@ fi
@@ -13743,7 +13759,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then :