Opened 3 months ago

Closed 3 months ago

#61591 closed defect (fixed)

py27-gobject @2.28.7. Build fails on Big Sur: Undefined symbols for architecture x86_64: "_PyCObject_AsVoidPtr" and others

Reported by: kencu (Ken) Owned by: kencu (Ken)
Priority: Normal Milestone:
Component: ports Version:
Keywords: bigsur Cc: jmroot (Joshua Root)
Port: py-gobject

Description (last modified by kencu (Ken))

I believe the same issue affects all python supports of py-gobject:

1 warning generated.
  CCLD   libpyglib-2.0-python2.7.la
1 warning generated.
1 warning generated.
Undefined symbols for architecture x86_64:
  "_PyCObject_AsVoidPtr", referenced from:
      _pyglib_init in libpyglib_2_0_python2.7_la-pyglib.o
      _pyglib_init_internal in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyCObject_Type", referenced from:
      _pyglib_init in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyDict_GetItem", referenced from:
      _pyglib_error_check in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyDict_New", referenced from:
      _pyglib_register_exception_for_domain in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyDict_SetItem", referenced from:
      _pyglib_register_exception_for_domain in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyErr_Fetch", referenced from:
      _pyglib_init in libpyglib_2_0_python2.7_la-pyglib.o
      _pyglib_gerror_exception_check in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyErr_Format", referenced from:
      _pyglib_init in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyErr_GivenExceptionMatches", referenced from:
      _pyglib_gerror_exception_check in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyErr_NewException", referenced from:
      _pyglib_register_exception_for_domain in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyErr_NormalizeException", referenced from:
      _pyglib_gerror_exception_check in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyErr_Occurred", referenced from:
      _pyglib_init in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyErr_Print", referenced from:
      _pyglib_gerror_exception_check in libpyglib_2_0_python2.7_la-pyglib.o
      __pyglib_handler_marshal in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyErr_Restore", referenced from:
      _pyglib_gerror_exception_check in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyErr_SetObject", referenced from:
      _pyglib_error_check in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyErr_SetString", referenced from:
      _pyglib_init in libpyglib_2_0_python2.7_la-pyglib.o
      _pyglib_gerror_exception_check in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyEval_InitThreads", referenced from:
      _pyglib_enable_threads in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyExc_ImportError", referenced from:
      _pyglib_init in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyExc_ValueError", referenced from:
      _pyglib_gerror_exception_check in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyFloat_FromDouble", referenced from:
      _pyglib_float_from_timeval in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyGILState_Ensure", referenced from:
      _pyglib_gil_state_ensure in libpyglib_2_0_python2.7_la-pyglib.o
      _pyglib_gil_state_ensure_py23 in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyGILState_Release", referenced from:
      _pyglib_gil_state_release in libpyglib_2_0_python2.7_la-pyglib.o
      _pyglib_gil_state_release_py23 in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyImport_ImportModule", referenced from:
      _pyglib_init in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyInt_AsLong", referenced from:
      _pyglib_gerror_exception_check in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyInt_FromLong", referenced from:
      _pyglib_error_check in libpyglib_2_0_python2.7_la-pyglib.o
      _pyglib_register_exception_for_domain in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyObject_CallObject", referenced from:
      __pyglib_handler_marshal in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyObject_GetAttrString", referenced from:
      _pyglib_init in libpyglib_2_0_python2.7_la-pyglib.o
      _pyglib_gerror_exception_check in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyObject_IsTrue", referenced from:
      __pyglib_handler_marshal in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyObject_Repr", referenced from:
      _pyglib_init in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyObject_SetAttrString", referenced from:
      _pyglib_error_check in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyString_AsString", referenced from:
      _pyglib_init in libpyglib_2_0_python2.7_la-pyglib.o
      _pyglib_gerror_exception_check in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyString_FromString", referenced from:
      _pyglib_error_check in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyThread_create_key", referenced from:
      _pyglib_enable_threads in libpyglib_2_0_python2.7_la-pyglib.o
  "_PyTuple_GetItem", referenced from:
      __pyglib_handler_marshal in libpyglib_2_0_python2.7_la-pyglib.o
  "__PyObject_CallFunction_SizeT", referenced from:
      _pyglib_error_check in libpyglib_2_0_python2.7_la-pyglib.o
  "__Py_NoneStruct", referenced from:
      _pyglib_error_check in libpyglib_2_0_python2.7_la-pyglib.o
  "__Py_NotImplementedStruct", referenced from:
      __pyglib_generic_ptr_richcompare in libpyglib_2_0_python2.7_la-pyglib.o
      __pyglib_generic_long_richcompare in libpyglib_2_0_python2.7_la-pyglib.o
  "__Py_TrueStruct", referenced from:
      __pyglib_generic_ptr_richcompare in libpyglib_2_0_python2.7_la-pyglib.o
      __pyglib_generic_long_richcompare in libpyglib_2_0_python2.7_la-pyglib.o
  "__Py_ZeroStruct", referenced from:
      __pyglib_generic_ptr_richcompare in libpyglib_2_0_python2.7_la-pyglib.o
      __pyglib_generic_long_richcompare in libpyglib_2_0_python2.7_la-pyglib.o
