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

Bug#190066: gcc-3.3: missing support for x86-64



Package: gcc-3.3
Version: 1:3.3ds5-0pre5
Tags: patch

In order to start a Debian x86-64 port, we need a compiler that
can create 64 bit binaries. The attached patch makes the i386
gcc-3.3 package bi-arch capable, similar to the respective sparc
and s390 packages. It also adds x86_64 libraries for the languages
that are not yet supported on sparc and s390. They should
eventually be enabled on those as well.

The biarch compiler has build-dependencies on both 32 and 64 bit
libc6 packages. I will open a bug against glibc once I have
rebuilt it with this compiler. For the bootstrap, either
gcc or glibc will have to be available to build the other, I have
binaries for this on http://www.arndb.de/debian/.

The majority of changes to the upstream sources is needed
to enable biarch support with 32 bit native format as opposed
to the 64 bit native format that the other x86_64-linux systems
use.

See also Bug#189350 for the required binutils patch.
# ignore 64 bit shlibdeps for now, as on s390 and sparc64
diff -u gcc-3.3-3.3ds5/debian/rules.d/binary-libgcc.mk gcc-3.3-3.3ds5/debian/rules.d/binary-libgcc.mk
--- gcc-3.3-3.3ds5/debian/rules.d/binary-libgcc.mk
+++ gcc-3.3-3.3ds5/debian/rules.d/binary-libgcc.mk
@@ -54,9 +54,13 @@
 endif
 ifneq (,$(findstring $(DEB_HOST_ARCH), s390 sparc))
 	dh_shlibdeps -p$(p_lgcc) -Xlib64
+else 
+ifeq ($(DEB_HOST_ARCH),i386)
+	dh_shlibdeps -p$(p_lgcc) -Xlib64
 else
 	dh_shlibdeps -p$(p_lgcc)
 endif
+endif
 	dh_gencontrol -p$(p_lgcc) -u-v$(DEB_VERSION)
 	b=libgcc; v=$(GCC_SONAME); \
 	for ext in preinst postinst prerm postrm; do \
# add 64 bit libraries for all languages. These are not included
# on s390 and sparc yet, but that could probably be changed as well
diff -u gcc-3.3-3.3ds5/debian/rules.d/binary-libffi.mk gcc-3.3-3.3ds5/debian/rules.d/binary-libffi.mk
--- gcc-3.3-3.3ds5/debian/rules.d/binary-libffi.mk
+++ gcc-3.3-3.3ds5/debian/rules.d/binary-libffi.mk
@@ -19,6 +19,15 @@
 	$(addprefix $(PF)/include/, ffi.h ffi_mips.h fficonfig.h) \
 	$(PF)/lib/libffi.{a,so,la}
 
+ifeq ($(biarch),yes)
+ifeq ($(DEB_TARGET_ARCH),i386)
+	dirs_ffi   += $(PF)/$(lib64)
+	files_ffi  += $(PF)/$(lib64)/libffi.so.*
+	dirs_ffid  += $(PF)/$(lib64)
+	files_ffid += $(PF)/$(lib64)/libffi.{a,so,la}
+endif
+endif
+
 $(binary_stamp)-libffi: $(install_stamp)
 	dh_testdir
 	dh_testroot
diff -u gcc-3.3-3.3ds5/debian/rules.d/binary-libobjc.mk gcc-3.3-3.3ds5/debian/rules.d/binary-libobjc.mk
--- gcc-3.3-3.3ds5/debian/rules.d/binary-libobjc.mk
+++ gcc-3.3-3.3ds5/debian/rules.d/binary-libobjc.mk
@@ -15,6 +15,15 @@
 	$(PF)/lib/libobjc_gc.so.*
 endif
 
