Opened 3 years ago

Last modified 3 years ago

#63358 closed defect

glib2 @2.65.0: extra bit added on to universal.patch — at Initial Version

Reported by: kencu (Ken) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: glib2, glib2-devel

Description

While looking over the recent glib2 update, and considering the glib 2.67 update to come, I noticed this bit added onto universal.patch:

--- meson.build.orig	2019-11-17 14:26:49.000000000 -0300
+++ meson.build	2019-11-17 14:27:32.000000000 -0300
@@ -1584,17 +1584,9 @@
   glibconfig_conf.set(d[1], val)
 endforeach
 
-# We need a more robust approach here...
 host_cpu_family = host_machine.cpu_family()
-if host_cpu_family == 'x86' or host_cpu_family == 'x86_64' or host_cpu_family == 's390' or host_cpu_family == 's390x' or host_cpu_family.startswith('arm') or host_cpu_family == 'aarch64' or host_cpu_family.startswith('crisv32') or host_cpu_family.startswith('etrax')
-  glib_memory_barrier_needed = false
-elif host_cpu_family.startswith('sparc') or host_cpu_family.startswith('alpha') or host_cpu_family.startswith('powerpc') or host_cpu_family == 'ia64'
-  glib_memory_barrier_needed = true
-else
-  warning('Unknown host cpu: ' + host_cpu_family)
-  glib_memory_barrier_needed = true
-endif
-glibconfig_conf.set('G_ATOMIC_OP_MEMORY_BARRIER_NEEDED', glib_memory_barrier_needed)
+glib_is_powerpc = '#if (defined(__PPC__) || defined(__PPC64__) || defined(__powerpc__) || defined(__powerpc64__) || defined(_ARCH_PPC)  || defined(_ARCH_PPC64))\n#ifdef G_ATOMIC_OP_MEMORY_BARRIER_NEEDED\n#undef G_ATOMIC_OP_MEMORY_BARRIER_NEEDED\n#endif\n#define G_ATOMIC_OP_MEMORY_BARRIER_NEEDED 1\n#else\n#ifdef G_ATOMIC_OP_MEMORY_BARRIER_NEEDED\n#undef G_ATOMIC_OP_MEMORY_BARRIER_NEEDED\n#endif\n#endif'
+glibconfig_conf.set('glib_is_powerpc', glib_is_powerpc)
 
 # We need to decide at configure time if GLib will use real atomic
 # operations ("lock free") or emulated ones with a mutex.  This is

This was all done a few years ago, I note, as the update to glib2 has been in the works for a while.

This patch may well be correct -- it probably as, as all the tests work out well on 10.4 PPC to BigSur -- but even if so, it should be probably moved out of universal.patch and put into it's own separate patchfile so we don't lose track of it, and what it is supposed to be doing.

Change History (0)

Note: See TracTickets for help on using tickets.