pkgsrc-Bugs archive

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

Re: pkg/47941: devel/glib2 build failure on NetBSD/arm 6.1



The following reply was made to PR pkg/47941; it has been noted by GNATS.

From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: tsutsui%ceres.dti.ne.jp@localhost
Subject: Re: pkg/47941: devel/glib2 build failure on NetBSD/arm 6.1
Date: Fri, 21 Jun 2013 00:59:54 +0900

 > > >  >  (1)inverted configure test for __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
 > > >  
 > > >  Looks good.
 > > >  
 > > >  >  (2)incorrect configure test for __sync_bool_compare_and_swap()
 > > >  
 > > >  This too.
 > 
 > After some thoughts and checks, I notice that the cofingure test (1)
 > is correct but didn't work correctly due to the problem (2).
 > 
 > The test (1) for __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 is inside of
 > "if test x"$glib_cv_g_atomic_lock_free" = xyes; then"
 > statement, so the macro won't be set if the test (2) returns
 > a correct result.
 > 
 > I'll update patches and test them tomorrow.
 
 I've comfirmed that fixes for (2) (use AC_TRY_LINK instead of
 AC_TRY_COMPILE) and (3) (use proper arg types) are enough
 for NetBSD/arm 6.1 builds and no breakage on NetBSD/i386 6.1.
 
 Index: patches/patch-aa
 ===================================================================
 RCS file: /cvsroot/pkgsrc/devel/glib2/patches/patch-aa,v
 retrieving revision 1.54
 diff -u -p -r1.54 patch-aa
 --- patches/patch-aa   6 Oct 2012 20:44:05 -0000       1.54
 +++ patches/patch-aa   20 Jun 2013 15:49:25 -0000
 @@ -1,8 +1,8 @@
  $NetBSD: patch-aa,v 1.54 2012/10/06 20:44:05 prlw1 Exp $
  
 ---- configure.orig    2012-09-24 01:26:24.000000000 +0000
 +--- configure.orig    2013-06-09 22:53:42.000000000 +0000
  +++ configure
 -@@ -721,6 +721,7 @@ GIO
 +@@ -724,6 +724,7 @@ GIO
   GSPAWN
   GLIB_DEBUG_FLAGS
   G_MODULE_NEED_USCORE
 @@ -10,7 +10,7 @@ $NetBSD: patch-aa,v 1.54 2012/10/06 20:4
   G_MODULE_BROKEN_RTLD_GLOBAL
   G_MODULE_HAVE_DLERROR
   G_MODULE_LDFLAGS
 -@@ -21565,6 +21566,8 @@ else
 +@@ -21108,6 +21109,8 @@ else
   # ifdef _MSC_VER
   #  include <malloc.h>
   #  define alloca _alloca
 @@ -19,7 +19,7 @@ $NetBSD: patch-aa,v 1.54 2012/10/06 20:4
   # else
   #  ifdef HAVE_ALLOCA_H
   #   include <alloca.h>
 -@@ -22610,8 +22613,8 @@ else
 +@@ -22153,8 +22156,8 @@ else
   fi
   
   
 @@ -30,7 +30,7 @@ $NetBSD: patch-aa,v 1.54 2012/10/06 20:4
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   /* end confdefs.h.  */
   #if defined(__SUNPRO_C) || (__SUNPRO_C >= 0x550)
 -@@ -24210,16 +24213,48 @@ fi
 +@@ -23807,16 +23810,48 @@ fi
   
   case $host in
     *-*-solaris* )
 @@ -80,7 +80,7 @@ $NetBSD: patch-aa,v 1.54 2012/10/06 20:4
   esac
   
   if test "$ac_cv_func_statfs" = yes; then :
 -@@ -25231,10 +25266,11 @@ if test x"$glib_native_win32" = xyes; th
 +@@ -24829,10 +24864,11 @@ if test x"$glib_native_win32" = xyes; th
       G_MODULE_LDFLAGS=
   else
     export SED
 @@ -93,7 +93,7 @@ $NetBSD: patch-aa,v 1.54 2012/10/06 20:4
   G_MODULE_HAVE_DLERROR=0
   if test -z "$G_MODULE_IMPL"; then
     case "$host" in
 -@@ -25452,13 +25488,13 @@ if  test "$G_MODULE_IMPL" = "G_MODULE_IM
 +@@ -25050,13 +25086,13 @@ if  test "$G_MODULE_IMPL" = "G_MODULE_IM
        LIBS="$G_MODULE_LIBS $LIBS"
        LDFLAGS="$LDFLAGS $G_MODULE_LDFLAGS"
        echo "void glib_plugin_test(void) { }" > plugin.c
 @@ -110,7 +110,7 @@ $NetBSD: patch-aa,v 1.54 2012/10/06 20:4
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RTLD_GLOBAL 
brokenness" >&5
   $as_echo_n "checking for RTLD_GLOBAL brokenness... " >&6; }
   if ${glib_cv_rtldglobal_broken+:} false; then :
 -@@ -25568,6 +25604,56 @@ fi
 +@@ -25166,6 +25202,56 @@ fi
        LIBS="$LIBS_orig"
   
   fi
 @@ -167,7 +167,7 @@ $NetBSD: patch-aa,v 1.54 2012/10/06 20:4
   if test -z "$G_MODULE_IMPL"; then
        G_MODULE_IMPL=0
           G_MODULE_SUPPORTED=false
 -@@ -25578,7 +25664,7 @@ fi
 +@@ -25176,7 +25262,7 @@ fi
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the suffix of module 
shared libraries" >&5
   $as_echo_n "checking for the suffix of module shared libraries... " >&6; }
   export SED
 @@ -176,7 +176,7 @@ $NetBSD: patch-aa,v 1.54 2012/10/06 20:4
   eval $shrext_cmds
   module=yes eval std_shrext=$shrext_cmds
   # chop the initial dot
 -@@ -25602,6 +25688,7 @@ fi
 +@@ -25200,6 +25286,7 @@ fi
   
   
   
 @@ -184,7 +184,7 @@ $NetBSD: patch-aa,v 1.54 2012/10/06 20:4
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gspawn implementation" 
>&5
   $as_echo_n "checking for gspawn implementation... " >&6; }
   case "$host" in
 -@@ -26543,62 +26630,8 @@ if  test x"$have_threads" = xposix; then
 +@@ -26177,62 +26264,8 @@ if  test x"$have_threads" = xposix; then
         G_THREAD_LIBS="-lpthread -lthread"
         ;;
       *)
 @@ -249,7 +249,7 @@ $NetBSD: patch-aa,v 1.54 2012/10/06 20:4
          ;;
     esac
   
 -@@ -27112,6 +27145,7 @@ case $host in
 +@@ -26746,6 +26779,7 @@ case $host in
       ;;
     *-*-openbsd*)
       LDFLAGS="$LDFLAGS -pthread"
 @@ -257,3 +257,30 @@ $NetBSD: patch-aa,v 1.54 2012/10/06 20:4
       ;;
     *)
       G_THREAD_LIBS_FOR_GTHREAD="$G_THREAD_LIBS"
 +@@ -26844,7 +26878,7 @@ volatile int atomic = 2;\
 +   return 0;
 + }
 + _ACEOF
 +-if ac_fn_c_try_compile "$LINENO"; then :
 ++if ac_fn_c_try_link "$LINENO"; then :
 +   glib_cv_g_atomic_lock_free=yes
 + else
 +   glib_cv_g_atomic_lock_free=no
 +@@ -26865,7 +26899,7 @@ volatile int atomic = 2;\
 +   return 0;
 + }
 + _ACEOF
 +-if ac_fn_c_try_compile "$LINENO"; then :
 ++if ac_fn_c_try_link "$LINENO"; then :
 +   as_fn_error $? "GLib must be build with -march=i486 or later." "$LINENO" 5
 + fi
 + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 +@@ -26896,7 +26930,7 @@ __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4;
 +   return 0;
 + }
 + _ACEOF
 +-if ac_fn_c_try_compile "$LINENO"; then :
 ++if ac_fn_c_try_link "$LINENO"; then :
 + 
 + else
 + 
 Index: patches/patch-ak
 ===================================================================
 RCS file: /cvsroot/pkgsrc/devel/glib2/patches/patch-ak,v
 retrieving revision 1.15
 diff -u -p -r1.15 patch-ak
 --- patches/patch-ak   19 Apr 2013 22:21:41 -0000      1.15
 +++ patches/patch-ak   20 Jun 2013 15:49:25 -0000
 @@ -1,6 +1,6 @@
  $NetBSD: patch-ak,v 1.15 2013/04/19 22:21:41 prlw1 Exp $
  
 ---- configure.ac.orig 2013-03-25 20:37:16.000000000 +0000
 +--- configure.ac.orig 2013-06-09 22:53:13.000000000 +0000
  +++ configure.ac
  @@ -858,7 +858,7 @@ int main (void)
   AC_MSG_RESULT($g_have_gnuc_visibility)
 @@ -158,3 +158,30 @@ $NetBSD: patch-ak,v 1.15 2013/04/19 22:2
       ;;
     *)
       G_THREAD_LIBS_FOR_GTHREAD="$G_THREAD_LIBS"
 +@@ -2390,7 +2423,7 @@ AC_CACHE_CHECK([for lock-free atomic int
 +       glib_cv_g_atomic_lock_free=yes
 +       ;;
 +     *)
 +-      AC_TRY_COMPILE([],
 ++      AC_TRY_LINK([],
 +                      [volatile int atomic = 2;\
 +                       __sync_bool_compare_and_swap (&atomic, 2, 3);],
 +                      [glib_cv_g_atomic_lock_free=yes],
 +@@ -2398,7 +2431,7 @@ AC_CACHE_CHECK([for lock-free atomic int
 +       if test "$glib_cv_g_atomic_lock_free" = "no"; then
 +         SAVE_CFLAGS="${CFLAGS}"
 +         CFLAGS="-march=i486"
 +-        AC_TRY_COMPILE([],
 ++        AC_TRY_LINK([],
 +                        [volatile int atomic = 2;\
 +                         __sync_bool_compare_and_swap (&atomic, 2, 3);],
 +                        [AC_MSG_ERROR([GLib must be build with -march=i486 or 
later.])],
 +@@ -2416,7 +2449,7 @@ case $host in
 +     # Some compilers support atomic operations but do not define
 +     # __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4, like clang
 +     if test x"$glib_cv_g_atomic_lock_free" = xyes; then
 +-      AC_TRY_COMPILE([],
 ++      AC_TRY_LINK([],
 +                      [__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4;],
 +                      [],
 +                      [AC_DEFINE(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4, 1, [ 
compiler supports atomic operations])])
 Index: patches/patch-ce
 ===================================================================
 RCS file: /cvsroot/pkgsrc/devel/glib2/patches/patch-ce,v
 retrieving revision 1.5
 diff -u -p -r1.5 patch-ce
 --- patches/patch-ce   30 Apr 2012 13:53:48 -0000      1.5
 +++ patches/patch-ce   20 Jun 2013 15:49:25 -0000
 @@ -3,7 +3,7 @@ $NetBSD: patch-ce,v 1.5 2012/04/30 13:53
  Fix inconsistency of .hidden attributes, leading to link error on amd64,
  reported by Tobias Nygren.
  
 ---- glib/gatomic.c.orig       2012-03-12 00:42:41.000000000 +0000
 +--- glib/gatomic.c.orig       2013-06-09 22:03:17.000000000 +0000
  +++ glib/gatomic.c
  @@ -22,6 +22,7 @@
   #include "config.h"
 @@ -13,3 +13,24 @@ reported by Tobias Nygren.
   
   /**
    * SECTION:atomic_operations
 +@@ -682,7 +683,7 @@ gsize
 + static pthread_mutex_t g_atomic_lock = PTHREAD_MUTEX_INITIALIZER;
 + 
 + gint
 +-(g_atomic_int_get) (volatile gint *atomic)
 ++(g_atomic_int_get) (const volatile gint *atomic)
 + {
 +   gint value;
 + 
 +@@ -797,9 +798,9 @@ guint
 + 
 + 
 + gpointer
 +-(g_atomic_pointer_get) (volatile void *atomic)
 ++(g_atomic_pointer_get) (const volatile void *atomic)
 + {
 +-  volatile gpointer *ptr = atomic;
 ++  const volatile gpointer *ptr = atomic;
 +   gpointer value;
 + 
 +   pthread_mutex_lock (&g_atomic_lock);
 Index: distinfo
 ===================================================================
 RCS file: /cvsroot/pkgsrc/devel/glib2/distinfo,v
 retrieving revision 1.190
 diff -u -p -r1.190 distinfo
 --- distinfo   16 Jun 2013 20:37:07 -0000      1.190
 +++ distinfo   20 Jun 2013 15:49:25 -0000
 @@ -3,7 +3,7 @@ $NetBSD: distinfo,v 1.190 2013/06/16 20:
  SHA1 (glib-2.36.3.tar.xz) = aafba69934b9ba77cc8cb0e5d8105aa1d8463eba
  RMD160 (glib-2.36.3.tar.xz) = 2db71aacc028a6d39ec5fdeacf326b7a19e8bb28
  Size (glib-2.36.3.tar.xz) = 6626972 bytes
 -SHA1 (patch-aa) = 71405ed89d2abd25edec375d52c43fe50c9f7c82
 +SHA1 (patch-aa) = ae0c88420d83e40d38c9395b94c41f73f236b92e
  SHA1 (patch-ab) = 04bde955a2a588011a8c77ada4923d5464a0d544
  SHA1 (patch-ac) = 96e153339675457356f71e35d20375bed669d337
  SHA1 (patch-ae) = 09f16e8e14bdea3ee0e478d335f65cb66939e5f5
 @@ -11,7 +11,7 @@ SHA1 (patch-af) = 45c46d5d01517563fde21b
  SHA1 (patch-ah) = 64765bc71ed7d75ff3e47f77359ecfce63c0e851
  SHA1 (patch-aha) = 3249929122a567eec3c421a1efa0ac510f1474b7
  SHA1 (patch-ai) = 037e2bb85fbc473c431bbf736dae89825236ff31
 -SHA1 (patch-ak) = 950b7ca1e414560123b6ba56bb273baaa42364f7
 +SHA1 (patch-ak) = cfd91a9b120ab0f9f71deb1ff3d0006bb3b3a3c2
  SHA1 (patch-al) = bde29693322c568f9a4ad090f1d469de5f69920e
  SHA1 (patch-am) = 99f54927d76580dfeda2a6b1909e1bea5dbdc293
  SHA1 (patch-an) = 2d4eaa904347481bec55668e56d2ac431b567bc9
 @@ -21,7 +21,7 @@ SHA1 (patch-ba) = 1119c43d1cc6e36aeb50be
  SHA1 (patch-cb) = 56e2a9b2de04c8e528faf7ce778503fa55dcc3ac
  SHA1 (patch-cc) = f3d37cbb483863aab602f9c1209650e3e4795871
  SHA1 (patch-cd) = 312e2f322b295ddec613f9ce9760ecafeab69047
 -SHA1 (patch-ce) = ab978e9acfbfcd4e1249cbc2f9ab7e503d62a53f
 +SHA1 (patch-ce) = dc2aa070a3bc0003fce495a5fdaced35d49054e8
  SHA1 (patch-cj) = 6e5fa171080b45372af9c95ab0abfde5e90fdf57
  SHA1 (patch-ck) = 324116cc6fb8dbce8ce8d20f5b237fc469a55cd2
  SHA1 (patch-cl) = eb00468c5c5c70dd41803a2a263204686959a415
 


Home | Main Index | Thread Index | Old Index