[MacPorts] #70341: g++ fails to compile when -libstd=libc++ is set

MacPorts noreply at macports.org
Thu Jul 18 18:24:10 UTC 2024


#70341: g++ fails to compile when -libstd=libc++ is set
--------------------------------+--------------------
  Reporter:  mouse07410         |      Owner:  (none)
      Type:  defect             |     Status:  new
  Priority:  Normal             |  Milestone:
 Component:  ports              |    Version:
Resolution:                     |   Keywords:
      Port:  gcc12 gcc13 gcc14  |
--------------------------------+--------------------

Comment (by mouse07410):

 In general, I do constrain myself to building with Clang only. Usually
 Xcode Clang, occasionally with Macports Clang. Xcode GCC has been nothing
 for a long time, so I don't even check it now to see if it improved at
 all.

 Thus, most if not all of the C++ libraries on my systems are libc++
 compatible, not stdc++. So, for those thankfully rare cases that I need to
 use GCC, it greatly improves usability and usefulness if it can produce
 libc++ compatible binaries.

 Regarding Xcode having nothing to do with our libc++ support, here's what
 the upstream got to say:

 The libc++ headers include some of the SDK headers. When updating XCode
 you get new (more recent) SDK headers, which should (apparently) now
 include declarations for quick_exit and friends.

 Re. inconsistencies - so far, after applying the relevant patches to the
 header files, it's more or less smooth. Except for one weird problem ;-0
 that I'm having linking Crypto++ library:
 {{{
 Undefined symbols for architecture x86_64:
   "___cxa_call_terminate", referenced from:
       CryptoPP::LazyPutter::~LazyPutter() in asn.o
       CryptoPP::LazyPutter::~LazyPutter() in asn.o
       CryptoPP::DERSequenceEncoder::~DERSequenceEncoder() in asn.o
       non-virtual thunk to
 CryptoPP::DERSequenceEncoder::~DERSequenceEncoder() in asn.o
       CryptoPP::DERSequenceEncoder::~DERSequenceEncoder() in asn.o
       non-virtual thunk to
 CryptoPP::DERSequenceEncoder::~DERSequenceEncoder() in asn.o
       CryptoPP::BERSequenceDecoder::~BERSequenceDecoder() in asn.o
       ...
 ld: symbol(s) not found for architecture x86_64
 collect2: error: ld returned 1 exit status
 }}}

 If you happen to have any clues - I'd appreciate you sharing them.

 Re. changing default: I'd much appreciate if you keep support for libc++
 enabled by default. It doesn't hurt those who don't use it, and those who
 do,
 may find solution in the tickets like this one.

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


More information about the macports-tickets mailing list