Opened 7 months ago

Last modified 6 months ago

#69843 new defect

glib2 @2.78.4 -x11 -xauth +no_x11 +quartz fails to build on OSX 10.4 Tiger

Reported by: pkoshevoy (Pavel Koshevoy) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.9.3
Keywords: tiger Cc: mascguy (Christopher Nielsen), cooljeanius (Eric Gallager)
Port: glib2

Description

$ sudo port clean glib2
--->  Cleaning glib2

$ sudo port upgrade glib2 -x11 -xauth +no_x11 +quartz
--->  Computing dependencies for glib2
--->  Fetching archive for glib2
--->  Attempting to fetch glib2-2.78.4_0+quartz.darwin_8.ppc.tbz2 from http://packages.macports.org/glib2
--->  Attempting to fetch glib2-2.78.4_0+quartz.darwin_8.ppc.tbz2 from http://mirror.fcix.net/macports/packages/glib2
--->  Attempting to fetch glib2-2.78.4_0+quartz.darwin_8.ppc.tbz2 from http://ywg.ca.packages.macports.org/mirror/macports/packages/glib2
--->  Fetching distfiles for glib2
--->  Verifying checksums for glib2
--->  Extracting glib2
--->  Applying patches to glib2
--->  Configuring glib2
Warning: Configuration logfiles contain indications of -Wimplicit-function-declaration; check that features were not accidentally disabled:
  statx: found in build/meson-logs/meson-log.txt
  __sync_swap: found in build/meson-logs/meson-log.txt
--->  Building glib2
Error: Failed to build glib2: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_glib2/glib2/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.

Attachments (1)

main.log (598.2 KB) - added by pkoshevoy (Pavel Koshevoy) 7 months ago.
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_glib2/glib2/main.log

Download all attachments as: .zip

Change History (11)

Changed 7 months ago by pkoshevoy (Pavel Koshevoy)

Attachment: main.log added

/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_glib2/glib2/main.log

comment:1 Changed 7 months ago by kencu (Ken)

 ../glib-2.78.4/gio/gosxcontenttype.m:357:30: error: 'kUTTypeApplication' undeclared (first use in this function); did you mean 'GApplication'?

you'll not get very far at all trying to build -x11 +quartz on Tiger.

the quartz variants are usually built to support current MacOS systems, and they require newer Apple feature sets, SDKs, and technologies, for the most part.

I suggest you stick to +x11 and you'll get much further.

comment:2 Changed 7 months ago by pkoshevoy (Pavel Koshevoy)

I have no use for x11 support in any of the ports, I always explicitly disable it (-x11 -xauth +no_x11 +quartz). glib2 used to build on tiger with +quartz, but now it's doesn't. Unfortunately, glib2 is a dependency for some of the ports I actually need (libass ... or one of its dependencies). I would rather have an older version of glib2 that builds on tiger, than the latest version that breaks tiger compatibility and therefore prevents upgrade of the ports that I actually need.

I suspect the patch to fix that build failure might be a trivial 1-liner -- just add

#include <LaunchServices/UTCoreTypes.h>

to gio/gosxcontenttype.m

Last edited 6 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:3 Changed 7 months ago by pkoshevoy (Pavel Koshevoy)

I added #include <LaunchServices/UTCoreTypes.h> to gio/gosxcontenttype.m and ran (under sudo su -)

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

that built for a while and then failed on glib/gfileutils.c implicit declaration of strnlen I replaced it with memchr and tried again... this time if failed on glib/gmem.c implicit declaration of posix_memalign

