Package: root-system
Version: 5.34.19+dfsg-1.1
Severity: normal
Tags: patch
User: debian-powe...@lists.debian.org
Usertags: ppc64el powerpc

Dear Maintainer,
on the latest buildd report 
https://buildd.debian.org/status/package.php?p=root-system
the build fails on powerpc and ppc64el.
Here is a patch that should fix those.
On powerpc, I fixed this in debian/rules by change the PLATFORM, else it was
using the config/Makefile.linux which is using i386 specific gcc flags such as
-msse leading to failure of compiling krb5 test binary during configure.
With that the package is being build and in 32bits.
On ppc64el, the configure was handling differently linuxppc64 whereas the way
of doing for linuxx8664 is ok : this help configure to find the libs it needs.
During compilation it then failed because g77 was used and not gfortran. Si
I reused the way it was done on x8664 so that if g77 is not there gfortran is
used thus adding a bit at the end of config/Makefile.linuxppc64gcc
Maybe -m64 could be avoided as it was in the initial Makefile.linuxppc64gcc but
for the sake of coherence with x8664 config file, I used the same way of doing.
Hope that helps,

F.
--- a/debian/patches/series	2014-10-24 13:44:02.000000000 +0200
+++ b/debian/patches/series	2014-11-03 17:04:13.135999996 +0100
@@ -32,3 +32,4 @@
 76-hurd-i386.patch
 77-ruby-header-path.patch
 78-html-header-logo.patch
+support-for-ppc64
--- a/debian/patches/support-for-ppc64	1970-01-01 01:00:00.000000000 +0100
+++ b/debian/patches/support-for-ppc64	2014-11-04 11:02:54.536006646 +0100
@@ -0,0 +1,59 @@
+--- root-system-5.34.19+dfsg.orig/config/Makefile.linuxppc64gcc
++++ root-system-5.34.19+dfsg/config/Makefile.linuxppc64gcc
+@@ -42,13 +42,33 @@ XLIBS         = $(XPMLIBDIR) $(XPMLIB) $
+ CILIBS        = -lm -ldl
+ CRYPTLIBS     = -lcrypt
+ 
++
+ # Fortran:
++ifneq ($(findstring gfortran, $(F77)),)
++ifeq ($(F77),)
++# only needed to get default compiler in ./configure
++F77           = gfortran
++endif
++F77FLAGS      = -fPIC -m64 -std=legacy
++ifneq ($(shell $(F77) -m64 -print-file-name=libgfortran.$(SOEXT)),libgfortran.$(SOEXT))
++F77LIBS      := $(shell $(F77) -m64 -print-file-name=libgfortran.$(SOEXT))
++else
++F77LIBS      := $(shell $(F77) -m64 -print-file-name=libgfortran.a)
++endif
++F77LIBS      += $(shell $(F77) -m64 -print-file-name=libgfortranbegin.a)
++endif
++
++ifneq ($(findstring g77, $(F77)),)
++ifeq ($(F77),)
++# only needed to get default compiler in ./configure
+ F77           = g77
+-F77FLAGS      = -fPIC
++endif
++F77FLAGS      = -fPIC -m64
+ ifneq ($(shell $(F77) -print-file-name=libg2c.so),libg2c.so)
+-F77LIBS      := $(shell $(F77) -print-file-name=libg2c.so) -lnsl
++F77LIBS      := $(shell $(F77) -m64 -print-file-name=libg2c.so) -lnsl
+ else
+-F77LIBS      := $(shell $(F77) -print-file-name=libg2c.a)  -lnsl
++F77LIBS      := $(shell $(F77) -m64 -print-file-name=libg2c.a) -lnsl
++endif
+ endif
+ 
+ # Extras
+--- root-system-5.34.19+dfsg.orig/configure
++++ root-system-5.34.19+dfsg/configure
+@@ -1886,7 +1886,7 @@ case $arch in
+ sgicc)
+    logmsg "Will check 32bit libraries"
+    checklib32="yes" ;;
+-linuxppc64*|sgicc64)
++sgicc64)
+    logmsg "Will ONLY check 64bit libraries"
+    checkonlylib64="yes" ;;
+ linuxx8664k1om*)
+@@ -1898,7 +1898,7 @@ linuxx8664k1om*)
+    enable_genvector="no"
+    enable_tmva="no"
+    ;;
+-linuxx8664*)
++linuxx8664*|linuxppc64*)
+    logmsg "Will check 64bit libraries"
+    checklinux64="yes"
+    checklib64="yes" ;;
--- a/debian/rules	2014-10-24 13:44:02.000000000 +0200
+++ b/debian/rules	2014-11-03 17:13:30.408069453 +0100
@@ -24,7 +24,7 @@ EXTRA_LDFLAGS  := $(LDFLAGS)
 export CFLAGS EXTRA_LDFLAGS DEB_HOST_MULTIARCH
 
 ifeq ($(DEB_HOST_ARCH_CPU),powerpc)
-PLATFORM	= linux
+PLATFORM	= linuxppcgcc
 else
 PLATFORM	=
 endif

Reply via email to