[MacPorts] #65943: Building libgcc12 failure under Monterey Intel

MacPorts noreply at macports.org
Fri Oct 21 22:25:22 UTC 2022

#65943: Building libgcc12 failure under Monterey Intel
  Reporter:  cgilles   |      Owner:  (none)
      Type:  defect    |     Status:  new
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:
Resolution:            |   Keywords:
      Port:  libgcc12  |

Comment (by ryandesign):

 Replying to [ticket:65943 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.

 Replying to [comment:1 cgilles]:
 > It's a duplicates of bug #65573 ?

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

 :info:build 0  0x10bcd2ffa  __assert_rtn + 139
 :info:build 1  0x10bb0628d
 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

 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

 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.

Ticket URL: <https://trac.macports.org/ticket/65943#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS

More information about the macports-tickets mailing list