Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#65663 closed defect (fixed)

glib2 @2.68.4: build failure for 10.4 PPC

Reported by: evanmiller (Evan Miller) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: tiger Cc: ryandesign (Ryan Carsten Schmidt), ballapete (Peter "Pete" Dyballa)
Port: glib2

Description

Haven't researched it but this is what I am seeing while trying to upgrade

:info:build FAILED: gio/libgio-2.0.0.dylib.p/gcredentials.c.o
:info:build /opt/local/bin/gcc-apple-4.2 -Igio/libgio-2.0.0.dylib.p -Igio -I../glib-2.68.4/gio -I. -I../glib-2.68.4 -Iglib -I../glib-2.68.4/glib -Igobject -I../glib-2.68.4/gobject -Igmodule -I../glib-2.68.4/gmodule -I/opt/local/include -std=gnu99 -O2 -g -D_GNU_SOURCE -fno-strict-aliasing -DG_ENABLE_DEBUG -Wstrict-prototypes -Wunused -Wno-unused-parameter -Wno-bad-function-cast -Wno-format-zero-length -Werror=declaration-after-statement -Werror=format=2 -Werror=implicit-function-declaration -Werror=init-self -Werror=missing-include-dirs -Werror=missing-prototypes -Werror=pointer-arith -pipe -Os -fstrict-aliasing -Wno-deprecated-declarations -arch ppc '-DG_LOG_DOMAIN="GLib-GIO"' -DGIO_COMPILATION '-DGIO_MODULE_DIR="/opt/local/lib/gio/modules"' '-DLOCALSTATEDIR="/opt/local/var"' -fvisibility=hidden -MD -MQ gio/libgio-2.0.0.dylib.p/gcredentials.c.o -MF gio/libgio-2.0.0.dylib.p/gcredentials.c.o.d -o gio/libgio-2.0.0.dylib.p/gcredentials.c.o -c ../glib-2.68.4/gio/gcredentials.c
:info:build ../glib-2.68.4/gio/gcredentials.c: In function 'g_credentials_to_string':
:info:build ../glib-2.68.4/gio/gcredentials.c:228: warning: implicit declaration of function 'glib_typeof'
:info:build ../glib-2.68.4/gio/gcredentials.c:228: error: expected ';' before 'i'
:info:build ../glib-2.68.4/gio/gcredentials.c:249: error: 'i' undeclared (first use in this function)
:info:build ../glib-2.68.4/gio/gcredentials.c:249: error: (Each undeclared identifier is reported only once
:info:build ../glib-2.68.4/gio/gcredentials.c:249: error: for each function it appears in.)
:info:build ninja: build stopped: subcommand failed.
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_glib2/glib2/work/build" && /opt/local/bin/ninja -j1 --verbose -v
:info:build Exit code: 1

Change History (9)

comment:1 Changed 2 years ago by mascguy (Christopher Nielsen)

Summary: glib @2.68.4: Build failure on 10.4 Tiger/PPCglib2 @2.68.4: build failure for 10.4 PPC

I'll take a look ASAP, via my 10.4/10.5 PPC installs. Thanks for the heads-up Evan!

comment:2 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

Cc: ballapete added

comment:3 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