+ifeq ($(biarch),yes)
+	dirs_lobjc   +=	$(PF)/$(lib64)
+	files_lobjc  +=	$(PF)/$(lib64)/libobjc.so.*
+ifeq ($(with_objc_gc),yes)
+	files_lobjc  +=	$(PF)/$(lib64)/libobjc_gc.so.*
+endif
+endif
+
+
 $(binary_stamp)-libobjc: $(install_stamp)
 	dh_testdir
 	dh_testroot
diff -u gcc-3.3-3.3ds5/debian/rules.d/binary-fortran.mk gcc-3.3-3.3ds5/debian/rules.d/binary-fortran.mk
--- gcc-3.3-3.3ds5/debian/rules.d/binary-fortran.mk
+++ gcc-3.3-3.3ds5/debian/rules.d/binary-fortran.mk
@@ -32,6 +32,16 @@
 files_g2c = \
 	$(PF)/lib/libg2c.so.* \
 
+ifeq ($(biarch),yes)
+ifeq ($(DEB_TARGET_ARCH),i386)
+	dirs_g2c   += $(PF)/$(lib64)
+	files_g2c  += $(PF)/$(lib64)/libg2c.so.*
+
+	dirs_g77  += $(gcc_lib_dir)/64
+	files_g77  += $(gcc_lib_dir)/64/{libg2c.*,libfrtbegin.a}
+endif
+endif
+
 # ----------------------------------------------------------------------
 $(binary_stamp)-libfortran: $(install_stamp)
 	dh_testdir
@@ -67,6 +77,14 @@
 		$(d)/$(gcc_lib_dir)/libg2c.so
 	mv $(d)/$(PF)/lib/libfrtbegin.a $(d)/$(gcc_lib_dir)/
 
+ifeq ($(biarch),yes)
+ifeq ($(DEB_TARGET_ARCH),i386)
+	mv $(d)/$(PF)/$(lib64)/libg2c.{a,la,so} $(d)/$(gcc_lib_dir)/64
+	ln -sf ../../../../lib64/libg2c.so.$(F77_SONAME) \
+		$(d)/$(gcc_lib_dir)/64/libg2c.so
+	mv $(d)/$(PF)/$(lib64)/libfrtbegin.a $(d)/$(gcc_lib_dir)/64
+endif
+endif
 	rm -rf $(d_g77)
 	dh_installdirs -p$(p_g77) $(dirs_g77)
 	dh_movefiles -p$(p_g77) $(files_g77)
diff -u gcc-3.3-3.3ds5/debian/rules.d/binary-java.mk gcc-3.3-3.3ds5/debian/rules.d/binary-java.mk
--- gcc-3.3-3.3ds5/debian/rules.d/binary-java.mk
+++ gcc-3.3-3.3ds5/debian/rules.d/binary-java.mk
@@ -74,6 +74,20 @@
 	$(PF)/lib/lib-org-*.{a,la} \
 	$(PF)/lib/lib-org-*.so
 
+ifeq ($(biarch),yes)
+ifeq ($(DEB_TARGET_ARCH),i386)
+	dirs_jlib    +=	$(PF)/$(lib64)
+	files_jlib   +=	$(PF)/$(lib64)/libgcj*.so.* \
+			$(PF)/$(lib64)/lib-gnu-*.so.* \
+			$(PF)/$(lib64)/lib-org-*.so.*
+
+	dirs_jdev    += $(PF)/$(lib64)
+	files_jdev   += $(PF)/$(lib64)/libgcj*.{a,so,la} \
+			$(PF)/$(lib64)/lib-gnu-*.{a,so,la} \
+			$(PF)/$(lib64)/lib-org-*.{a,so,la}
+endif
+endif
+
 # ----------------------------------------------------------------------
 $(binary_stamp)-libgcj-common: $(install_stamp)
 	dh_testdir
