NetBSD Problem Report #38639

From martin@duskware.de  Mon May 12 16:06:06 2008
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id AB34963B8BC
	for <gnats-bugs@gnats.netbsd.org>; Mon, 12 May 2008 16:06:06 +0000 (UTC)
Message-Id: <20080512153412.2FA0F63B8BC@narn.NetBSD.org>
Date: Mon, 12 May 2008 15:34:12 +0000 (UTC)
From: srcshelton@gmail.com
Reply-To: srcshelton@gmail.com
To: netbsd-bugs-owner@NetBSD.org
Subject: Patches to allow glib2 to build on IRIX
X-Send-Pr-Version: www-1.0

>Number:         38639
>Category:       pkg
>Synopsis:       Patches to allow glib2 to build on IRIX
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    irix-pkg-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 12 16:10:00 +0000 2008
>Closed-Date:    Wed Dec 31 19:30:55 +0000 2014
>Last-Modified:  Wed Dec 31 19:30:55 +0000 2014
>Originator:     Stuart Shelton
>Release:        pkgsrc latest from CVS
>Organization:
>Environment:
IRIX64 octane 6.5 07202013 IP30; IRIX 6.5.30; MIPSpro Compilers: Version 7.4.4m
>Description:

At the moment, glib2 fails to build on IRIX: the gio tests fail to build, and glocalfile tries to use the wrong vfs calls for IRIX.  The latter is fixed with the patch below, but the former I've only worked around by not building the gio tests.

