Opened 2 years ago

Last modified 2 years ago

#64787 assigned defect

shared-mime-info fails to build for ppc64 on Leopard: need to add muniversal PortGroup

Reported by: barracuda156 Owned by: RJVB (René Bertin)
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: powerpc, leopard, ppc64 Cc:
Port: shared-mime-info

Description (last modified by barracuda156)

Earlier problem:

--->  Building shared-mime-info
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_shared-mime-info/shared-mime-info/work/build" && /opt/local/bin/ninja -j4 -v 
[1/8] /usr/bin/gcc-4.2 -Isrc/test-subclassing.p -Isrc -I../shared-mime-info-2.1/src -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/libxml2 -I/opt/local/include -Wall -Winvalid-pch -g -pipe -Os -arch ppc64 -MD -MQ src/test-subclassing.p/test-subclassing.c.o -MF src/test-subclassing.p/test-subclassing.c.o.d -o src/test-subclassing.p/test-subclassing.c.o -c ../shared-mime-info-2.1/src/test-subclassing.c
[2/8] /usr/bin/gcc-4.2  -o src/test-subclassing src/test-subclassing.p/test-subclassing.c.o -L/opt/local/lib -I/opt/local/include -Wl,-dead_strip_dylibs -Wl,-headerpad_max_install_names -Wl,-undefined,error -Wl,-headerpad_max_install_names -arch ppc64 -pipe -Os -arch ppc64 -L/opt/local/lib -lglib-2.0 -lintl /opt/local/lib/libxml2.a
FAILED: src/test-subclassing 
/usr/bin/gcc-4.2  -o src/test-subclassing src/test-subclassing.p/test-subclassing.c.o -L/opt/local/lib -I/opt/local/include -Wl,-dead_strip_dylibs -Wl,-headerpad_max_install_names -Wl,-undefined,error -Wl,-headerpad_max_install_names -arch ppc64 -pipe -Os -arch ppc64 -L/opt/local/lib -lglib-2.0 -lintl /opt/local/lib/libxml2.a
Undefined symbols:
  "_deflate", referenced from:
      _xmlIOHTTPCloseWrite in libxml2.a(xmlIO.o)
      _xmlIOHTTPWrite in libxml2.a(xmlIO.o)
  "_deflateEnd", referenced from:
      _xmlFreeZMemBuff in libxml2.a(xmlIO.o)
  "_gzclose", referenced from:
      _xmlGzfileClose in libxml2.a(xmlIO.o)
  "_ucnv_setToUCallBack_67", referenced from:
      _openIcuConverter in libxml2.a(encoding.o)
  "_crc32", referenced from:
      _xmlIOHTTPWrite in libxml2.a(xmlIO.o)
      _xmlIOHTTPOpenW in libxml2.a(xmlIO.o)
      _xz_decomp in libxml2.a(xzlib.o)
      _xz_decomp in libxml2.a(xzlib.o)
      _xz_make in libxml2.a(xzlib.o)
  "_UCNV_TO_U_CALLBACK_STOP_67", referenced from:
      _UCNV_TO_U_CALLBACK_STOP_67$non_lazy_ptr in libxml2.a(encoding.o)
  "_gzwrite", referenced from:
      _xmlGzfileWrite in libxml2.a(xmlIO.o)
  "_ucnv_convertEx_67", referenced from:
      _xmlUconvWrapper in libxml2.a(encoding.o)
  "_gzdopen", referenced from:
      _xmlGzfileOpenW in libxml2.a(xmlIO.o)
      _xmlGzfileOpen_real in libxml2.a(xmlIO.o)
  "_ucnv_close_67", referenced from:
      _closeIcuConverter in libxml2.a(encoding.o)
      _closeIcuConverter in libxml2.a(encoding.o)
      _openIcuConverter in libxml2.a(encoding.o)
  "_inflateEnd", referenced from:
      _xmlNanoHTTPFreeCtxt in libxml2.a(nanohttp.o)
      ___libxml2_xzclose in libxml2.a(xzlib.o)
  "_inflate", referenced from:
      _xmlNanoHTTPRead in libxml2.a(nanohttp.o)
      _xz_decomp in libxml2.a(xzlib.o)
  "_deflateInit2_", referenced from:
      _xmlIOHTTPOpenW in libxml2.a(xmlIO.o)
  "_inflateReset", referenced from:
      _xz_make in libxml2.a(xzlib.o)
  "_lzma_end", referenced from:
      ___libxml2_xzclose in libxml2.a(xzlib.o)
  "_lzma_properties_decode", referenced from:
      _xz_make in libxml2.a(xzlib.o)
  "_libiconv_close", referenced from:
      _xmlCharEncCloseFunc in libxml2.a(encoding.o)
      _xmlCharEncCloseFunc in libxml2.a(encoding.o)
      _xmlFindCharEncodingHandler in libxml2.a(encoding.o)
      _xmlFindCharEncodingHandler in libxml2.a(encoding.o)
  "_gzdirect", referenced from:
      ___xmlParserInputBufferCreateFilename in libxml2.a(xmlIO.o)
  "_inflateInit2_", referenced from:
      _xmlNanoHTTPMethodRedir in libxml2.a(nanohttp.o)
      _xz_make in libxml2.a(xzlib.o)
  "_libiconv", referenced from:
      _xmlIconvWrapper in libxml2.a(encoding.o)
  "_ucnv_setFromUCallBack_67", referenced from:
      _openIcuConverter in libxml2.a(encoding.o)
  "_UCNV_FROM_U_CALLBACK_STOP_67", referenced from:
      _UCNV_FROM_U_CALLBACK_STOP_67$non_lazy_ptr in libxml2.a(encoding.o)
  "_libiconv_open", referenced from:
      _xmlFindCharEncodingHandler in libxml2.a(encoding.o)
      _xmlFindCharEncodingHandler in libxml2.a(encoding.o)
      _xmlFindCharEncodingHandler in libxml2.a(encoding.o)
      _xmlFindCharEncodingHandler in libxml2.a(encoding.o)
  "_lzma_auto_decoder", referenced from:
      _xz_make in libxml2.a(xzlib.o)
  "_ucnv_open_67", referenced from:
      _openIcuConverter in libxml2.a(encoding.o)
      _openIcuConverter in libxml2.a(encoding.o)
  "_gzopen", referenced from:
      _xmlGzfileOpenW in libxml2.a(xmlIO.o)
      _xmlGzfileOpen_real in libxml2.a(xmlIO.o)
  "_gzread", referenced from:
      _xmlGzfileRead in libxml2.a(xmlIO.o)
  "_lzma_code", referenced from:
      _xz_decomp in libxml2.a(xzlib.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
[3/8] /usr/bin/gcc-4.2 -Isrc/update-mime-database.p -Isrc -I../shared-mime-info-2.1/src -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/libxml2 -I/opt/local/include -Wall -Winvalid-pch -g -pipe -Os -arch ppc64 -MD -MQ src/update-mime-database.p/update-mime-database.c.o -MF src/update-mime-database.p/update-mime-database.c.o.d -o src/update-mime-database.p/update-mime-database.c.o -c ../shared-mime-info-2.1/src/update-mime-database.c
In file included from /opt/local/include/glib-2.0/glib/gthread.h:34,
                 from /opt/local/include/glib-2.0/glib/gasyncqueue.h:32,
                 from /opt/local/include/glib-2.0/glib.h:32,
                 from ../shared-mime-info-2.1/src/update-mime-database.c:11:
/opt/local/include/glib-2.0/glib/gutils.h:336: warning: ‘GVoidFunc’ is deprecated
In file included from /opt/local/include/glib-2.0/glib.h:32,
                 from ../shared-mime-info-2.1/src/update-mime-database.c:11:
/opt/local/include/glib-2.0/glib/gasyncqueue.h:116: warning: ‘GTimeVal’ is deprecated
/opt/local/include/glib-2.0/glib/gasyncqueue.h:119: warning: ‘GTimeVal’ is deprecated
In file included from /opt/local/include/glib-2.0/glib.h:43,
                 from ../shared-mime-info-2.1/src/update-mime-database.c:11:
/opt/local/include/glib-2.0/glib/gdate.h:201: warning: ‘GTimeVal’ is deprecated
/opt/local/include/glib-2.0/glib/gdate.h:204: warning: ‘GTime’ is deprecated
In file included from /opt/local/include/glib-2.0/glib.h:44,
                 from ../shared-mime-info-2.1/src/update-mime-database.c:11:
/opt/local/include/glib-2.0/glib/gdatetime.h:118: warning: ‘GTimeVal’ is deprecated
/opt/local/include/glib-2.0/glib/gdatetime.h:120: warning: ‘GTimeVal’ is deprecated
/opt/local/include/glib-2.0/glib/gdatetime.h:246: warning: ‘GTimeVal’ is deprecated
In file included from /opt/local/include/glib-2.0/glib/giochannel.h:33,
                 from /opt/local/include/glib-2.0/glib.h:54,
                 from ../shared-mime-info-2.1/src/update-mime-database.c:11:
/opt/local/include/glib-2.0/glib/gmain.h:654: warning: ‘GTimeVal’ is deprecated
/opt/local/include/glib-2.0/glib/gmain.h:679: warning: ‘GTimeVal’ is deprecated
In file included from /opt/local/include/glib-2.0/glib.h:85,
                 from ../shared-mime-info-2.1/src/update-mime-database.c:11:
/opt/local/include/glib-2.0/glib/gtestutils.h:379: warning: ‘GTestTrapFlags’ is deprecated
In file included from /opt/local/include/glib-2.0/glib.h:88,
                 from ../shared-mime-info-2.1/src/update-mime-database.c:11:
/opt/local/include/glib-2.0/glib/gtimer.h:67: warning: ‘GTimeVal’ is deprecated
/opt/local/include/glib-2.0/glib/gtimer.h:71: warning: ‘GTimeVal’ is deprecated
/opt/local/include/glib-2.0/glib/gtimer.h:73: warning: ‘GTimeVal’ is deprecated
In file included from /opt/local/include/glib-2.0/glib.h:90,
                 from ../shared-mime-info-2.1/src/update-mime-database.c:11:
/opt/local/include/glib-2.0/glib/gtrashstack.h:41: warning: ‘GTrashStack’ is deprecated
/opt/local/include/glib-2.0/glib/gtrashstack.h:45: warning: ‘GTrashStack’ is deprecated
/opt/local/include/glib-2.0/glib/gtrashstack.h:48: warning: ‘GTrashStack’ is deprecated
/opt/local/include/glib-2.0/glib/gtrashstack.h:50: warning: ‘GTrashStack’ is deprecated
/opt/local/include/glib-2.0/glib/gtrashstack.h:52: warning: ‘GTrashStack’ is deprecated
In file included from /opt/local/include/glib-2.0/glib.h:107,
                 from ../shared-mime-info-2.1/src/update-mime-database.c:11:
/opt/local/include/glib-2.0/glib/deprecated/gcache.h:47: warning: ‘GCacheNewFunc’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gcache.h:48: warning: ‘GCacheDestroyFunc’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gcache.h:49: warning: ‘GCacheDupFunc’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gcache.h:50: warning: ‘GCacheDestroyFunc’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gcache.h:55: warning: ‘GCache’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gcache.h:57: warning: ‘GCache’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gcache.h:60: warning: ‘GCache’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gcache.h:63: warning: ‘GCache’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gcache.h:67: warning: ‘GCache’ is deprecated
In file included from /opt/local/include/glib-2.0/glib.h:111,
                 from ../shared-mime-info-2.1/src/update-mime-database.c:11:
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:52: warning: ‘GThreadPriority’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:70: warning: ‘GTimeVal’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:81: warning: ‘GThreadPriority’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:88: warning: ‘GThreadPriority’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:94: warning: ‘GThreadFunctions’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:111: warning: ‘GThreadPriority’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:116: warning: ‘GThreadPriority’ is deprecated
In file included from /opt/local/include/glib-2.0/glib.h:111,
                 from ../shared-mime-info-2.1/src/update-mime-database.c:11:
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:146: warning: ‘GStaticMutex’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:148: warning: ‘GStaticMutex’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:150: warning: ‘GStaticMutex’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:156: warning: ‘GStaticMutex’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:172: warning: ‘GStaticRecMutex’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:175: warning: ‘GStaticRecMutex’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:178: warning: ‘GStaticRecMutex’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:181: warning: ‘GStaticRecMutex’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:184: warning: ‘GStaticRecMutex’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:188: warning: ‘GStaticRecMutex’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:191: warning: ‘GStaticRecMutex’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:197: warning: ‘GStaticMutex’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:209: warning: ‘GStaticRWLock’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:212: warning: ‘GStaticRWLock’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:215: warning: ‘GStaticRWLock’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:218: warning: ‘GStaticRWLock’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:221: warning: ‘GStaticRWLock’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:224: warning: ‘GStaticRWLock’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:227: warning: ‘GStaticRWLock’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:230: warning: ‘GStaticRWLock’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:244: warning: ‘GStaticPrivate’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:247: warning: ‘GStaticPrivate’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:250: warning: ‘GStaticPrivate’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:255: warning: ‘GStaticPrivate’ is deprecated
/opt/local/include/glib-2.0/glib/deprecated/gthread.h:283: warning: ‘GTimeVal’ is deprecated
[4/8] /opt/local/bin/xmlto -o data/shared-mime-info-spec-html html-nochunks ../shared-mime-info-2.1/data/shared-mime-info-spec.xml
[5/8] /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_shared-mime-info/shared-mime-info/work/shared-mime-info-2.1/data/freedesktop_generate.sh /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_shared-mime-info/shared-mime-info/work/shared-mime-info-2.1 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_shared-mime-info/shared-mime-info/work/build
ninja: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_shared-mime-info/shared-mime-info/work/build'
[0/1] Running external command shared-mime-info-gmo (wrapped by meson to set env)
ninja: build stopped: subcommand failed.
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_shared-mime-info/shared-mime-info/work/build" && /opt/local/bin/ninja -j4 -v 
Exit code: 1
Error: Failed to build shared-mime-info: command execution failed

Just in case, glib2 is built for ppc64:

36-72:~ svacchanda$ port -v installed glib2
The following ports are currently installed:
  glib2 @2.62.6_2+x11 requested_variants='-universal' platform='darwin 9' archs='ppc' date='2021-12-22T12:28:22+0800'
  glib2 @2.64.6_0+x11 requested_variants='' platform='darwin 9' archs='ppc' date='2021-12-29T16:07:42+0800'
  glib2 @2.64.6_1+x11 (active) requested_variants='-universal' platform='darwin 9' archs='ppc64' date='2022-03-08T06:30:55+0800'

As well as libxml2:

36-72:~ svacchanda$ port -v installed libxml2
The following ports are currently installed:
  libxml2 @2.9.12_1 requested_variants='-universal' platform='darwin 9' archs='ppc' date='2021-12-22T12:25:12+0800'
  libxml2 @2.9.12_1+universal requested_variants='+universal' platform='darwin 9' archs='ppc ppc64' date='2021-12-22T08:28:30+0800'
  libxml2 @2.9.13_0 requested_variants='-universal' platform='darwin 9' archs='ppc' date='2022-03-03T04:18:59+0800'
  libxml2 @2.9.13_0+universal (active) requested_variants='+universal' platform='darwin 9' archs='ppc ppc64' date='2022-03-08T06:06:56+0800'

UPDATE AFTER FIXING MESON: shared-mime-info still fails as +universal:

Build type: native build
Project name: shared-mime-info
Project version: 2.2

meson.build:2:0: ERROR: Unable to detect linker for compiler "/usr/bin/gcc-4.2 -Wl,--version -pipe -Os -arch ppc -arch ppc64 -I/opt/local/include"
stdout: 
stderr: 

A full log can be found at /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_shared-mime-info/shared-mime-info/work/build/meson-logs/meson-log.txt
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_shared-mime-info/shared-mime-info/work/shared-mime-info-2.2" && /opt/local/bin/meson --prefix=/opt/local /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_shared-mime-info/shared-mime-info/work/shared-mime-info-2.2 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_shared-mime-info/shared-mime-info/work/build 
Exit code: 1
Error: Failed to configure shared-mime-info: consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_shared-mime-info/shared-mime-info/work/build/meson-logs/meson-log.txt
Error: Failed to configure shared-mime-info: configure failure: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_shared-mime-info/shared-mime-info/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there
is a bug.
Error: Processing of port shared-mime-info failed

However once muniversal 1.0 is added, it builds successfully:

36-109:svacchanda$ port -v installed shared-mime-info
The following ports are currently installed:
  shared-mime-info @2.1_0 requested_variants='-universal' platform='darwin 9' archs='ppc' date='2022-02-19T01:40:21+0800'
  shared-mime-info @2.2_0+universal (active) requested_variants='+universal' platform='darwin 9' archs='ppc ppc64' date='2022-04-06T07:05:16+0800'

Attachments (2)

main.log (29.0 KB) - added by barracuda156 2 years ago.
meson-log.txt (17.2 KB) - added by barracuda156 2 years ago.

Download all attachments as: .zip

Change History (16)

Changed 2 years ago by barracuda156

Attachment: main.log added

Changed 2 years ago by barracuda156

Attachment: meson-log.txt added

comment:1 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

It is unusual that it is trying to link with the static library libxml2.a. It should be linking with the dynamic library libxml2.dylib. Once that is fixed, the undefined symbols should disappear.

The meson log says the reason is:

Rejected /opt/local/lib/libxml2.dylib, supports ['ppc7400', 'ppc64'] but need ppc

It is "normal" for software to build for ppc7400 (G4) when -arch ppc is used on a system version that does not support G3 processors. Maybe meson is not aware of that and needs to be enhanced to deal with it.

comment:2 in reply to:  1 Changed 2 years ago by barracuda156

Replying to ryandesign:

It is unusual that it is trying to link with the static library libxml2.a. It should be linking with the dynamic library libxml2.dylib. Once that is fixed, the undefined symbols should disappear.

The meson log says the reason is:

Rejected /opt/local/lib/libxml2.dylib, supports ['ppc7400', 'ppc64'] but need ppc

It is "normal" for software to build for ppc7400 (G4) when -arch ppc is used on a system version that does not support G3 processors. Maybe meson is not aware of that and needs to be enhanced to deal with it.

Could you suggest what should I try to do?

  1. S. Notice a similar error with gobject-introspection that uses meson now: https://trac.macports.org/ticket/64769

comment:3 Changed 2 years ago by kencu (Ken)

read through the meson source code. It’s written in python, so easy enough. Find some part where it is examing the architecture of dependent libraries. Fix it to not error with the ppc7400 issue. Possibly submit the fix upstream.

Or, just open an issue with meson and see if they will fix it for you. Don’t hold your breath there, but….

Or, ask Evan to fix it. He only has a G3 though, so doesn’t see this error and can’t test it….

Last edited 2 years ago by kencu (Ken) (previous) (diff)

comment:4 in reply to:  3 ; Changed 2 years ago by barracuda156

Replying to kencu:

read through the meson source code. It’s written in python, so easy enough. Find some part where it is examing the architecture of dependent libraries. Fix it to not error with the ppc7400 issue. Possibly submit the fix upstream.

I have fixed meson:

--- mesonbuild/mesonlib/universal.py.orig	2022-03-15 17:29:03.000000000 +0800
+++ mesonbuild/mesonlib/universal.py	2022-04-06 06:59:05.000000000 +0800
@@ -710,6 +710,8 @@
     # Convert from lipo-style archs to meson-style CPUs
     stdo = stdo.replace('i386', 'x86')
     stdo = stdo.replace('arm64', 'aarch64')
+    stdo = stdo.replace('ppc7400', 'ppc')
+    stdo = stdo.replace('ppc970', 'ppc64')
     # Add generic name for armv7 and armv7s
     if 'armv7' in stdo:
         stdo += ' arm'

  1. S. Added ppc970 just in case, may be redundant.
Last edited 2 years ago by barracuda156 (previous) (diff)

comment:5 Changed 2 years ago by barracuda156

Description: modified (diff)
Owner: set to RJVB
Status: newassigned
Summary: shared-mime-info fails to build for ppc64 on Leopardshared-mime-info fails to build for ppc64 on Leopard: need to add muniversal PortGroup
Version: 2.7.12.7.2

comment:6 Changed 2 years ago by kencu (Ken)

well done -- that does look like a correct fix, indeed.

comment:7 Changed 2 years ago by RJVB (René Bertin)

LGTM.

EDIT: I see my own copy has gotten quite a bit behind, and only contains the executable to update the database. If that's still the case in newer versions I'm not sure what the point is to build this port with +universal?

Last edited 2 years ago by RJVB (René Bertin) (previous) (diff)

comment:8 in reply to:  7 Changed 2 years ago by barracuda156

Replying to RJVB:

LGTM.

EDIT: I see my own copy has gotten quite a bit behind, and only contains the executable to update the database. If that's still the case in newer versions I'm not sure what the point is to build this port with +universal?

I am sorry, do you mean shared-mime-info? It is a dependency for libheif and few other ports, not an aim in itself. I guess adding muniversal won’t hurt? At least conditionally, like “if variant is set universal”?

comment:9 Changed 2 years ago by RJVB (René Bertin)

Yes, I meant the port under discussion, shared-mime-info. A port that is a dependency of others doesn't *have* to have a +universal variant to allow the dependent to install in universal build. In a sense it's actually better if it doesn't have the variant, to limit unnecessary propagation of universal installs (which take place and usually increase upgrade times).

comment:10 in reply to:  9 Changed 2 years ago by barracuda156

Replying to RJVB:

Yes, I meant the port under discussion, shared-mime-info. A port that is a dependency of others doesn't *have* to have a +universal variant to allow the dependent to install in universal build. In a sense it's actually better if it doesn't have the variant, to limit unnecessary propagation of universal installs (which take place and usually increase upgrade times).

Honestly I do not know if in this case +universal matters for dependencies. You are right, in some case it does not, however certainly not in every such case.

comment:11 Changed 2 years ago by RJVB (René Bertin)

A priori, +universal is only required in a dependency if it contains a shared library, plugin or anything else that is supported by Apple's fat binary architecture and that has to contain the correct architecture(s) in order to be used by the dependent, or if they have to be able to produce such components for the dependent.

I'll have to upgrade my own version of the port to affirm whether it now contains components that require universal support. It shouldn't if it still only contains the standard mime info files (text) plus a helper to compiles a cache from those files plus whatever others are installed.

Caveat emptor: the mime.cache file is a binary, identified as "PFM data" by my file command. I don't know what that is and it *might* not be cross-platform. This could be a problem if you're running 32 and 64 bit applications simultaneously, and there'd be very little we'd be able to do about that. But I think we'd know that by now...

comment:12 in reply to:  11 Changed 2 years ago by RJVB (René Bertin)

Replying to RJVB:

This could be a problem if you're running 32 and 64 bit applications simultaneously, and there'd be very little we'd be able to do about that. But I think we'd know that by now...

I just upgraded my copy to v2.2 and can confirm that

  • there's still only a helper application in this port, no shared libraries for working with the mime files
  • building +universal with the muniversal PG works on Intel too
  • running the i386 (32b) version or the x86_64 (64b) version of update-mime-database leads to bit-identical $prefix/share/mime/mime.cache files. Sadly I cannot verify if the file is also endian-agnostic (but are there any users installing arm+intel fat binaries?!)

comment:13 in reply to:  4 Changed 2 years ago by barracuda156

Replying to barracuda156:

Replying to kencu:

read through the meson source code. It’s written in python, so easy enough. Find some part where it is examing the architecture of dependent libraries. Fix it to not error with the ppc7400 issue. Possibly submit the fix upstream.

I have fixed meson:

--- mesonbuild/mesonlib/universal.py.orig	2022-03-15 17:29:03.000000000 +0800
+++ mesonbuild/mesonlib/universal.py	2022-04-06 06:59:05.000000000 +0800
@@ -710,6 +710,8 @@
     # Convert from lipo-style archs to meson-style CPUs
     stdo = stdo.replace('i386', 'x86')
     stdo = stdo.replace('arm64', 'aarch64')
+    stdo = stdo.replace('ppc7400', 'ppc')
+    stdo = stdo.replace('ppc970', 'ppc64')
     # Add generic name for armv7 and armv7s
     if 'armv7' in stdo:
         stdo += ' arm'

  1. S. Added ppc970 just in case, may be redundant.

Ok it seems ppc970 is a valid case too, so having it makes sense. Example: https://groups.google.com/g/hugin-ptx/c/uWSPhl1MjCc

comment:14 in reply to:  6 Changed 2 years ago by barracuda156

Replying to kencu:

well done -- that does look like a correct fix, indeed.

My PR got merged into upstream: https://github.com/mesonbuild/meson/pull/10258 We will need to move to meson 0.62.1 though once it is out.

  1. S. Turned out ppc970 is still ppc32, just optimized for 970: https://opensource.apple.com/source/cctools/cctools-836/cctools-836/libmacho/arch.c
Note: See TracTickets for help on using tickets.