Opened 3 years ago

Closed 2 years ago

Last modified 2 years ago

#65179 closed defect (invalid)

py-libxml2, py-Pillow, py-gdbm: need to either blacklist gcc-4* or patch out -Wno-unused-result

Reported by: barracuda156 Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: powerpc, leopard, snowleopard, rosetta Cc: mascguy (Christopher Nielsen)
Port: py-libxml2 py-Pillow

Description (last modified by barracuda156)

gcc-4.2 does not understand this flag, and the build fails.

creating build/temp.macosx-10.6-ppc-cpython-310
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-libxml2/py310-libxml2/work/compwrap/cc/usr/bin/gcc-4.2 -Wno-unused-result -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -pipe -Os -arch ppc -isysroot/ -D_REENTRANT=1 -I/opt/local/include/libxml2 -I/opt/local/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c libxml.c -o build/temp.macosx-10.6-ppc-cpython-310/libxml.o
cc1: error: unrecognized command line option "-Wno-unused-result"
error: command '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-libxml2/py310-libxml2/work/compwrap/cc/usr/bin/gcc-4.2' failed with exit code 1
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-libxml2/py310-libxml2/work/libxml2-2.9.14/python" && /opt/local/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10 setup.py --no-user-cfg build -j4 
Exit code: 1
Error: Failed to build py310-libxml2: command execution failed

Same for py-cython:

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-cython/py310-cython/work/compwrap/cc/usr/bin/gcc-4.2 -Wno-unused-result -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -pipe -Os -m64 -arch ppc -arch ppc64 -isysroot/ -I/opt/local/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-cython/py310-cython/work/Cython-0.29.29/Cython/Plex/Scanners.c -o build/temp.macosx-10.5-ppc64-cpython-310/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-cython/py310-cython/work/Cython-0.29.29/Cython/Plex/Scanners.o
cc1: error: unrecognized command line option "-Wno-unused-result"
cc1: error: unrecognized command line option "-Wno-unused-result"
fatal error: lipo: can't open input file: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-cython/py310-cython/work/.tmp/cc6ta5kY.out (No such file or directory)
error: command '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-cython/py310-cython/work/compwrap/cc/usr/bin/gcc-4.2' failed with exit code 1
* Getting dependencies for wheel...
* Building wheel...

ERROR Backend subproccess exited when trying to invoke build_wheel

Change History (12)

comment:1 Changed 3 years ago by barracuda156

It fails for x86_64 too:

creating build/lib.macosx-10.6-x86_64-cpython-310
copying libxml2.py -> build/lib.macosx-10.6-x86_64-cpython-310
copying drv_libxml2.py -> build/lib.macosx-10.6-x86_64-cpython-310
running build_ext
building 'libxml2mod' extension
creating build/temp.macosx-10.6-x86_64-cpython-310
/opt/x86_64/var/macports/build/_opt_x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-libxml2/py310-libxml2/work/compwrap/cc/usr/bin/gcc-4.2 -Wno-unused-result -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -pipe -Os -arch x86_64 -isysroot/ -D_REENTRANT=1 -I/opt/x86_64/include/libxml2 -I/opt/x86_64/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c libxml.c -o build/temp.macosx-10.6-x86_64-cpython-310/libxml.o
cc1: error: unrecognized command line option "-Wno-unused-result"
error: command '/opt/x86_64/var/macports/build/_opt_x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-libxml2/py310-libxml2/work/compwrap/cc/usr/bin/gcc-4.2' failed with exit code 1
Command failed:  cd "/opt/x86_64/var/macports/build/_opt_x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-libxml2/py310-libxml2/work/libxml2-2.9.14/python" && /opt/x86_64/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10 setup.py --no-user-cfg build -j4 
Exit code: 1
Error: Failed to build py310-libxml2: command execution failed
Error: See /opt/x86_64/var/macports/logs/_opt_x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-libxml2/py310-libxml2/main.log for details.

comment:2 Changed 3 years ago by barracuda156

Description: modified (diff)
Port: py39-cython py310-cython added
Summary: py-libxml2: need to either blacklist gcc-4* or patch out -Wno-unused-resultpy-libxml2, py-cython: need to either blacklist gcc-4* or patch out -Wno-unused-result

comment:3 Changed 3 years ago by barracuda156

Port: py39-Pillow py310-Pillow added

comment:4 Changed 3 years ago by barracuda156

Summary: py-libxml2, py-cython: need to either blacklist gcc-4* or patch out -Wno-unused-resultpy-libxml2, py-cython, py-Pillow: need to either blacklist gcc-4* or patch out -Wno-unused-result

comment:5 Changed 2 years ago by barracuda156

Port: py39-gdbm added
Summary: py-libxml2, py-cython, py-Pillow: need to either blacklist gcc-4* or patch out -Wno-unused-resultpy-libxml2, py-cython, py-Pillow, py-gdbm: need to either blacklist gcc-4* or patch out -Wno-unused-result

comment:6 Changed 2 years ago by reneeotten (Renee Otten)

Port: py-libxml2 py-Pillow added; py39-libxml2 py310-libxml2 py39-cython py310-cython py39-Pillow py310-Pillow py39-gdbm removed
Summary: py-libxml2, py-cython, py-Pillow, py-gdbm: need to either blacklist gcc-4* or patch out -Wno-unused-resultpy-libxml2, py-Pillow, py-gdbm: need to either blacklist gcc-4* or patch out -Wno-unused-result

py-cython has blacklisted old gcc version in this commit

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

is it somewhere in py-cython that where the flag Wno-unused-result originates? I have not as yet been able to see exactly where that flag gets thrown in, but it's some python build support port I guess.

blacklisting older compilers is one way around this, but TBH it is not really a great way around it, as that can then come back to bite you when you are no longer able to bootstrap any more.

Sometimes it's the only way out, though.

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

Replying to kencu:

is it somewhere in py-cython that where the flag Wno-unused-result originates? I have not as yet been able to see exactly where that flag gets thrown in, but it's some python build support port I guess.

blacklisting older compilers is one way around this, but TBH it is not really a great way around it, as that can then come back to bite you when you are no longer able to bootstrap any more.

Sometimes it's the only way out, though.

If it is thrown in by some build dependency, then patching it out should be easy enough. If not, then patching it out of every single port that uses it, I guess, is out of possibility, practically.

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

Replying to reneeotten:

py-cython has blacklisted old gcc version in this commit

The problem still exists for py-libxml2 and few other ports.

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

Cc: mascguy added

comment:11 in reply to:  7 Changed 2 years ago by jmroot (Joshua Root)

Resolution: invalid
Status: assignedclosed

Replying to kencu:

is it somewhere in py-cython that where the flag Wno-unused-result originates? I have not as yet been able to see exactly where that flag gets thrown in, but it's some python build support port I guess.

The mystery was solved via https://github.com/macports/macports-ports/pull/16064.

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

worth noting that the entire point of building python with a newer gcc, to get LTO on PPC, that led to this is flawed as there is no LTO for PPC code on Darwin.

ld64 doesn’t support gcc’s LTO according to Iain.

https://github.com/iains/darwin-toolchains-start-here/discussions/37#discussioncomment-3285847

Note: See TracTickets for help on using tickets.