Additionally, FAM support was being disabled on IRIX (FAM's native platform) because FAM has to be linked against libC on IRIX.

The patches are:


Remove gio tests

--- /usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/gio/Makefile.dist     2008-05-12 13:14:17.166860040 +0100
+++ /usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/gio/Makefile  2008-05-12 13:14:33.022595880 +0100
@@ -165,7 +165,7 @@ RECURSIVE_CLEAN_TARGETS = mostlyclean-re
   distclean-recursive maintainer-clean-recursive
 ETAGS = etags
 CTAGS = ctags
-DIST_SUBDIRS = xdgmime inotify . fam tests
+DIST_SUBDIRS = xdgmime inotify . fam
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = ${SHELL} /usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/missing --run aclocal-1.10
 ALLOCA = 
@@ -377,7 +377,7 @@ EXTRA_DIST = gio-marshal.list gio.symbol
        pltcheck.sh $(NULL)
 TEST_PROGS = 
 NULL = 
-SUBDIRS = $(am__append_1) $(am__append_2) . $(am__append_4) tests
+SUBDIRS = $(am__append_1) $(am__append_2) . $(am__append_4)
 #noinst_DATA = gio-2.0.lib
 ##TESTS = abicheck.sh pltcheck.sh
 AM_CPPFLAGS = \


Fix FAM

--- /usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/configure.dist        2008-05-12 12:57:03.329489680 +0100
+++ /usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/configure     2008-05-12 12:58:21.904929920 +0100
@@ -38044,7 +38044,7 @@ if test "${ac_cv_lib_fam_FAMOpen+set}" =
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfam  $LIBS"
+LIBS="-lfam -lC $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -38251,7 +38251,7 @@ if test "${ac_cv_lib_fam_FAMNoExists+set
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfam  $LIBS"
+LIBS="-lfam -lC $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -38314,7 +38314,7 @@ _ACEOF

 fi

-     FAM_LIBS="-lfam"
+     FAM_LIBS="-lfam -lC"
      fam_support=yes
 else
   { echo "$as_me:$LINENO: WARNING: *** FAM support will not be built (header files not found) ***" >&5


Use correct VFS API

--- /usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/gio/glocalfile.c.dist 2008-04-17 16:59:20.192031960 +0100
+++ /usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/gio/glocalfile.c      2008-04-17 17:47:52.824708520 +0100
@@ -57,6 +57,9 @@
    /* on solaris, statfs doesn't even have the
       f_bavail field */
 #  define USE_STATVFS
+# elif defined(__sgi)
+   /* on IRIX, also, statfs lacks f_bavail */
+#  define USE_STATVFS
 # else
   /* at least on linux, statfs is the actual syscall */
 #  define USE_STATFS
@@ -1004,8 +1007,12 @@ g_local_file_query_filesystem_info (GFil
 #if defined(HAVE_STRUCT_STATFS_F_FSTYPENAME)
   fstype = g_strdup(statfs_buffer.f_fstypename);
 #else
+#ifdef __sgi
+  fstype = get_fs_type (statfs_buffer.f_fstyp);
+#else
   fstype = get_fs_type (statfs_buffer.f_type);
 #endif
+#endif
   if (fstype &&
       g_file_attribute_matcher_matches (attribute_matcher,
                                        G_FILE_ATTRIBUTE_FILESYSTEM_TYPE))

>How-To-Repeat:

Building gio/tests results in:

gmake[4]: Entering directory `/usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/gio/tests'
source='live-g-file.c' object='live-g-file.o' libtool=no \
        DEPDIR=.deps depmode=sgi /usr/bsd/bin/bash ../../depcomp \
        cc -DHAVE_CONFIG_H -I. -I../.. -g -I../.. -I../../glib -I../../gmodule -I../../gobject -I../../gio -DG_DISABLE_CAST_CHECKS  -I/usr/bsd/include -D__inline__=inline -DPREFIX="\"/usr/bsd\"" -DPKGLOCALEDIR="\"share\"" -DPKG_SYSCONFDIR="\"/usr/bsd/etc\"" -I/usr/include  -D_REENTRANT  -c99 -O2 -n32 -mips4 -r14000 -apo -float_const -use_readonly_const -TARG:isa=mips4:platform=ip30:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -woff 1174,1183,1185,1552,3970,3968 -n32 -I/usr/bsd/include -I/usr/include -c live-g-file.c
cc WARNING:  -g conflicts with -O; changing to -O0; if you want -O, use -g3
cc WARNING:  -g conflicts with -apo, so ignoring -apo; if you want -apo, use -g3
cc-1018 cc: ERROR File = live-g-file.c, Line = 105
  An unmatched left parentheses "(" appears in an expression.

  #define log(msg...) if (verbose)  g_print (msg)
                 ^

cc-1055 cc: ERROR File = live-g-file.c, Line = 175
  A macro invocation has too many arguments.

         (char *) test_data);
         ^

(lots more errors)

cc-1029 cc: ERROR File = live-g-file.c, Line = 1002
  An expression is expected at this point.

              log ("      result = %d, error = %s\n", res, error->message);
              ^

46 errors detected in the compilation of "live-g-file.c".
gmake[4]: *** [live-g-file.o] Error 2
gmake[4]: Leaving directory `/usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/gio/tests'
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory `/usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/gio'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3/gio'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/bsd/var/tmp/devel/glib2/work/glib-2.16.3'
gmake: *** [all] Error 2
*** Error code 2

Stop.
bmake: stopped in /usr/bsd/src/devel/glib2
*** Error code 1

Stop.
bmake: stopped in /usr/bsd/src/devel/glib2

>Fix:

The problem gio/tests problem is a fairly simple varadic macros issue... but I can't work out the syntax to accept both a single or multiple parameters :(

It'll be something like:

#define log(msg) if (verbose) g_print (msg)

or

#define log(msg, ...) if (verbose) g_print (msg, ...)

This doesn't work either:

#define log(...) if (verbose) g_print (...)


(Note that the patch to configure is likely IRIX-specific... I'm not sure of the best way to conditionally include -lC on IRIX only.  Possibly a patch to the pkgsrc Makefile?)

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->irix-pkg-people
Responsible-Changed-By: snj@NetBSD.org
Responsible-Changed-When: Tue, 13 May 2008 00:03:08 +0000
Responsible-Changed-Why:
IRIX PR.


From: Tobias Nygren <tnn@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/38639 CVS commit: pkgsrc/devel/glib2
Date: Mon, 19 May 2008 19:08:36 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	tnn
 Date:		Mon May 19 19:08:36 UTC 2008

 Modified Files:
 	pkgsrc/devel/glib2: Makefile distinfo
 	pkgsrc/devel/glib2/patches: patch-ca

 Log Message:
 Fix most of the IRIX fam fallout mentioned in PR pkg/38639.
 The gio/tests issue remains, but I couldn't reproduce it with GCC.


 To generate a diff of this commit:
 cvs rdiff -r1.136 -r1.137 pkgsrc/devel/glib2/Makefile
 cvs rdiff -r1.96 -r1.97 pkgsrc/devel/glib2/distinfo
 cvs rdiff -r1.1 -r1.2 pkgsrc/devel/glib2/patches/patch-ca

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

From: Patrick Welche <prlw1@cam.ac.uk>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/38639
Date: Tue, 30 Dec 2014 12:02:03 +0000

 It seems that tnn already fixed this PR.

 Also, since glib 2.16, I rewrote the way vfs calls are detected in

 https://bugzilla.gnome.org/show_bug.cgi?id=617949

 Hopefully this should have fixed the IRIX build upstream.

 The second part of the PR concerns building gio tests which are turned
 off in patch-cl:

 - Leave gdbus-2.0/codegen sudirectory to devel/gdbus-codegen package.
 - Don't compile tests as they include gdbus-codegen tests.
 - Don't install completion data.

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Wed, 31 Dec 2014 19:30:55 +0000
State-Changed-Why:
turns out to be already fixed, thanks for the analysis.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.