diff -u gcc-3.3-3.3ds5/debian/rules.d/binary-libstdcxx.mk gcc-3.3-3.3ds5/debian/rules.d/binary-libstdcxx.mk
--- gcc-3.3-3.3ds5/debian/rules.d/binary-libstdcxx.mk
+++ gcc-3.3-3.3ds5/debian/rules.d/binary-libstdcxx.mk
@@ -60,6 +60,7 @@
     files_dev += $(gcc_lib_dir)/64/libstdc++.{a,so} \
         $(gcc_lib_dir)/64/libsupc++.a
     dirs_dbg += $(PF)/$(lib64)/debug
+    files_dbg += $(PF)/$(lib64)/debug/libstdc++.*
     dirs_pic += $(gcc_lib_dir)
     files_pic += $(gcc_lib_dir)/64/libstdc++_pic.a
 endif
@@ -164,8 +165,12 @@
 	cat debian/$(p_lib)/DEBIAN/shlibs >> debian/shlibs.local
 ifneq (,$(findstring $(DEB_HOST_ARCH), s390 sparc))
 	dh_shlibdeps -p$(p_lib) -Xlib64
+else 
+ifeq ($(DEB_HOST_ARCH),i386)
+	dh_shlibdeps -p$(p_lib) -Xlib64
 else
	dh_shlibdeps -p$(p_lib)
+endif
 endif
 	dh_gencontrol -p$(p_lib) -u-v$(DEB_VERSION)
 
@@ -205,6 +210,7 @@
 	mv $(d)/$(PF)/lib/libstdc++_pic.a $(d)/$(gcc_lib_dir)/
 
 	rm -f $(d)/$(PF)/lib/debug/libstdc++_pic.a
+	rm -f $(d)/$(PF)/lib64/debug/libstdc++_pic.a
 	#mv $(d)/$(PF)/lib/debug/libstdc++.{a,la,so} $(d)/$(gcc_lib_dir)/
 
 ifeq ($(biarch),yes)
@@ -254,8 +260,12 @@
 	dh_fixperms -p$(p_dev) -p$(p_pic) -p$(p_dbg)
 ifeq ($(DEB_HOST_ARCH),s390)
 	dh_shlibdeps -p$(p_dev) -p$(p_pic) -p$(p_dbg) -Xlib64
+else 
+ifeq ($(DEB_HOST_ARCH),i386)
+	dh_shlibdeps -p$(p_dev) -p$(p_pic) -p$(p_dbg) -Xlib64
 else
	dh_shlibdeps -p$(p_dev) -p$(p_pic) -p$(p_dbg)
+endif
 endif
 	dh_gencontrol -p$(p_dev) -p$(p_pic) -p$(p_dbg) \
 		-u-v$(DEB_VERSION)
diff -u gcc-3.3-3.3ds5/debian/README.Debian gcc-3.3-3.3ds5/debian/README.Debian
--- gcc-3.3-3.3ds5/debian/README.Debian
+++ gcc-3.3-3.3ds5/debian/README.Debian
@@ -94,6 +91,9 @@
 gpc-version:
   Update date in gpc version number
 
+i386-biarch:
+  biarch patches for i386/x86_64
+
 reporting:
   <compiler> --help gives hint to /usr/share/doc/debian/bug-reporting.txt
 
diff -u gcc-3.3-3.3ds5/debian/rules.patch gcc-3.3-3.3ds5/debian/rules.patch
--- gcc-3.3-3.3ds5/debian/rules.patch
+++ gcc-3.3-3.3ds5/debian/rules.patch
@@ -71,6 +71,9 @@
   debian_patches += m68k-loop
   debian_patches += #m68k-const m68k-subreg
 endif
+ifeq ($(DEB_HOST_ARCH),i386)
+  debian_patches += i386-biarch
+endif
 ifeq ($(DEB_TARGET_ARCH),s390)
   debian_patches += s390-biarch s390-config-ml
 endif
