pkgsrc-Bugs archive

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

pkg/48587: libffi does not build on IRIX



>Number:         48587
>Category:       pkg
>Synopsis:       libffi does not build on IRIX
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 10 16:45:00 +0000 2014
>Originator:     duck%shangtai.net@localhost
>Release:        pkgsrc-2013Q4
>Organization:
>Environment:
System: IRIX64 halo 6.5 6.5.29m 01090133 IP30
Architecture: mips
Machine: IP30
>Description:
libffi from pkgsrc-2013Q4 fails to build on IRIX with multiple problems
>How-To-Repeat:
Try to build libffi on IRIX with MIPSpro 7.4(.4)
>Fix:
First, use bash and gmake to have a shell that the shellscript bodge they have
in the Makefile to run, and gmake to be able to pass a SHELL variable along
(perhaps this would work with bsd make as well? I didn't test)

Add this to the pkgsrc Makefile:
--8<--
.if !empty(OPSYS:MIRIX)
USE_TOOLS+=     bash gmake
MAKE_FLAGS+=SHELL=${TOOLS_DIR}/bin/bash
.endif
--8<--

Change patches/patch-aa to the following (the change is for allowing the
config.guess string to be "mipseb"):
--8<--
--- configure.orig      Mon Mar 18 00:36:19 2013
+++ configure   Sun Feb  9 20:00:41 2014
@@ -651,6 +651,8 @@
 XTENSA_TRUE
 TILE_FALSE
 TILE_TRUE
+VAX_FALSE
+VAX_TRUE
 PA64_HPUX_FALSE
 PA64_HPUX_TRUE
 PA_HPUX_FALSE
@@ -13331,7 +13333,7 @@
        TARGET=FRV; TARGETDIR=frv
        ;;
 
-  hppa*-*-linux* | parisc*-*-linux* | hppa*-*-openbsd*)
+  hppa*-*-linux* | hppa*-*-netbsd* | parisc*-*-linux* | hppa*-*-openbsd*)
        TARGET=PA_LINUX; TARGETDIR=pa
        ;;
   hppa*64-*-hpux*)
@@ -13425,10 +13427,10 @@
        TARGET=METAG; TARGETDIR=metag
        ;;
 
-  mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
+  mips*-sgi-irix5.* | mips*-sgi-irix6.* | mips*-*-rtems*)
        TARGET=MIPS; TARGETDIR=mips
        ;;
-  mips*-*-linux* | mips*-*-openbsd*)
+  mips*-*-linux* | mips*-*-netbsd* | mips*-*-openbsd*)
        # Support 128-bit long double for NewABI.
        HAVE_LONG_DOUBLE='defined(__mips64)'
        TARGET=MIPS; TARGETDIR=mips
@@ -13449,7 +13451,7 @@
   powerpc-*-aix* | rs6000-*-aix*)
        TARGET=POWERPC_AIX; TARGETDIR=powerpc
        ;;
-  powerpc-*-freebsd* | powerpc-*-openbsd*)
+  powerpc-*-freebsd* | powerpc-*-netbsd* | powerpc-*-openbsd*)
        TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
        ;;
   powerpc64-*-freebsd*)
@@ -13463,7 +13465,7 @@
        TARGET=S390; TARGETDIR=s390
        ;;
 
-  sh-*-* | sh[34]*-*-*)
+  sh-*-* | shle-*-* | sh[34]*-*-*)
        TARGET=SH; TARGETDIR=sh
        ;;
   sh64-*-* | sh5*-*-*)
@@ -13478,6 +13480,10 @@
         TARGET=TILE; TARGETDIR=tile
         ;;
 
+  vax-*-*)
+       TARGET=VAX; TARGETDIR=vax
+       ;;
+
   xtensa*-*)
        TARGET=XTENSA; TARGETDIR=xtensa
        ;;
@@ -13747,6 +13753,14 @@
   TILE_FALSE=
 fi
 
