Opened 2 years ago

Closed 2 years ago

#65943 closed defect (duplicate)

Building libgcc12 failure under Monterey Intel

Reported by: cgilles (HumanDynamo) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: monterey Cc:
Port: libgcc12

Description

Target : macbook pro 2015 Intel with MacOS Monterey 12.5.1 and xcode 14.0.1

Building a fresh macport env for digiKam fail at libgcc12:

--->  Scanning binaries for linking errors
--->  No broken files found.
--->  No broken ports found.
--->  Computing dependencies for qt5-qtwebengine
--->  Dependencies to be installed: pulseaudio fftw-3-single fftw-3 gcc12 libgcc libgcc12 intltool gnome-common p5.34-pathtools p5.34-xml-parser p5.34-libwww-perl p5.34-data-dump p5.34-file-listing p5.34-html-form p5.34-http-cookies p5.34-http-daemon p5.34-http-tiny p5.34-http-cookiejar p5.34-test-requires p5.34-module-build-tiny p5.34-extutils-config p5.34-extutils-helpers p5.34-extutils-install p5.34-extutils-installpaths p5.34-test-harness p5.34-http-negotiate p5.34-net-http p5.34-test-leaktrace p5.34-test-requiresinternet p5.34-www-robotrules libsndfile flac orc xorg-libXtst xorg-libXi xorg-libXfixes py27-ply py27-setuptools qt5-qtlocation qt5-qtquickcontrols2 qt5-qtserialport qt5-qtwebchannel qt5-qtwebsockets qt5-qtwebengine-gn re2 snappy
Warning: The macOS 10.13 SDK does not appear to be installed. Ports may not build correctly.
Warning: You can install it as part of the Xcode Command Line Tools package by running `xcode-select --install'.
--->  Fetching distfiles for libgcc12
--->  Verifying checksums for libgcc12
--->  Extracting libgcc12
--->  Applying patches to libgcc12
--->  Configuring libgcc12
--->  Building libgcc12
Error: Failed to build libgcc12: command execution failed
Error: See /opt/digikam.org.x86_64/var/macports/logs/_opt_digikam.org.x86_64_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port qt5-qtwebengine failed
FAILED COMMAND: port install qt5-qtwebengine

Attachments (1)

main.log.zip (1.6 MB) - added by cgilles (HumanDynamo) 2 years ago.

Download all attachments as: .zip

Change History (4)

Changed 2 years ago by cgilles (HumanDynamo)

Attachment: main.log.zip added

comment:1 Changed 2 years ago by cgilles (HumanDynamo)

compilation log attached.

It's a duplicates of bug #65573 ?

Q: why libgcc12 is used to compile Qt5-QtMultimedia, where i'm sure than libgcc11 (gcc11 in fact) will be enough ?

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

Replying to cgilles:

Warning: The macOS 10.13 SDK does not appear to be installed. Ports may not build correctly.

Let's take note of the fact that you've configured MacPorts to build using the macOS 10.13 SDK and 10.13 deployment target while on macOS 12, which is an unusual configuration that probably nobody else has tested so who knows what will happen. Also, you don't actually have the 10.13 SDK. Nevertheless:

Replying to cgilles:

It's a duplicates of bug #65573 ?

Yes, the backtrace in your log does look the same as the one in that ticket.

:info:build 0  0x10bcd2ffa  __assert_rtn + 139
:info:build 1  0x10bb0628d  mach_o::relocatable::Parser<x86_64>::parse(mach_o::relocatable::ParserOptions const&) + 4989
:info:build 2  0x10baf6f8f  mach_o::relocatable::Parser<x86_64>::parse(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, mach_o::relocatable::ParserOptions const&) + 207
:info:build 3  0x10bb6d9d4  ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool) + 2036
:info:build 4  0x10bb70fa0  ___ZN2ld4tool10InputFilesC2ER7Options_block_invoke + 48
:info:build 5  0x7ff80adb934a  _dispatch_client_callout2 + 8
:info:build 6  0x7ff80adca8f5  _dispatch_apply_invoke + 213
:info:build 7  0x7ff80adb9317  _dispatch_client_callout + 8
:info:build 8  0x7ff80adc8c0c  _dispatch_root_queue_drain + 673
:info:build 9  0x7ff80adc925c  _dispatch_worker_thread2 + 160
:info:build 10  0x7ff80af6cf8a  _pthread_wqthread + 256
:info:build A linker snapshot was created at:
:info:build 	/tmp/libstdc++.6.dylib-2022-10-06-190604.ld-snapshot
:info:build ld: Assertion failed: (_file->_atomsArrayCount == computedAtomCount && "more atoms allocated than expected"), function parse, file macho_relocatable_file.cpp, line 2061.
:info:build collect2: error: ld returned 1 exit status

Q: why libgcc12 is used to compile Qt5-QtMultimedia, where i'm sure than libgcc11 (gcc11 in fact) will be enough ?

Your transcript showed that you were installing qt5-qtwebengine, not qt5-qtmultimedia.

The qt5 ports do not use gcc to compile themselves, however qt5-qtwebengine depends on pulseaudio which depends on fftw-3-single which depends on fftw-3, and apparently parts of fftw-3-single and fftw-3 are written in Fortran, and Xcode doesn't include a Fortran compiler so one from MacPorts must be used.

The fftw-3 ports by default enable their +gfortran variant which causes them to compile their Fortran parts using the Fortran compiler provided by the gcc12 port. This variant is provided by the compilers portgroup, which the fftw-3 ports include. The compilers portgroup uses the latest stable gcc version for the +gfortran variant. It used to use gcc11; it was changed to use gcc12 in [988d57cdae4d40714bd50041baf90a83708a2c56/macports-ports].

The fftw-3 port has variants you can use to select different compilers. You can see the full list of variants by running:

port variants fftw-3

For example you could use the +g95 variant to compile its Fortran parts using the g95 Fortran compiler:

sudo port clean fftw-3 fftw-3-single
sudo port install fftw-3 +g95
sudo port install fftw-3-single +g95

-- or you could, were it not for the fact that the g95 port is not compatible with Xcode 9 or later.

If you don't need the Fortran parts of fftw-3 and fftw-3-single, you could tell the ports to omit them:

sudo port clean fftw-3 fftw-3-single
sudo port install fftw-3 -gfortran
sudo port install fftw-3-single -gfortran

There are other compiler variants, however while the +gfortran and +g95 variants only affects the compiler used for the Fortran parts, the other variants affect the compiler used for all parts, which may be undesirable. For example, if the fftw-3 ports contain C++ code, compiling them with gcc would be bad because it would use a different C++ standard library than the rest of MacPorts. But as far as I can tell, the fftw-3 ports don't contain any C++ code, at least none that gets installed, so it may be ok to tell them to build with gcc11, if you wish:

sudo port clean fftw-3 fftw-3-single
sudo port install fftw-3 +gcc11
sudo port install fftw-3-single +gcc11

Another option could be to tell pulseaudio not to include its fftw-3 support. By looking at port variants pulseaudio and port deps pulseaudio +minimal you can see that the +minimal variant excludes fftw-3 support. However, that variant's description says "Do not use if unsure" so you may want to avoid it. Other ports that depend on pulseaudio may assume that it has its normal set of dependencies.

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

Keywords: monterey added
Resolution: duplicate
Status: newclosed

#65573 says the problem is Xcode 14, so you could downgrade to Xcode 13.x if you want to use gcc12.

comment:ticket:65573:17 says the problem will be solved in Xcode 14.1. A release candidate of Xcode 14.1 is available; you could install that.

Note: See TracTickets for help on using tickets.