The reason for the failure is in this function:

  211	/**
  212	 * g_credentials_to_string:
  213	 * @credentials: A #GCredentials object.
  214	 *
  215	 * Creates a human-readable textual representation of @credentials
  216	 * that can be used in logging and debug messages. The format of the
  217	 * returned string may change in future GLib release.
  218	 *
  219	 * Returns: (transfer full): A string that should be freed with g_free().
  220	 *
  221	 * Since: 2.26
  222	 */
  223	gchar *
  224	g_credentials_to_string (GCredentials *credentials)
  225	{
  226	  GString *ret;
  227	#if G_CREDENTIALS_USE_APPLE_XUCRED
  228	  glib_typeof (credentials->native.cr_ngroups) i;
  229	#endif
  230	
  231	  g_return_val_if_fail (G_IS_CREDENTIALS (credentials), NULL);
  232	
  233	  ret = g_string_new ("GCredentials:");
  234	#if G_CREDENTIALS_USE_LINUX_UCRED
  235	  g_string_append (ret, "linux-ucred:");
  236	  if (credentials->native.pid != (pid_t) -1)
  237	    g_string_append_printf (ret, "pid=%" G_GINT64_FORMAT ",", (gint64) credentials->native.pid);
  238	  if (credentials->native.uid != (uid_t) -1)
  239	    g_string_append_printf (ret, "uid=%" G_GINT64_FORMAT ",", (gint64) credentials->native.uid);
  240	  if (credentials->native.gid != (gid_t) -1)
  241	    g_string_append_printf (ret, "gid=%" G_GINT64_FORMAT ",", (gint64) credentials->native.gid);
  242	  if (ret->str[ret->len - 1] == ',')
  243	    ret->str[ret->len - 1] = '\0';
  244	#elif G_CREDENTIALS_USE_APPLE_XUCRED
  245	  g_string_append (ret, "apple-xucred:");
  246	  g_string_append_printf (ret, "version=%u,", credentials->native.cr_version);
  247	  if (credentials->native.cr_uid != (uid_t) -1)
  248	    g_string_append_printf (ret, "uid=%" G_GINT64_FORMAT ",", (gint64) credentials->native.cr_uid);
  249	  for (i = 0; i < credentials->native.cr_ngroups; i++)
  250	    g_string_append_printf (ret, "gid=%" G_GINT64_FORMAT ",", (gint64) credentials->native.cr_groups[i]);
  251	  if (ret->str[ret->len - 1] == ',')
  252	    ret->str[ret->len - 1] = '\0';
  253	#elif G_CREDENTIALS_USE_FREEBSD_CMSGCRED
  254	  g_string_append (ret, "freebsd-cmsgcred:");
  255	  if (credentials->native.cmcred_pid != (pid_t) -1)
  256	    g_string_append_printf (ret, "pid=%" G_GINT64_FORMAT ",", (gint64) credentials->native.cmcred_pid);
  257	  if (credentials->native.cmcred_euid != (uid_t) -1)
  258	    g_string_append_printf (ret, "uid=%" G_GINT64_FORMAT ",", (gint64) credentials->native.cmcred_euid);
  259	  if (credentials->native.cmcred_gid != (gid_t) -1)
  260	    g_string_append_printf (ret, "gid=%" G_GINT64_FORMAT ",", (gint64) credentials->native.cmcred_gid);
  261	#elif G_CREDENTIALS_USE_NETBSD_UNPCBID
  262	  g_string_append (ret, "netbsd-unpcbid:");
  263	  if (credentials->native.unp_pid != (pid_t) -1)
  264	    g_string_append_printf (ret, "pid=%" G_GINT64_FORMAT ",", (gint64) credentials->native.unp_pid);
  265	  if (credentials->native.unp_euid != (uid_t) -1)
  266	    g_string_append_printf (ret, "uid=%" G_GINT64_FORMAT ",", (gint64) credentials->native.unp_euid);
  267	  if (credentials->native.unp_egid != (gid_t) -1)
  268	    g_string_append_printf (ret, "gid=%" G_GINT64_FORMAT ",", (gint64) credentials->native.unp_egid);
  269	  ret->str[ret->len - 1] = '\0';
  270	#elif G_CREDENTIALS_USE_OPENBSD_SOCKPEERCRED
  271	  g_string_append (ret, "openbsd-sockpeercred:");
  272	  if (credentials->native.pid != (pid_t) -1)
  273	    g_string_append_printf (ret, "pid=%" G_GINT64_FORMAT ",", (gint64) credentials->native.pid);
  274	  if (credentials->native.uid != (uid_t) -1)
  275	    g_string_append_printf (ret, "uid=%" G_GINT64_FORMAT ",", (gint64) credentials->native.uid);
  276	  if (credentials->native.gid != (gid_t) -1)
  277	    g_string_append_printf (ret, "gid=%" G_GINT64_FORMAT ",", (gint64) credentials->native.gid);
  278	  if (ret->str[ret->len - 1] == ',')
  279	    ret->str[ret->len - 1] = '\0';
  280	#elif G_CREDENTIALS_USE_SOLARIS_UCRED
  281	  g_string_append (ret, "solaris-ucred:");
  282	  {
  283	    id_t id;
  284	    if ((id = ucred_getpid (credentials->native)) != (id_t) -1)
  285	      g_string_append_printf (ret, "pid=%" G_GINT64_FORMAT ",", (gint64) id);
  286	    if ((id = ucred_geteuid (credentials->native)) != (id_t) -1)
  287	      g_string_append_printf (ret, "uid=%" G_GINT64_FORMAT ",", (gint64) id);
  288	    if ((id = ucred_getegid (credentials->native)) != (id_t) -1)
  289	      g_string_append_printf (ret, "gid=%" G_GINT64_FORMAT ",", (gint64) id);
  290	    if (ret->str[ret->len - 1] == ',')
  291	      ret->str[ret->len - 1] = '\0';
  292	  }
  293	#else
  294	  g_string_append (ret, "unknown");
  295	#endif
  296	
  297	  return g_string_free (ret, FALSE);
  298	}

The C variable type glib_typeof is unknown on line #228 and so the variable i on line #249 cannot be used. This variable type is only used in glib-2.68.4/gio/gcredentials.c. These C header files at least refer to it:

glib-2.68.4/glib/gatomic.h
glib-2.68.4/glib/gmacros.h
glib-2.68.4/glib/gmem.h
glib-2.68.4/glib/grcbox.h
glib-2.68.4/gobject/gobject.h

but none of them has a #typedef… What they do is (mainly):

glib-2.68.4/glib/gatomic.h:29:#if defined(glib_typeof_2_68) && GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68
glib-2.68.4/glib/gatomic.h:30:/* for glib_typeof */
glib-2.68.4/glib/gatomic.h:111:#if defined(glib_typeof) && (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68)
glib-2.68.4/glib/gatomic.h:115:    glib_typeof (*(atomic)) gapg_temp_newval;                              \
glib-2.68.4/glib/gatomic.h:116:    glib_typeof ((atomic)) gapg_temp_atomic = (atomic);                    \
glib-2.68.4/glib/gatomic.h:123:    glib_typeof ((atomic)) gaps_temp_atomic = (atomic);                     \
glib-2.68.4/glib/gatomic.h:124:    glib_typeof (*(atomic)) gaps_temp_newval = (newval);                    \
glib-2.68.4/glib/gatomic.h:128:#else /* if !(defined(glib_typeof) && (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68)) */
glib-2.68.4/glib/gatomic.h:145:#endif /* if defined(glib_typeof) && (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68) */
glib-2.68.4/glib/gatomic.h:191:#if defined(glib_typeof) && defined(__cplusplus) && __cplusplus >= 201103L
glib-2.68.4/glib/gatomic.h:203:    glib_typeof (*(atomic)) gapcae_oldval = (oldval);                        \
glib-2.68.4/glib/gatomic.h:208:#else /* if !(defined(glib_typeof) && defined(__cplusplus) && __cplusplus >= 201103L) */
glib-2.68.4/glib/gatomic.h:217:#endif /* defined(glib_typeof) */
glib-2.68.4/glib/gatomic.h:310:#if defined(glib_typeof) && (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68)
glib-2.68.4/glib/gatomic.h:317:    *(atomic) = (glib_typeof (*(atomic))) (gsize) (newval);                  \
glib-2.68.4/glib/gatomic.h:319:#else /* if !(defined(glib_typeof) && (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68)) */
glib-2.68.4/glib/gatomic.h:328:#endif /* if defined(glib_typeof) && (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68) */
glib-2.68.4/glib/gatomic.h:431:#if defined(glib_typeof) && (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68)
glib-2.68.4/glib/gatomic.h:440:  (glib_typeof (*(atomic))) (void *) ((g_atomic_pointer_get) ((void *) atomic))
glib-2.68.4/glib/gatomic.h:441:#else /* !(defined(glib_typeof) && (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68)) */
glib-2.68.4/glib/gmacros.h:234:#undef glib_typeof
glib-2.68.4/glib/gmacros.h:238:#define glib_typeof(t) __typeof__ (t)
glib-2.68.4/glib/gmacros.h:244: * Within GLib itself, which use `glib_typeof` need to add the include
glib-2.68.4/glib/gmacros.h:247:#define glib_typeof(t) typename std::remove_reference<decltype (t)>::type
glib-2.68.4/glib/gmacros.h:248:#define glib_typeof_2_68
glib-2.68.4/glib/gmem.h:34:#if defined(glib_typeof_2_68) && GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68
glib-2.68.4/glib/gmem.h:35:/* for glib_typeof */
glib-2.68.4/glib/gmem.h:118:#if defined(glib_typeof) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_58 && (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68)
glib-2.68.4/glib/gmem.h:123:    glib_typeof ((pp)) _pp = (pp);                       \
glib-2.68.4/glib/gmem.h:124:    glib_typeof (*(pp)) _ptr = *_pp;                     \
glib-2.68.4/glib/gmem.h:221:#if defined(glib_typeof) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_58 && (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68)
glib-2.68.4/glib/gmem.h:222:#define g_steal_pointer(pp) ((glib_typeof (*pp)) (g_steal_pointer) (pp))
glib-2.68.4/glib/grcbox.h:27:#if defined(glib_typeof_2_68) && GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68
glib-2.68.4/glib/grcbox.h:28:/* for glib_typeof */
glib-2.68.4/glib/grcbox.h:79:#if defined(glib_typeof) && (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68)
glib-2.68.4/glib/grcbox.h:82:  ((glib_typeof (mem_block)) (g_rc_box_acquire) (mem_block))
glib-2.68.4/glib/grcbox.h:84:  ((glib_typeof (mem_block)) (g_atomic_rc_box_acquire) (mem_block))
glib-2.68.4/glib/grcbox.h:88:  ((glib_typeof (mem_block)) (g_rc_box_dup) (block_size, mem_block))
glib-2.68.4/glib/grcbox.h:90:  ((glib_typeof (mem_block)) (g_atomic_rc_box_dup) (block_size, mem_block))
glib-2.68.4/gobject/gobject.h:31:#if defined(glib_typeof_2_68) && GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68
glib-2.68.4/gobject/gobject.h:32:/* for glib_typeof */
glib-2.68.4/gobject/gobject.h:521:#if defined(glib_typeof) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_56 && (!defined(glib_typeof_2_68) || GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68)
glib-2.68.4/gobject/gobject.h:523:#define g_object_ref(Obj) ((glib_typeof (Obj)) (g_object_ref) (Obj))
glib-2.68.4/gobject/gobject.h:524:#define g_object_ref_sink(Obj) ((glib_typeof (Obj)) (g_object_ref_sink) (Obj))