+ if test x$TARGET = xVAX; then
+  VAX_TRUE=
+  VAX_FALSE='#'
+else
+  VAX_TRUE='#'
+  VAX_FALSE=
+fi
+
  if test x$TARGET = xXTENSA; then
   XTENSA_TRUE=
   XTENSA_FALSE='#'
@@ -14661,7 +14675,7 @@
 $as_echo "#define FFI_EXEC_TRAMPOLINE_TABLE 1" >>confdefs.h
 
      ;;
-     *-apple-darwin1* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | 
*-pc-solaris*)
+     *-apple-darwin1* | *-*-freebsd* | *-*-kfreebsd* | *-*-netbsd* | 
*-*-openbsd* | *-pc-solaris*)
 
 $as_echo "#define FFI_MMAP_EXEC_WRIT 1" >>confdefs.h
 
@@ -14840,11 +14854,6 @@
     toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
     toolexeclibdir='$(libdir)'
   fi
-  multi_os_directory=`$CC -print-multi-os-directory`
-  case $multi_os_directory in
-    .) ;; # Avoid trailing /.
-    ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
-  esac
 
 else
   toolexeclibdir='$(libdir)'
@@ -15135,6 +15144,10 @@
   as_fn_error $? "conditional \"TILE\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${VAX_TRUE}" && test -z "${VAX_FALSE}"; then
+  as_fn_error $? "conditional \"VAX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${XTENSA_TRUE}" && test -z "${XTENSA_FALSE}"; then
   as_fn_error $? "conditional \"XTENSA\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -15661,6 +15674,8 @@
   case $ac_option in
   # Handling of the options.
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+       : Avoid regenerating within pkgsrc
+       exit 0
     ac_cs_recheck=: ;;
   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
     $as_echo "$ac_cs_version"; exit ;;
@@ -16734,13 +16749,13 @@
 /-all-all/d
 a\\
        @ HOST="\$(HOST)\" \\\\\\
-       ; test ".\$\$HOST" = "." && HOST=$x sh 
$ax_enable_builddir_auxdir/config.guess $x \\\\\\
-       ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\
-       ; use=$x basename "\$\@" -all $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\
-       ; echo "MAKE \$\$HOST : \$\$n * \$\@"; if test "\$\$n" -eq "0" ; then : 
\\\\\\
-       ; BUILD=$x grep "^####.*|" Makefile |tail -1| sed -e 's/.*|//' $x ; fi 
\\\\\\
+       ; test ".\$\$HOST" = "." && HOST="$x sh 
$ax_enable_builddir_auxdir/config.guess $x" \\\\\\
+       ; BUILD="$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x" 
\\\\\\
+       ; use="$x basename "\$\@" -all $x"; n="$x echo \$\$BUILD | wc -w $x" 
\\\\\\
+       ; echo "MAKE \$\$HOST : \$\$n * \$\@"; if test \$\$n = "0" ; then : 
\\\\\\
+       ; BUILD="$x grep "^####.*|" Makefile |tail -1| sed -e 's/.*|//' $x" ; 
fi \\\\\\
        ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\
-       ; test "\$\$use" = "\$\@" && BUILD=$x echo "\$\$BUILD" | tail -1 $x 
\\\\\\
+       ; test "\$\$use" = "\$\@" && BUILD="$x echo "\$\$BUILD" | tail -1 $x" 
\\\\\\
        ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
        ; (cd "\$\$i" && test ! -f configure && \$(MAKE) \$\$use) || exit; done
 /dist-all *:/a\\
--8<--

As well as the corresponding patch-configure.ac...

--8<--
--- configure.ac.orig   Mon Mar 18 00:36:15 2013
+++ configure.ac        Sun Feb  9 19:48:21 2014
@@ -191,6 +191,10 @@
        TARGET=M68K; TARGETDIR=m68k
        ;;
 
