[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#353346: gcj can't make shared libs on hppa. (followup)



Hello Matthias,

Personaly I don't care of gcj but well glibc and according to jda's mail <http://gcc.gnu.org/ml/gcc-patches/2006-03/msg00815.html> this patch would fix the mentioned pb for all gcc 4.x

This is well comitted upstream, I check with some script like:
svn diff --old http://gcc.gnu.org/svn/gcc/tags/gcc_4_0_3_release \
        --new http://gcc.gnu.org/svn/gcc/branches/gcc-4_0-branch \
       >  Gcc-4.0-br.diff-$(date +'%Y%m%d')

but I didn't find yet integrated neither in gcc-4.1 nor gcc-4.0 debian pkg?

I so tested the attached patch with gcc-4.0 (afaik the default build tool for glibc6) and it makes well its job ;-)

Thanks in advance,
   Joel

#! /bin/sh -e

# DP: * /From/: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
# DP: The enclosed change fixes debian bug #353346.
# DP: See following msg for fully detailed info:
# DP: <http://gcc.gnu.org/ml/gcc-patches/2006-03/msg00815.html>

# remove the next line

dir=
if [ $# -eq 3 -a "$2" = '-d' ]; then
    pdir="-d $3"
    dir="$3/"
elif [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch)
        patch $pdir -f --no-backup-if-mismatch -p0 < $0
        #cd ${dir}gcc && autoconf
        ;;
    -unpatch)
        patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
        #rm ${dir}gcc/configure
        ;;
    *)
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
        exit 1
esac
exit 0

# append the patch here and adjust the -p? flag in the patch calls.
--- gcc/config/pa/pa32-linux.h	(.../tags/gcc_4_0_3_release)	(revision 113035)
+++ gcc/config/pa/pa32-linux.h	(.../branches/gcc-4_0-branch)	(revision 113035)
@@ -1,5 +1,5 @@
 /* Definitions for PA_RISC with ELF-32 format
-   Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2002, 2004, 2006 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -36,4 +36,26 @@
 		    aligned(sizeof(func_ptr))))				\
     = { (func_ptr) (-1) }
 
+/* This is a PIC version of CRT_CALL_STATIC_FUNCTION.  The PIC
+   register has to be saved before the call and restored after
+   the call.  We assume that register %r4 is available for this
+   purpose.  The hack prevents GCC from deleting the restore.  */
+#ifdef CRTSTUFFS_O
+#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC)	\
+static void __attribute__((__used__))			\
+call_ ## FUNC (void)					\
+{							\
+  asm (SECTION_OP);					\
+  asm volatile ("bl " #FUNC ",%%r2\n\t"			\
+		"copy %%r19,%%r4\n\t"			\
+		"copy %%r4,%%r19\n"			\
+		:					\
+		:					\
+		: "r1", "r2", "r4", "r20", "r21",	\
+		  "r22", "r23", "r24", "r25", "r26",	\
+		  "r27", "r28", "r29", "r31");		\
+  asm (TEXT_SECTION_ASM_OP);				\
+}
+#endif
+
 #define MD_UNWIND_SUPPORT "config/pa/linux-unwind.h"

Reply to: