NetBSD Problem Report #48587

From duck@shangtai.net  Mon Feb 10 16:44:07 2014
Return-Path: <duck@shangtai.net>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 425D4A646F
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 10 Feb 2014 16:44:07 +0000 (UTC)
Message-Id: <20140210145253.8C3C0A75CC@knightrider.shangtai.net>
Date: Mon, 10 Feb 2014 16:52:53 +0200 (EET)
From: duck@shangtai.net
Reply-To: duck@shangtai.net
To: gnats-bugs@gnats.NetBSD.org
Subject: libffi does not build on IRIX
X-Send-Pr-Version: 3.95

>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
>Last-Modified:  Fri Apr 24 10:20:01 +0000 2020
>Originator:     duck@shangtai.net
>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)

>Audit-Trail:
From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/48587 CVS commit: pkgsrc/devel/libffi
Date: Tue, 11 Feb 2014 07:21:28 +0000

 Module Name:	pkgsrc
 Committed By:	dholland
 Date:		Tue Feb 11 07:21:28 UTC 2014

 Modified Files:
 	pkgsrc/devel/libffi: Makefile distinfo
 	pkgsrc/devel/libffi/patches: patch-aa patch-ae patch-configure.ac

 Log Message:
 Fixes for IRIX from Staffan Thomén in PR 48587.
 This is all of it except for one bit pertaining to libtool, which is
 going to require some additional flailing.


 To generate a diff of this commit:
 cvs rdiff -u -r1.21 -r1.22 pkgsrc/devel/libffi/Makefile
 cvs rdiff -u -r1.30 -r1.31 pkgsrc/devel/libffi/distinfo
 cvs rdiff -u -r1.18 -r1.19 pkgsrc/devel/libffi/patches/patch-aa
 cvs rdiff -u -r1.5 -r1.6 pkgsrc/devel/libffi/patches/patch-ae
 cvs rdiff -u -r1.1 -r1.2 pkgsrc/devel/libffi/patches/patch-configure.ac

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/48587: libffi does not build on IRIX
Date: Tue, 11 Feb 2014 07:28:27 +0000

 On Mon, Feb 10, 2014 at 04:45:00PM +0000, duck@shangtai.net wrote:
  > 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<--


 This part conflicts with an existing patch for Makefile.am; and, since
 it's changing something that's spewed out by automake, it can't be
 fixed in Makefile.am. So I'm not immediately sure what to do about it.

 If libtool doesn't recognize what ends up in CCAS in Irix as an
 assembler, maybe it needs fixing?

 (I've committed the rest.)

 -- 
 David A. Holland
 dholland@netbsd.org

From: Staffan =?iso-8859-1?Q?Thom=E9n?= <duck@shangtai.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/48587: libffi does not build on IRIX
Date: Tue, 11 Feb 2014 15:51:37 +0200

 On Tue, Feb 11, 2014 at 07:30:01AM +0000, David Holland wrote:
 > The following reply was made to PR pkg/48587; it has been noted by GNATS.
 > 
 > From: David Holland <dholland-pbugs@netbsd.org>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: pkg/48587: libffi does not build on IRIX
 > Date: Tue, 11 Feb 2014 07:28:27 +0000
 > 
 >  On Mon, Feb 10, 2014 at 04:45:00PM +0000, duck@shangtai.net wrote:
 >   > 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<--
 >  
 >  
 >  This part conflicts with an existing patch for Makefile.am; and, since
 >  it's changing something that's spewed out by automake, it can't be
 >  fixed in Makefile.am. So I'm not immediately sure what to do about it.
 >  
 >  If libtool doesn't recognize what ends up in CCAS in Irix as an
 >  assembler, maybe it needs fixing?
 >  
 >  (I've committed the rest.)

 First, thanks for still caring about IRIX. :-)

 I must say I'm not terribly familiar with the inner workings of libtool
 and its ilk. Presumably the correct course of action would be to tell it about
 .S (and .s) files... Or should it be handled at the Makefile.in-generation
 stage to add the appropriate tag (any tag will do apparently since an invalid
 tag defaults to "CC" but no tag bombs)? From what I saw, $CCAS is "cc" on IRIX,
 but either "cc" or "as" can be used.

 I seem to get the same response (can't infer, need --tag) when I try to run 
 libtool manually on NetBSD.

  % libtool --mode=compile as test.s
 libtool: compile: unable to infer tagged configuration
 libtool: compile: specify a tag with `--tag'

 How is this handled in other packages that have assembly bits?

 Staffan

 -- 
 Staffan Thomén - ADB3 455F 10D5 86D1 78D6  048D 11BB D66E 7C7E 2EF8

From: Aleksej Saushev <asau@inbox.ru>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/48587: libffi does not build on IRIX
Date: Tue, 11 Feb 2014 18:12:31 +0400

 Staffan Thom=A8=A6n <duck@shangtai.net> writes:

 >  I seem to get the same response (can't infer, need --tag) when I try to =
 run=20
 >  libtool manually on NetBSD.
 >=20=20
 >   % libtool --mode=3Dcompile as test.s
 >  libtool: compile: unable to infer tagged configuration
 >  libtool: compile: specify a tag with `--tag'
 >=20=20
 >  How is this handled in other packages that have assembly bits?

 Patch Makefile.in to use "--tag=3DCC" there.

From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/48587: libffi does not build on IRIX
Date: Tue, 11 Feb 2014 15:14:35 +0100

 On Tue, Feb 11, 2014 at 01:55:00PM +0000, Staffan Thomén wrote:
 >  I seem to get the same response (can't infer, need --tag) when I try to run 
 >  libtool manually on NetBSD.
 >  
 >   % libtool --mode=compile as test.s
 >  libtool: compile: unable to infer tagged configuration
 >  libtool: compile: specify a tag with `--tag'
 >  
 >  How is this handled in other packages that have assembly bits?

 It is strongly recommented to not run as explicitly, but use ${CC}.

 Joerg

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/48587: libffi does not build on IRIX
Date: Wed, 12 Feb 2014 04:54:59 +0000

 On Tue, Feb 11, 2014 at 02:15:01PM +0000, Joerg Sonnenberger wrote:
  > On Tue, Feb 11, 2014 at 01:55:00PM +0000, Staffan Thomén wrote:
  >>  I seem to get the same response (can't infer, need --tag) when I
  >> try to run libtool manually on NetBSD.
  >>  
  >>  
  >>   % libtool --mode=compile as test.s
  >>  libtool: compile: unable to infer tagged configuration
  >>  libtool: compile: specify a tag with `--tag'
  >>  
  >>  How is this handled in other packages that have assembly bits?
  >  
  > It is strongly recommented to not run as explicitly, but use ${CC}.

 Is it the package or automake that's inserting "as" (or whatever)
 instead of ${CC}?

 -- 
 David A. Holland
 dholland@netbsd.org

From: Staffan =?iso-8859-1?Q?Thom=E9n?= <duck@shangtai.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/48587: libffi does not build on IRIX
Date: Sat, 15 Feb 2014 03:51:44 +0200

 On Wed, Feb 12, 2014 at 05:00:01AM +0000, David Holland wrote:
 > The following reply was made to PR pkg/48587; it has been noted by GNATS.
 > 
 > From: David Holland <dholland-pbugs@netbsd.org>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: pkg/48587: libffi does not build on IRIX
 > Date: Wed, 12 Feb 2014 04:54:59 +0000
 > 
 >  On Tue, Feb 11, 2014 at 02:15:01PM +0000, Joerg Sonnenberger wrote:
 >   > On Tue, Feb 11, 2014 at 01:55:00PM +0000, Staffan Thomén wrote:
 >   >>  I seem to get the same response (can't infer, need --tag) when I
 >   >> try to run libtool manually on NetBSD.
 >   >>  
 >   >>  
 >   >>   % libtool --mode=compile as test.s
 >   >>  libtool: compile: unable to infer tagged configuration
 >   >>  libtool: compile: specify a tag with `--tag'
 >   >>  
 >   >>  How is this handled in other packages that have assembly bits?
 >   >  
 >   > It is strongly recommented to not run as explicitly, but use ${CC}.
 >  
 >  Is it the package or automake that's inserting "as" (or whatever)
 >  instead of ${CC}?

 Err, somehow this PR seems to have slid sideways into a detail that never
 happened. I copypasted that line with libtool --mode=compile as from my console
 where I was testing how libtool reacted to .s files with both "cc" and "as".

 From what I could see as it flashed past, the CC variable (well, CCAS) was
 properly "cc" in the build.

 The point was that to .s files, libtool reacts the same on netbsd and irix;
 which is to complain that it doesn't know how to handle them without a tag.

 Presumably there's a correct way to handle this in pkgsrc. My initial approach
 was to patch Makefile.in to include a tag, but this apparently wasn't right.

 So how?

 -- 
 Staffan Thomén - ADB3 455F 10D5 86D1 78D6  048D 11BB D66E 7C7E 2EF8

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/48587: libffi does not build on IRIX
Date: Thu, 16 Oct 2014 06:54:26 +0000

 On Sat, Feb 15, 2014 at 01:55:01AM +0000, Staffan Thom?n wrote:
  >>  Is it the package or automake that's inserting "as" (or whatever)
  >>  instead of ${CC}?
  >  
  > Err, somehow this PR seems to have slid sideways into a detail
  > that never happened. I copypasted that line with libtool
  > --mode=compile as from my console where I was testing how libtool
  > reacted to .s files with both "cc" and "as".
  >  
  > From what I could see as it flashed past, the CC variable (well, CCAS) was
  > properly "cc" in the build.

 Hrm. I thought that if it was running cc, libtool would figure it out;
 but I guess not.

  > Presumably there's a correct way to handle this in pkgsrc. My
  > initial approach was to patch Makefile.in to include a tag, but
  > this apparently wasn't right.

 Well, that's fine in general. It just isn't going to work with
 this package in this case.

 (although... nothing in the package seems to rerun automake after
 patching Makefile.am. so I wonder if that logic's really working.)

 However, maybe something like the existing workaround for OSF/1 would
 serve.

 -- 
 David A. Holland
 dholland@netbsd.org

From: "David Sainty" <dsainty@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/48587 CVS commit: pkgsrc/devel/libffi
Date: Fri, 24 Apr 2020 10:19:32 +0000

 Module Name:	pkgsrc
 Committed By:	dsainty
 Date:		Fri Apr 24 10:19:32 UTC 2020

 Modified Files:
 	pkgsrc/devel/libffi: Makefile distinfo
 	pkgsrc/devel/libffi/patches: patch-configure

 Log Message:
 Revert portions of PR/48587 - applied in 2014 to resolve some issue
 with building on Irix.  The changes applied to 'configure' introduce
 some quite ugly quote nesting that not all shells (E.g. ksh) can
 comprehend.

 After discussion, prefer to roll back what looks like undesirable and
 unnecessary changes, and drop the 'bash' dependency.  My suspicion is
 that the old 'configure' patch is unhelpful even for Irix.

 The reason for the PR/48587 changes are not clear, given that part of
 that patch also selected 'bash' as the shell to use - which should
 have made editing the script unnecessary in the first place.

 Demonstrating the problem bringing all this to attention, this is what
 happens if you are using ksh as the Pkgsrc shell on MacOS X:

 ===> Building for libffi-3.3nb2
 /bin/ksh: : cannot execute [Is a directory]
 <hangs>

 The cause is this ugly looking quote nesting that was introduced by
 patch-configure in PR/48587...

 $ BUILD="` grep "^#### $HOST " Makefile | sed -e 's/.*|//' `"
 ksh: : cannot execute [Is a directory]
 ^C
 % bash
 bash-5.0$ BUILD="` grep "^#### $$HOST " Makefile | sed -e 's/.*|//' `"
 bash-5.0$ exit
 % sh
 sh-3.2$ BUILD="` grep "^#### $$HOST " Makefile | sed -e 's/.*|//' `"
 sh-3.2$ exit

 Removing patch-configure results in this much simpler, portable looking
 script:

 $ BUILD=` grep "^#### $$HOST " Makefile | sed -e 's/.*|//' `

 No PKGREVISION bump, this change is not anticipated to affect the
 package contents, only the success or failure of the build.


 To generate a diff of this commit:
 cvs rdiff -u -r1.41 -r1.42 pkgsrc/devel/libffi/Makefile
 cvs rdiff -u -r1.53 -r1.54 pkgsrc/devel/libffi/distinfo
 cvs rdiff -u -r1.1 -r1.2 pkgsrc/devel/libffi/patches/patch-configure

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: gnats-precook-prs,v 1.4 2018/12/21 14:20:20 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.