+  m88k-*-*)
+       TARGET=M88K; TARGETDIR=m88k
+       ;;
+
   microblaze*-*-*)
        TARGET=MICROBLAZE; TARGETDIR=microblaze
        ;;
@@ -203,7 +207,7 @@
        TARGET=METAG; TARGETDIR=metag
        ;;
 
-  mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
+  mips*-sgi-irix5.* | mips*-sgi-irix6.* | mips*-*-rtems*)
        TARGET=MIPS; TARGETDIR=mips
        ;;
   mips*-*-linux* | mips*-*-openbsd*)
@@ -256,6 +260,10 @@
         TARGET=TILE; TARGETDIR=tile
         ;;
 
+  vax-*-*)
+       TARGET=VAX; TARGETDIR=vax
+       ;;
+
   xtensa*-*)
        TARGET=XTENSA; TARGETDIR=xtensa
        ;;
@@ -281,6 +289,7 @@
 AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
 AM_CONDITIONAL(M32R, test x$TARGET = xM32R)
 AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
+AM_CONDITIONAL(M88K, test x$TARGET = xM88K)
 AM_CONDITIONAL(MICROBLAZE, test x$TARGET = xMICROBLAZE)
 AM_CONDITIONAL(METAG, test x$TARGET = xMETAG)
 AM_CONDITIONAL(MOXIE, test x$TARGET = xMOXIE)
@@ -301,6 +310,7 @@
 AM_CONDITIONAL(PA_HPUX, test x$TARGET = xPA_HPUX)
 AM_CONDITIONAL(PA64_HPUX, test x$TARGET = xPA64_HPUX)
 AM_CONDITIONAL(TILE, test x$TARGET = xTILE)
+AM_CONDITIONAL(VAX, test x$TARGET = xVAX)
 AM_CONDITIONAL(XTENSA, test x$TARGET = xXTENSA)
 
 AC_HEADER_STDC
--8<--

Change patches/patch-ae to test for defined(__sgi) instead of defined(irix).
The latter is _not_ defined on an IRIX system (though possibly with gcc?).

--8<--
--- src/mips/ffitarget.h.orig   Sat Mar 16 13:19:39 2013
+++ src/mips/ffitarget.h        Mon Feb 10 16:12:23 2014
@@ -32,7 +32,7 @@
 #error "Please do not include ffitarget.h directly into your source.  Use 
ffi.h instead."
 #endif
 
-#ifdef linux
+#if defined(linux)
 # include <asm/sgidefs.h>
 #elif defined(__rtems__)
 /*
@@ -41,8 +41,10 @@
 #define _MIPS_SIM_ABI32                1
 #define _MIPS_SIM_NABI32       2
 #define _MIPS_SIM_ABI64                3
-#elif !defined(__OpenBSD__)
+#elif defined(__sgi)
 # include <sgidefs.h>
+#else
+# include <sys/cdefs.h>
 #endif
 
 #  ifndef _ABIN32
@@ -54,6 +56,12 @@
 #  ifndef _ABIO32
 #    define _ABIO32 _MIPS_SIM_ABI32
 #  endif
+
+#ifdef __NetBSD__
+/* Let's cheat a bit... */   
+#  define _ABIO32 1     
+#  define _MIPS_SIM _ABIO32
+#endif
 
 #if !defined(_MIPS_SIM)
 # error -- something is very wrong --
--8<--

Add a patch file to include a --tag for the assembly files:

--8<--
--- Makefile.in.orig    Sun Feb  9 21:35:26 2014
+++ Makefile.in Sun Feb  9 21:35:39 2014
@@ -240,7 +240,7 @@
 am__mv = mv -f
 CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
        $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
-LTCPPASCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+LTCPPASCOMPILE = $(LIBTOOL) --tag=AS $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
        --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
        $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
--8<--

These fixes seem to not interfere with building libffi on NetBSD (just tested
on my alpha running 5.1_STABLE)



Home | Main Index | Thread Index | Old Index