--- gcc-3.3-3.3ds5/debian/changelog
+++ gcc-3.3-3.3ds5/debian/changelog
@@ -1,3 +1,9 @@
+gcc-3.3 (1:3.3ds5-0pre5.biarch1) unstable; urgency=low
+
+  * add support for biarch i386/x86-64 environments
+
+ -- Arnd Bergmann <arnd@b551138y.boeblingen.de.ibm.com>  Sun, 20 Apr 2003 13:19:09 +0200
+
 gcc-3.3 (1:3.3ds5-0pre5) unstable; urgency=low
 
   * gcc-3.3 prerelease taken from the gcc-3_3-branch (CVS 20030415).
diff -u gcc-3.3-3.3ds5/debian/rules.defs gcc-3.3-3.3ds5/debian/rules.defs
--- gcc-3.3-3.3ds5/debian/rules.defs
+++ gcc-3.3-3.3ds5/debian/rules.defs
@@ -398,6 +398,12 @@
 with_libnof := no
 
 biarch := no
+
+# i386/x86_64 build
+ifeq ($(DEB_HOST_ARCH),i386)
+  biarch := yes
+endif
+
 # sparc64 build --------------------
 ifeq ($(DEB_TARGET_ARCH),sparc)
   with_sparc64 := yes
# there is no xlib for x86_64 yet, this disables building with
# xlib everywhere
diff -u gcc-3.3-3.3ds5/debian/rules2 gcc-3.3-3.3ds5/debian/rules2
--- gcc-3.3-3.3ds5/debian/rules2
+++ gcc-3.3-3.3ds5/debian/rules2
@@ -94,7 +94,7 @@
 endif
 
 ifeq ($(with_java),yes)
-  CONFARGS += --enable-java-gc=boehm --enable-java-awt=xlib
+  CONFARGS += --enable-java-gc=boehm # --enable-java-awt=xlib
 endif
 with_nls := yes
 
