pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/devel/glib2 g/c use of __GCC_HAVE_SYNC_COMPARE_AND_SWA...
details: https://anonhg.NetBSD.org/pkgsrc/rev/e0f87e0fdf90
branches: trunk
changeset: 335659:e0f87e0fdf90
user: prlw1 <prlw1%pkgsrc.org@localhost>
date: Wed Jun 26 10:42:50 2019 +0000
description:
g/c use of __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 which glib was already
ignoring for linux and android.
http://mail-index.netbsd.org/tech-userlevel/2019/06/25/msg011965.html
Should complete PR pkg/54298
diffstat:
devel/glib2/Makefile | 4 +-
devel/glib2/distinfo | 6 ++-
devel/glib2/patches/patch-glib_gatomic.c | 31 +++++++++++++++++++
devel/glib2/patches/patch-glib_gatomic.h | 25 ++++++++++++++++
devel/glib2/patches/patch-meson.build | 50 ++++++++++++++++++++++++++-----
5 files changed, 104 insertions(+), 12 deletions(-)
diffs (207 lines):
diff -r 11f04f8facaf -r e0f87e0fdf90 devel/glib2/Makefile
--- a/devel/glib2/Makefile Wed Jun 26 10:07:49 2019 +0000
+++ b/devel/glib2/Makefile Wed Jun 26 10:42:50 2019 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.255 2019/06/25 10:57:28 prlw1 Exp $
+# $NetBSD: Makefile,v 1.256 2019/06/26 10:42:50 prlw1 Exp $
.include "Makefile.common"
-PKGREVISION= 3
+PKGREVISION= 4
CATEGORIES= devel gnome
COMMENT= Some useful routines for C programming (glib2)
diff -r 11f04f8facaf -r e0f87e0fdf90 devel/glib2/distinfo
--- a/devel/glib2/distinfo Wed Jun 26 10:07:49 2019 +0000
+++ b/devel/glib2/distinfo Wed Jun 26 10:42:50 2019 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.251 2019/06/25 16:08:55 schmonz Exp $
+$NetBSD: distinfo,v 1.252 2019/06/26 10:42:50 prlw1 Exp $
SHA1 (glib-2.60.4.tar.xz) = f76ef7339fef5784d79520478110caa4c5054806
RMD160 (glib-2.60.4.tar.xz) = e8520dd0da7c37e6bb18b24a3b3ec308a6fa6aa0
@@ -13,6 +13,8 @@
SHA1 (patch-gio_inotify_inotify-kernel.c) = 24deec33a1ad5e3c1a4f2d1397440d26b0f23b84
SHA1 (patch-gio_meson.build) = a0dcda4e9d05ed83b7fb11102945821eea27b81d
SHA1 (patch-gio_tests_gdbus-export.c) = 59d85ca079d02b52e33153c7d2ac1cc48c26707a
+SHA1 (patch-glib_gatomic.c) = 875ad9c828dcf2add356d4988d14fb4f1985aef8
+SHA1 (patch-glib_gatomic.h) = 21294cac483c3379198283c54fe6e24af3e630b1
SHA1 (patch-glib_ghash.c) = 938135c3a71199e61d1cd1dffa6e1d63864150d6
SHA1 (patch-glib_glibconfig.h.in) = 1964b5fb15317e681dad426d4862e3f48c4274f7
SHA1 (patch-glib_gmain.c) = 2ab4b59e438d9f764bee62e0c1fa8bbd231b6e8d
@@ -26,4 +28,4 @@
SHA1 (patch-gmodule_gmodule.c) = 55c5f9d16e3517f3fdc04d40922f50d9c66b0b9a
SHA1 (patch-gobject_glib-mkenums.in) = c177cf9b1ea81542665240678f47f68351a3760d
SHA1 (patch-gobject_meson.build) = 58ee162e44047bf20c66067fd3edbe98cc13af50
-SHA1 (patch-meson.build) = ce24f19714f6d78d1be9ecd6802f6c25a086c8e8
+SHA1 (patch-meson.build) = 125d98082c9bf2b6403bbda1c12e0fa695031ee6
diff -r 11f04f8facaf -r e0f87e0fdf90 devel/glib2/patches/patch-glib_gatomic.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/glib2/patches/patch-glib_gatomic.c Wed Jun 26 10:42:50 2019 +0000
@@ -0,0 +1,31 @@
+$NetBSD: patch-glib_gatomic.c,v 1.1 2019/06/26 10:42:50 prlw1 Exp $
+
+Ignore __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 as is already done
+for android and linux. PR pkg/54298
+
+--- glib/gatomic.c.orig 2019-06-10 17:47:20.000000000 +0000
++++ glib/gatomic.c
+@@ -94,8 +94,6 @@
+ * implement the atomic operations in a lock-free manner.
+ */
+
+-#if defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
+-
+ #if defined(__ATOMIC_SEQ_CST) && !defined(__clang__)
+ /* The implementation used in this code path in gatomic.h assumes
+ * 4-byte int */
+@@ -667,14 +665,6 @@ gsize
+ return InterlockedXor (atomic, val);
+ #endif
+ }
+-#else
+-
+-/* This error occurs when `meson configure` decided that we should be capable
+- * of lock-free atomics but we find at compile-time that we are not.
+- */
+-#error G_ATOMIC_LOCK_FREE defined, but incapable of lock-free atomics.
+-
+-#endif /* defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) */
+
+ #else /* G_ATOMIC_LOCK_FREE */
+
diff -r 11f04f8facaf -r e0f87e0fdf90 devel/glib2/patches/patch-glib_gatomic.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/glib2/patches/patch-glib_gatomic.h Wed Jun 26 10:42:50 2019 +0000
@@ -0,0 +1,25 @@
+$NetBSD: patch-glib_gatomic.h,v 1.1 2019/06/26 10:42:50 prlw1 Exp $
+
+Ignore __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 as is already done
+for android and linux. PR pkg/54298
+
+--- glib/gatomic.h.orig 2019-06-10 17:47:20.000000000 +0000
++++ glib/gatomic.h
+@@ -82,7 +82,7 @@ gint g_atomic_int_exc
+
+ G_END_DECLS
+
+-#if defined(G_ATOMIC_LOCK_FREE) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
++#if defined(G_ATOMIC_LOCK_FREE)
+
+ /* We prefer the new C11-style atomic extension of GCC if available */
+ #if defined(__ATOMIC_SEQ_CST) && !defined(__clang__)
+@@ -250,7 +250,7 @@ G_END_DECLS
+ (gsize) __sync_fetch_and_xor ((atomic), (val)); \
+ }))
+
+-#else /* defined(G_ATOMIC_LOCK_FREE) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) */
++#else /* defined(G_ATOMIC_LOCK_FREE) */
+
+ #define g_atomic_int_get(atomic) \
+ (g_atomic_int_get ((gint *) (atomic)))
diff -r 11f04f8facaf -r e0f87e0fdf90 devel/glib2/patches/patch-meson.build
--- a/devel/glib2/patches/patch-meson.build Wed Jun 26 10:07:49 2019 +0000
+++ b/devel/glib2/patches/patch-meson.build Wed Jun 26 10:42:50 2019 +0000
@@ -1,19 +1,53 @@
-$NetBSD: patch-meson.build,v 1.4 2019/06/18 13:05:14 jperkin Exp $
+$NetBSD: patch-meson.build,v 1.5 2019/06/26 10:42:50 prlw1 Exp $
- Don't insist that python binary is called "python3".
(Requires meson >= 0.50.0)
- Don't install bash completion scripts.
- Tolerate getxattr not existing (smartOS)
-https://gitlab.gnome.org/GNOME/glib/merge_requests/888
+ https://gitlab.gnome.org/GNOME/glib/merge_requests/888
- Define a newer POSIX, as we build this package with -std=gnu99
- auto-detect GNU iconv, even if no arguments are passed.
(by checking if iconv.h might in fact be a gnu one)
+- Ignore __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 as is already done
+ for android and linux. PR pkg/54298
+
--- meson.build.orig 2019-06-10 17:47:20.000000000 +0000
+++ meson.build
-@@ -1696,14 +1696,14 @@ else
+@@ -1570,28 +1570,15 @@ atomictest = '''int main() {
+ }
+ '''
+
+-atomicdefine = '''
+-#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
+-#error "compiler has atomic ops, but doesn't define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4"
+-#endif
+-'''
+-
+ # We know that we can always use real ("lock free") atomic operations with MSVC
+ if cc.get_id() == 'msvc' or cc.links(atomictest, name : 'atomic ops')
+- have_atomic_lock_free = true
+- if (host_system == 'android' or host_system == 'linux') and not cc.compiles(atomicdefine, name : 'atomic ops define')
+- # When building for armv5 on Linux, gcc provides
+- # __sync_bool_compare_and_swap but doesn't define
+- # __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
+- glib_conf.set('__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4', true)
+- endif
++ glibconfig_conf.set('G_ATOMIC_LOCK_FREE', true)
+ else
+- have_atomic_lock_free = false
+ if host_machine.cpu_family() == 'x86' and cc.links(atomictest, args : '-march=i486')
+ error('GLib must be built with -march=i486 or later.')
+ endif
++ glibconfig_conf.set('G_ATOMIC_LOCK_FREE', false)
+ endif
+-glibconfig_conf.set('G_ATOMIC_LOCK_FREE', have_atomic_lock_free)
+
+ # === Threads ===
+
+@@ -1696,14 +1683,14 @@ else
found_iconv = false
if iconv_opt == 'libc'
if cc.has_function('iconv_open')
@@ -36,7 +70,7 @@
endif
elif iconv_opt == 'native'
if cc.has_header_symbol('iconv.h', 'iconv_open')
-@@ -1785,7 +1785,7 @@ endif
+@@ -1785,7 +1772,7 @@ endif
# proxy-libintl subproject.
# FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible
# implementations. This could be extended if issues are found in some platforms.
@@ -45,7 +79,7 @@
libintl = []
have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset')
else
-@@ -1836,16 +1836,15 @@ if host_system != 'windows' and get_opti
+@@ -1836,16 +1823,15 @@ if host_system != 'windows' and get_opti
if cc.has_function('getxattr') and cc.has_header('sys/xattr.h')
glib_conf.set('HAVE_SYS_XATTR_H', 1)
glib_conf_prefix = glib_conf_prefix + '#define @0@ 1\n'.format('HAVE_SYS_XATTR_H')
@@ -64,7 +98,7 @@
if cc.compiles(glib_conf_prefix + '''
#include <stdio.h>
#ifdef HAVE_SYS_TYPES_H
-@@ -1886,9 +1885,11 @@ elif meson.get_cross_property('have_strl
+@@ -1886,9 +1872,11 @@ elif meson.get_cross_property('have_strl
glib_conf.set('HAVE_STRLCPY', 1)
endif
@@ -79,7 +113,7 @@
python_version = python.language_version()
python_version_req = '>=3.4'
-@@ -1897,7 +1898,7 @@ if not python_version.version_compare(py
+@@ -1897,7 +1885,7 @@ if not python_version.version_compare(py
endif
# Determine which user environment-dependent files that we want to install
@@ -88,7 +122,7 @@
have_sh = find_program('sh', required : false).found() # For glib-gettextize
# Some installed tests require a custom environment
-@@ -1906,7 +1907,7 @@ env_program = find_program('env', requir
+@@ -1906,7 +1894,7 @@ env_program = find_program('env', requir
# FIXME: How to detect Solaris? https://github.com/mesonbuild/meson/issues/1578
if host_system == 'sunos'
glib_conf.set('_XOPEN_SOURCE_EXTENDED', 1)
Home |
Main Index |
Thread Index |
Old Index