macmini-g4-125:/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_glib2/glib2/work/build root# 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 
[1/532] /opt/local/bin/gcc-mp-7 -Iglib/libglib-2.0.0.dylib.p -Iglib -I../glib-2.78.4/glib -I. -I../glib-2.78.4 -I/opt/local/include -fvisibility=hidden -fdiagnostics-color=always -std=gnu99 -O2 -g -D_GNU_SOURCE -fno-strict-aliasing -DG_DISABLE_CAST_CHECKS -Wduplicated-branches -Wimplicit-fallthrough -Wmisleading-indentation -Wmissing-field-initializers -Wnonnull -Wunused -Wno-unused-parameter -Wno-pedantic -Wno-format-zero-length -Wno-variadic-macros -Werror=format=2 -Werror=init-self -Werror=missing-include-dirs -Werror=pointer-arith -Werror=unused-result -Wstrict-prototypes -Wno-bad-function-cast -Wno-declaration-after-statement -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=pointer-sign -pipe -Os -fstrict-aliasing -Wno-deprecated-declarations -D__DARWIN_NON_CANCELABLE=1 -arch ppc '-DG_LOG_DOMAIN="GLib"' -DGLIB_COMPILATION -MD -MQ glib/libglib-2.0.0.dylib.p/gmem.c.o -MF glib/libglib-2.0.0.dylib.p/gmem.c.o.d -o glib/libglib-2.0.0.dylib.p/gmem.c.o -c ../glib-2.78.4/glib/gmem.c
FAILED: glib/libglib-2.0.0.dylib.p/gmem.c.o 
/opt/local/bin/gcc-mp-7 -Iglib/libglib-2.0.0.dylib.p -Iglib -I../glib-2.78.4/glib -I. -I../glib-2.78.4 -I/opt/local/include -fvisibility=hidden -fdiagnostics-color=always -std=gnu99 -O2 -g -D_GNU_SOURCE -fno-strict-aliasing -DG_DISABLE_CAST_CHECKS -Wduplicated-branches -Wimplicit-fallthrough -Wmisleading-indentation -Wmissing-field-initializers -Wnonnull -Wunused -Wno-unused-parameter -Wno-pedantic -Wno-format-zero-length -Wno-variadic-macros -Werror=format=2 -Werror=init-self -Werror=missing-include-dirs -Werror=pointer-arith -Werror=unused-result -Wstrict-prototypes -Wno-bad-function-cast -Wno-declaration-after-statement -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=pointer-sign -pipe -Os -fstrict-aliasing -Wno-deprecated-declarations -D__DARWIN_NON_CANCELABLE=1 -arch ppc '-DG_LOG_DOMAIN="GLib"' -DGLIB_COMPILATION -MD -MQ glib/libglib-2.0.0.dylib.p/gmem.c.o -MF glib/libglib-2.0.0.dylib.p/gmem.c.o.d -o glib/libglib-2.0.0.dylib.p/gmem.c.o -c ../glib-2.78.4/glib/gmem.c
In file included from ../glib-2.78.4/glib/gmem.c:31:0:
./config.h:358:0: warning: "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4" redefined
 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
 
<built-in>: note: this is the location of the previous definition
../glib-2.78.4/glib/gmem.c: In function 'g_aligned_alloc':
../glib-2.78.4/glib/gmem.c:672:11: error: implicit declaration of function 'posix_memalign' [-Werror=implicit-function-declaration]
   errno = posix_memalign (&res, alignment, real_size);
           ^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
ninja: build stopped: subcommand failed.
Version 0, edited 7 months ago by pkoshevoy (Pavel Koshevoy) (next)

comment:4 Changed 7 months ago by pkoshevoy (Pavel Koshevoy)

The changes I've tried so far:

# (cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_glib2/glib2/work/glib-2.78.4/gio; diff gosxcontenttype.m~ gosxcontenttype.m)
26a27
> #include <LaunchServices/UTCoreTypes.h>
# (cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_glib2/glib2/work/glib-2.78.4/glib; diff gfileutils.c~ gfileutils.c)3003c3003
<   g_assert (dir == NULL || strnlen (dir, buffer_size) < buffer_size);
---
>   g_assert (dir == NULL || memchr (dir, '\0', buffer_size) != NULL);

comment:5 Changed 7 months ago by kencu (Ken)

I just rebuilt glib2 2.78.4_0 (normal default x11 version) and it builds and installs on Tiger PPC for me without any trouble.

As x11 is the only windowing system that has any chance of being useful on Tiger, that is what everyone uses. So once again, I recommend you use that instead of the largely useless quartz variant on Tiger.

If you insist on staying on quartz on Tiger despite this, and if you get a patch sorted out that works and passes some kind of testing, we will look at it.

comment:6 Changed 7 months ago by pkoshevoy (Pavel Koshevoy)

It appears that strnlen is provided in /opt/local/include/LegacySupport/string.h, and posix_memalign is provided in /opt/local/include/LegacySupport/stdlib.h So, I don't think I should be running into those build errors. Any idea why I'm seeing these errors when I just rerun the ninja command?

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
Last edited 6 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:7 Changed 7 months ago by pkoshevoy (Pavel Koshevoy)

I ran it as root ... when macports builds stuff -- does it set anything in env like CPATH, or LIBPATH?

comment:8 Changed 6 months ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:9 in reply to:  7 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to pkoshevoy:

when macports builds stuff -- does it set anything in env like CPATH, or LIBPATH?

Yes, MacPorts sets the CPATH environment variable to the value of the MacPorts compiler.cpath option and its sets the LIBRARY_PATH environment variable to the value of the MacPorts compiler.library_path option. There are numerous other environment variables that MacPorts sets in various ways. You can see the full list by examining a port's main.log file or using the debug mode switch (-d).

comment:10 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)

Summary: glib2 -2.78.4 -x11 -xauth +no_x11 +quartz fails to build on OSX 10.4 Tigerglib2 @2.78.4 -x11 -xauth +no_x11 +quartz fails to build on OSX 10.4 Tiger
Note: See TracTickets for help on using tickets.