ld: symbol(s) not found for architecture x86_64

Attachments (3)

py27-gobject-bigsur-fail.log (110.7 KB) - added by kencu (Ken) 3 months ago.
py38-gobject-bigsur-fail.log (116.1 KB) - added by kencu (Ken) 3 months ago.
python38-test-run-bigsur.log (2.2 MB) - added by kencu (Ken) 3 months ago.

Change History (20)

Changed 3 months ago by kencu (Ken)

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

this python 2.7 port is on the build path for gimp2, and gimp2 is an in-demand port.

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

py38-gobject fails identically. log attached.

Changed 3 months ago by kencu (Ken)

comment:3 Changed 3 months ago by kencu (Ken)

Port: py38-gobject added

comment:4 Changed 3 months ago by kencu (Ken)

I think these missing symbols are supposed to be found in python itself, so this issue might actually be with the python builds

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

I am not certain, but this issue sounds like it could be with the cpython section of python, and there is a lot of work going on there.

See <https://github.com/python/cpython/commit/41761933c1c30bb6003b65eef1ba23a83db4eae4>

See <https://bugs.python.org/issue41100>

comment:6 Changed 3 months ago by kencu (Ken)

Description: modified (diff)

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

running the test suite for python38 now on Big Sur.

comment:8 Changed 3 months ago by kencu (Ken)

I don't immediately see an issue with cobject running the test suite, but there are many test suite errors with python38 on Big Sur. Log attached.

Changed 3 months ago by kencu (Ken)

comment:9 Changed 3 months ago by kencu (Ken)

Cc: jmroot added

comment:10 Changed 3 months ago by kencu (Ken)

Josh, copying you in here as this looks to me to be a problem with python rather than py-gobject. Thoughts?

comment:11 Changed 3 months ago by mf2k (Frank Schima)

Port: py27-gobject py38-gobject removed

comment:12 Changed 3 months ago by kencu (Ken)

only thing with that, Frank, is that if someone types "py27-gobject" into the port search for tickets box, now they don't find this ticket...

<https://ports.macports.org/port/py27-gobject/tickets>

now you could say that py-gobject should automatically register all the python subports of it in the various places, but -- it doesn't.

Last edited 3 months ago by kencu (Ken) (previous) (diff)

comment:13 Changed 3 months ago by mf2k (Frank Schima)

It's how we have always done python ports. Normally python issues affect all python versions.

comment:14 Changed 3 months ago by mf2k (Frank Schima)

In other words, if one is looking for py27-gobject issues, they should search for py-gobject. That probably is not documented anywhere however.

comment:15 Changed 3 months ago by kencu (Ken)

It looks like the only difference between the link that fails on Big Sur and the link that succeeds on Mojave is:

-Wl,-undefined -Wl,dynamic_lookup

which I believe is that same libtool bug that every other libtool port has been having.

mojave:
/usr/bin/clang -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o .libs/libpyglib-2.0-python2.7.0.dylib  .libs/libpyglib_2_0_python2.7_la-pyglib.o   -L/opt/local/lib -lgobject-2.0 -lgthread-2.0 -lglib-2.0 -lintl -lffi  -Os -arch x86_64 -Wl,-headerpad_max_install_names -Wl,-syslibroot -Wl,/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -arch x86_64 -Wl,-framework -Wl,CoreFoundation   -install_name  /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/libpyglib-2.0-python2.7.0.dylib -compatibility_version 1 -current_version 1.0 -Wl,-single_module
big sur:
/usr/bin/clang -dynamiclib                                   -o .libs/libpyglib-2.0-python2.7.0.dylib  .libs/libpyglib_2_0_python2.7_la-pyglib.o   -L/opt/local/lib -lgobject-2.0 -lgthread-2.0 -lglib-2.0 -lintl -lffi  -Os -arch x86_64 -Wl,-headerpad_max_install_names -Wl,-syslibroot -Wl,/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk -arch x86_64 -Wl,-framework -Wl,CoreFoundation   -install_name  /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/libpyglib-2.0-python2.7.0.dylib -compatibility_version 1 -current_version 1.0 -Wl,-single_module
Last edited 3 months ago by kencu (Ken) (previous) (diff)

comment:16 Changed 3 months ago by kencu (Ken)

Yep, that has it:

% port -v installed py27-gobject
The following ports are currently installed:
  py27-gobject @2.28.7_1+x11 (active) platform='darwin 20' archs='x86_64' date='2020-11-21T15:16:10-0800'

comment:17 Changed 3 months ago by kencu (Ken)

Owner: set to kencu
Resolution: fixed
Status: newclosed

In f2975d5bbbc2459c661905c5a850cc661fa32f55/macports-ports (master):

py-gobject: fix libtool's macOS 11+ bug

closes: #61591

Note: See TracTickets for help on using tickets.