--- gcc-3.3-3.3ds5.orig/debian/patches/i386-biarch.dpatch
+++ gcc-3.3-3.3ds5/debian/patches/i386-biarch.dpatch
@@ -0,0 +1,364 @@
+#! /bin/sh -e
+ 
+# DP: biarch patches for i386/x86_64
+ 
+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 -p1 < $0
+        #cd ${dir}gcc && autoconf
+        ;;
+    -unpatch)
+        patch $pdir -f --no-backup-if-mismatch -R -p1 < $0
+        #rm ${dir}gcc/configure
+        ;;
+    *)
+        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+        exit 1
+esac
+exit 0
+
+
+diff -urN src/gcc/config/i386/biarch.h src-bak/gcc/config/i386/biarch.h
+--- src/gcc/config/i386/biarch.h	1970-01-01 01:00:00.000000000 +0100
++++ src-bak/gcc/config/i386/biarch.h	2003-04-19 18:02:40.000000000 +0200
+@@ -0,0 +1,25 @@
++/* Make configure files to produce biarch compiler defaulting to 64bit mode.
++   This file must be included very first, while the OS specific file later
++   to overwrite otherwise wrong defaults. 
++   Copyright (C) 2001 Free Software Foundation, Inc.
++   Contributed by Bo Thorsen <bo@suse.de>.
++
++This file is part of GNU CC.
++
++GNU CC is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 2, or (at your option)
++any later version.
++
++GNU CC is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with GNU CC; see the file COPYING.  If not, write to
++the Free Software Foundation, 59 Temple Place - Suite 330,
++Boston, MA 02111-1307, USA.  */
++
++#define TARGET_64BIT_DEFAULT 0
++#define TARGET_BI_ARCH 1
+diff -urN src/gcc/config/i386/linux64.h src-bak/gcc/config/i386/linux64.h
+--- src/gcc/config/i386/linux64.h	2003-03-14 08:33:46.000000000 +0100
++++ src-bak/gcc/config/i386/linux64.h	2003-04-19 18:17:05.000000000 +0200
+@@ -21,8 +21,11 @@
+ 
+ #define LINUX_DEFAULT_ELF
+ 
++#ifndef TARGET_VERSION
+ #define TARGET_VERSION fprintf (stderr, " (x86-64 Linux/ELF)");
++#endif
+ 
++#undef TARGET_OS_CPP_BUILTINS
+ #define TARGET_OS_CPP_BUILTINS()				\
+   do								\
+     {								\
+@@ -62,6 +62,7 @@
+    done.  */
+ 
+ #undef	LINK_SPEC
++#if TARGET_64BIT_DEFAULT
+ #define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
+   %{shared:-shared} \
+   %{!shared: \
+@@ -70,6 +71,16 @@
+       %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+       %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \
+     %{static:-static}}"
++#else
++#define LINK_SPEC "%{m64:-m elf_x86_64} %{!m64:-m elf_i386} \
++  %{shared:-shared} \
++  %{!shared: \
++    %{!static: \
++      %{rdynamic:-export-dynamic} \
++      %{!m64:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
++      %{m64:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \
++    %{static:-static}}"
++#endif
+ 
+ #undef  STARTFILE_SPEC
+ #define STARTFILE_SPEC \
+@@ -82,7 +93,11 @@
+ #undef  ENDFILE_SPEC
+ #define ENDFILE_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
+ 
++#if TARGET_64BIT_DEFAULT
+ #define MULTILIB_DEFAULTS { "m64" }
++#else
++#define MULTILIB_DEFAULTS { "m32" }
++#endif
+ 
+ /* Do code reading to identify a signal frame, and set the frame
+    state data appropriately.  See unwind-dw2.c for the structs.  
+diff -urN src/gcc/config/i386/x86-64.h src-bak/gcc/config/i386/x86-64.h
+--- src/gcc/config/i386/x86-64.h	2002-11-16 23:35:27.000000000 +0100
++++ src-bak/gcc/config/i386/x86-64.h	2003-04-19 18:02:40.000000000 +0200
+@@ -49,7 +49,7 @@
+ 
+ #undef ASM_SPEC
+ #define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} \
+- %{Wa,*:%*} %{m32:--32}"
++ %{Wa,*:%*} %{m32:--32} %{m64:--64}"
+ 
+ /* A C statement (sans semicolon) to output to the stdio stream
+    FILE the assembler definition of uninitialized global DECL named
+diff -urN src/gcc/config.gcc src-bak/gcc/config.gcc
+--- src/gcc/config.gcc	2003-03-02 08:39:03.000000000 +0100
++++ src-bak/gcc/config.gcc	2003-04-19 18:10:34.000000000 +0200
+@@ -1134,8 +1134,9 @@
+ i[34567]86-*-linux*)	# Intel 80386's running GNU/Linux
+ 			# with ELF format using glibc 2
+ 			# aka GNU/Linux C library 6
+-	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h"
+-	tmake_file="t-slibgcc-elf-ver t-linux i386/t-crtstuff"
++	tm_file="i386/biarch.h ${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h \
++		 svr4.h linux.h i386/linux.h i386/x86-64.h i386/linux64.h"
++	tmake_file="t-slibgcc-elf-ver t-linux i386/t-linux64"
+ 	;;
+ x86_64-*-linux*)
+ 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h \
+--- src/gcc/config/i386/linux.h	2002-11-16 23:35:27.000000000 +0100
++++ src-64/gcc/config/i386/linux.h	2003-04-20 17:37:26.000000000 +0200
+@@ -200,6 +200,7 @@
+       }									\
+   } while (0)
+ 
++#ifdef THIS_IS_SUPPORTED_ON_X86_64_AS_WELL
+ /* Used by crtstuff.c to initialize the base of data-relative relocations.
+    These are GOT relative on x86, so return the pic register.  */
+ #ifdef __PIC__
+@@ -219,6 +220,7 @@
+ 	   "addl\t$_GLOBAL_OFFSET_TABLE_+[.-.LPR%=],%0"			\
+ 	   : "=d"(BASE))
+ #endif
++#endif
+ 
+ /* Do code reading to identify a signal frame, and set the frame
+    state data appropriately.  See unwind-dw2.c for the structs.  */
+--- src/libffi/Makefile.am	2003-04-20 17:40:09.000000000 +0200
++++ src/libffi/Makefile.am.64	2003-04-20 19:06:04.000000000 +0200
+@@ -88,7 +88,7 @@
+ TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S
+ TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S
+ TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s
+-TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S
++TARGET_SRC_X86 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
+ TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S
+ TARGET_SRC_SPARC = src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S
+ TARGET_SRC_ALPHA = src/alpha/ffi.c src/alpha/osf.S
+--- src/libffi/Makefile.in	2003-04-20 17:40:09.000000000 +0200
++++ src/libffi/Makefile.in.64	2003-04-20 19:06:45.000000000 +0200
+@@ -167,7 +167,7 @@
+ TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S
+ TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S
+ TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s
+-TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S
++TARGET_SRC_X86 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
+ TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S
+ TARGET_SRC_SPARC = src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S
+ TARGET_SRC_ALPHA = src/alpha/ffi.c src/alpha/osf.S
+@@ -253,7 +253,7 @@
+ @M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo
+ @X86_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
+ @X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+-@X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo
++@X86_TRUE@src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffi.lo src/x86/sysv.lo
+ @POWERPC_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
+ @POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
+ @POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \
+@@ -296,8 +296,8 @@
+ @IA64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+ @IA64_TRUE@src/ia64/ffi.lo src/ia64/unix.lo
+ @X86_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo src/types.lo \
+-@X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \
+-@X86_TRUE@src/x86/sysv.lo
++@X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi64.lo src/x86/unix64.lo \
++@X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo
+ @POWERPC_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
+ @POWERPC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+ @POWERPC_TRUE@src/powerpc/ffi.lo src/powerpc/sysv.lo \
+--- src/libjava/include/i386-signal.h.orig	2003-04-20 22:33:21.000000000 +0200
++++ src/libjava/include/i386-signal.h	2003-04-20 22:42:55.000000000 +0200
+@@ -11,6 +11,10 @@
+ 
+ 
+ #ifndef JAVA_SIGNAL_H
++#ifdef __x86_64__
++#include "x86_64-signal.h"
++#else
++
+ #define JAVA_SIGNAL_H 1
+ 
+ #include <signal.h>
+@@ -151,6 +155,6 @@
+ 
+  * Finally, the code that glibc uses to return from a signal handler
+  * is subject to change.  */
+-
++#endif /* ! __x86_64__ */
+ #endif /* JAVA_SIGNAL_H */
+   
+--- src/libjava/sysdep/i386/locks.h.orig	2002-05-02 00:47:07.000000000 +0200
++++ src/libjava/sysdep/i386/locks.h	2002-10-01 23:36:10.000000000 +0200
+@@ -24,10 +24,17 @@
+ 					      obj_addr_t new_val) 
+ {
+   char result;
+-  __asm__ __volatile__("lock; cmpxchgl %2, %0; setz %1"
++#ifdef __x86_64__
++  __asm__ __volatile__("lock; cmpxchgq %2, %0; setz %1"
+ 	      : "+m"(*(addr)), "=q"(result)
+ 	      : "r" (new_val), "a"(old)
+ 	      : "memory");
++#else
++  __asm__ __volatile__("lock; cmpxchgl %2, %0; setz %1"
++		       : "+m"(*(addr)), "=q"(result)
++		       : "r" (new_val), "a"(old)
++		       : "memory");
++#endif
+   return (bool) result;
+ }
+ 
+--- src/libtool.m4.orig	2003-04-21 00:39:17.000000000 +0200
++++ src/libtool.m4	2003-04-21 00:39:50.000000000 +0200
+@@ -189,14 +189,14 @@
+   rm -rf conftest*
+   ;;
+ 
+-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
++i[[3456]]86-*-linux*|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+   # Find out which ABI we are using.
+   echo 'int i;' > conftest.$ac_ext
+   if AC_TRY_EVAL(ac_compile); then
+     case "`/usr/bin/file conftest.o`" in
+     *32-bit*)
+       case $host in
+-        x86_64-*linux*)
++        i[[3456]]86-*-linux*|x86_64-*linux*)
+           LD="${LD-ld} -m elf_i386"
+           ;;
+         ppc64-*linux*)
+@@ -212,7 +212,7 @@
+       ;;
+     *64-bit*)
+       case $host in
+-        x86_64-*linux*)
++        i[[3456]]86-*-linux*|x86_64-*linux*)
+           LD="${LD-ld} -m elf_x86_64"
+           ;;
+         ppc*-*linux*|powerpc*-*linux*)
+--- src/libjava/configure.in.orig	2003-04-20 20:59:00.000000000 +0200
++++ src/libjava/configure.in	2003-04-20 20:59:57.000000000 +0200
+@@ -530,16 +530,17 @@
+ 
+    AC_CHECK_LIB(dl, dladdr, [
+      AC_DEFINE(HAVE_DLADDR)])
+-   if test x"$build" = x"$host"; then
+-     AC_CHECK_FILES(/proc/self/exe, [
+-       AC_DEFINE(HAVE_PROC_SELF_EXE)])
+-   else
+-     case $host in
+-     *-linux*)
+-       AC_DEFINE(HAVE_PROC_SELF_EXE)
+-       ;;
+-     esac
+-   fi
++   case $host in
++   *-linux*)
++     AC_DEFINE(HAVE_PROC_SELF_EXE)
++     ;;
++   *)
++     if test x"$build" = x"$host"; then
++       AC_CHECK_FILES(/proc/self/exe, [
++         AC_DEFINE(HAVE_PROC_SELF_EXE)])
++     fi
++     ;;
++   esac
+ 
+    AM_ICONV
+    AM_LC_MESSAGES
+--- src/libjava/configure.orig	2003-04-20 21:01:30.000000000 +0200
++++ src/libjava/configure	2003-04-20 21:01:33.000000000 +0200
+@@ -2475,14 +2475,14 @@
+   rm -rf conftest*
+   ;;
+ 
+-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
++i[3456]86-*-linux*|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+   # Find out which ABI we are using.
+   echo 'int i;' > conftest.$ac_ext
+   if { (eval echo configure:2482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+     case "`/usr/bin/file conftest.o`" in
+     *32-bit*)
+       case $host in
+-        x86_64-*linux*)
++        i[3456]86-*-linux*|x86_64-*linux*)
+           LD="${LD-ld} -m elf_i386"
+           ;;
+         ppc64-*linux*)
+@@ -2498,7 +2498,7 @@
+       ;;
+     *64-bit*)
+       case $host in
+-        x86_64-*linux*)
++        i[3456]86-*-linux*|x86_64-*linux*)
+           LD="${LD-ld} -m elf_x86_64"
+           ;;
+         ppc*-*linux*|powerpc*-*linux*)
+@@ -4014,8 +4014,16 @@
+   echo "$ac_t""no" 1>&6
+ fi
+ 
+-   if test x"$build" = x"$host"; then
+-     for ac_file in /proc/self/exe
++   case $host in
++   *-linux*)
++     cat >> confdefs.h <<\EOF
++#define HAVE_PROC_SELF_EXE 1
++EOF
++
++     ;;
++   *)
++     if test x"$build" = x"$host"; then
++       for ac_file in /proc/self/exe
+ do
+ 
+ ac_safe=`echo "$ac_file" | sed 'y%./+-%__p_%'`
+@@ -4051,16 +4059,9 @@
+ fi
+ done
+ 
+-   else
+-     case $host in
+-     *-linux*)
+-       cat >> confdefs.h <<\EOF
+-#define HAVE_PROC_SELF_EXE 1
+-EOF
+-
+-       ;;
+-     esac
+-   fi
++     fi
++     ;;
++   esac
+ 
+    
+     
+

Reply to: