ibm-s390-linux / s390-tools

Tools for use with the s390 Linux kernel and device drivers
MIT License
62 stars 58 forks source link

zdump: fails to build with glib 2.56 #146

Closed sharkcz closed 1 year ago

sharkcz commented 1 year ago

zdump fails to build with glib 2.56 (eg. from RHEL-8) because it uses stuff from glib 2.58

gcc -I ../include -D_GNU_SOURCE -DS390_TOOLS_RELEASE=2.25.0-1.el8 -DS390_TOOLS_LIBDIR=/lib/s390-tools -DS390_TOOLS_DATADIR=/usr/share/s390-tools -DS390_TOOLS_SYSCONFDIR=/etc -DS390_TOOLS_BINDIR=/usr/sbin -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=z13 -mtune=z14 -fasynchronous-unwind-tables -fstack-clash-protection -Wno-address-of-packed-member -DHAVE_FUSE=1 -I/usr/include/fuse3  -DOPENSSL_API_COMPAT=0x10100000L -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include    -c pv_utils.c -o pv_utils.o
pv_utils.c:677:2: error: unknown type name 'gatomicrefcount'
  gatomicrefcount ref_count;
  ^~~~~~~~~~~~~~~
pv_utils.c: In function 'storage_state_mmap_new':
pv_utils.c:736:2: warning: implicit declaration of function 'g_atomic_ref_count_init'; did you mean 'g_static_rw_lock_init'? [-Wimplicit-function-declaration]
  g_atomic_ref_count_init(&ret->ref_count);
  ^~~~~~~~~~~~~~~~~~~~~~~
  g_static_rw_lock_init
pv_utils.c: In function 'storage_state_mmap_ref':
pv_utils.c:743:2: warning: implicit declaration of function 'g_atomic_ref_count_inc'; did you mean 'g_atomic_int_inc'? [-Wimplicit-function-declaration]
  g_atomic_ref_count_inc(&storage_state->ref_count);
  ^~~~~~~~~~~~~~~~~~~~~~
  g_atomic_int_inc
pv_utils.c: In function 'storage_state_mmap_unref':
pv_utils.c:751:35: warning: implicit declaration of function 'g_atomic_ref_count_dec'; did you mean 'g_atomic_int_inc'? [-Wimplicit-function-declaration]
  if (storage_state->ref_count && !g_atomic_ref_count_dec(&storage_state->ref_count))
                                   ^~~~~~~~~~~~~~~~~~~~~~
                                   g_atomic_int_inc
pv_utils.c: At top level:
cc1: warning: unrecognized command line option '-Wno-address-of-packed-member'
make[1]: Leaving directory '/builddir/build/BUILD/s390-tools-2.25.0/zdump'
make[1]: *** [../common.mak:269: pv_utils.o] Error 1
make: *** [Makefile:51: zdump] Error 2

The refcounting has been added in 2.58, see https://developer-old.gnome.org/glib/stable/glib-Reference-counting.html

sharkcz commented 1 year ago

I am asking about backporting the refcounting to the RHEL-8 glib2 package in https://bugzilla.redhat.com/show_bug.cgi?id=2153205, but it can be rejected.