So presumingly there is some GLib-2 C header file that defines this variable type… This, in `glib-2.68.4/glib/gatomic.h, could be helpful:

   20	#ifndef __G_ATOMIC_H__
   21	#define __G_ATOMIC_H__
   22	
   23	#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
   24 	#error "Only <glib.h> can be included directly."
   25	#endif
   26	
   27	#include <glib/gtypes.h>
   28	
   29	#if defined(glib_typeof_2_68) && GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68
   30	/* for glib_typeof */
   31	#include <type_traits>
   32	#endif

No version of gtypes.h has this #define'd.

comment:4 Changed 2 years ago by mascguy (Christopher Nielsen)

Evan, just curious... does glib2-devel or glib2-upstream build successfully?

comment:5 Changed 2 years ago by evanmiller (Evan Miller)

glib2-devel fails with

:info:build [115/1103] /opt/local/bin/gcc-apple-4.2 -Iglib/tests/atomic.p -Iglib/tests -I../glib-2.70.5/glib/tests -I. -I../glib-2.70.5 -Iglib -I../glib-2.70.5/glib -I/opt/local/include -std=gnu99 -O2 -g -D_GNU_SOURCE -fno-strict-aliasing -DG_ENABLE_DEBUG -Wstrict-prototypes -Wunused -Wno-unused-parameter -Wno-bad-function-cast -Wno-format-zero-length -Werror=declaration-after-statement -Werror=format=2 -Werror=implicit-function-declaration -Werror=init-self -Werror=missing-include-dirs -Werror=missing-prototypes -Werror=pointer-arith -pipe -Os -fstrict-aliasing -Wno-deprecated-declarations -arch ppc '-DG_LOG_DOMAIN="GLib"' -UG_DISABLE_ASSERT -Wstrict-aliasing=2 -MD -MQ glib/tests/atomic.p/atomic.c.o -MF glib/tests/atomic.p/atomic.c.o.d -o glib/tests/atomic.p/atomic.c.o -c ../glib-2.70.5/glib/tests/atomic.c
:info:build FAILED: glib/tests/atomic.p/atomic.c.o
:info:build /opt/local/bin/gcc-apple-4.2 -Iglib/tests/atomic.p -Iglib/tests -I../glib-2.70.5/glib/tests -I. -I../glib-2.70.5 -Iglib -I../glib-2.70.5/glib -I/opt/local/include -std=gnu99 -O2 -g -D_GNU_SOURCE -fno-strict-aliasing -DG_ENABLE_DEBUG -Wstrict-prototypes -Wunused -Wno-unused-parameter -Wno-bad-function-cast -Wno-format-zero-length -Werror=declaration-after-statement -Werror=format=2 -Werror=implicit-function-declaration -Werror=init-self -Werror=missing-include-dirs -Werror=missing-prototypes -Werror=pointer-arith -pipe -Os -fstrict-aliasing -Wno-deprecated-declarations -arch ppc '-DG_LOG_DOMAIN="GLib"' -UG_DISABLE_ASSERT -Wstrict-aliasing=2 -MD -MQ glib/tests/atomic.p/atomic.c.o -MF glib/tests/atomic.p/atomic.c.o.d -o glib/tests/atomic.p/atomic.c.o -c ../glib-2.70.5/glib/tests/atomic.c
:info:build ../glib-2.70.5/glib/tests/atomic.c: In function 'test_types':
:info:build ../glib-2.70.5/glib/tests/atomic.c:100: error: #pragma GCC diagnostic not allowed inside functions
:info:build ../glib-2.70.5/glib/tests/atomic.c:101: error: #pragma GCC diagnostic not allowed inside functions
:info:build ../glib-2.70.5/glib/tests/atomic.c:105: error: #pragma GCC diagnostic not allowed inside functions
:info:build ninja: build stopped: subcommand failed.

comment:6 Changed 2 years ago by evanmiller (Evan Miller)

After fixing the above issue with glib2-devel, I get the same glib_typeof issue that I appears with 2.68.4.

comment:7 Changed 2 years ago by evanmiller (Evan Miller)

Resolution: fixed
Status: assignedclosed

In e2201b91bb78b88592f0f813e605c0a8e5c1ca6f/macports-ports (master):

glib2: Fix build with pre-C++11 compilers

Fixes: #65663

comment:8 Changed 2 years ago by Christopher Nielsen <mascguy@…>

In f75372ff5c21cfa5b581e2e830a8461e15584a5a/macports-ports (master):

glib2-devel: fix build with pre-C++11 compilers
See: #65663

comment:9 Changed 2 years ago by Christopher Nielsen <mascguy@…>

In ec2e2f9fd3f3204f739d504ce0f5ae7e4864c727/macports-ports (master):

glib2-upstream: fix build with pre-C++11 compilers
See: #65663

Note: See TracTickets for help on using tickets.