Opened 6 months ago

Closed 6 months ago

#69638 closed defect (fixed)

libSDL2pp does not build on 10.7–10.12: Undefined symbols for architecture x86_64: "std::bad_optional_access::~bad_optional_access()" etc.

Reported by: barracuda156 Owned by: barracuda156
Priority: Normal Milestone:
Component: ports Version: 2.9.1
Keywords: sierra, elcapitan, yosemite, mavericks, mountainlion, lion Cc:
Port: libSDL2pp

Description

[ 83%] Building CXX object tests/CMakeFiles/test_rwops.dir/test_rwops.cc.o
cd /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_libSDL2pp/libSDL2pp/work/build/tests && /opt/local/bin/clang++-mp-16 -DTESTDATA_DIR=\"/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_libSDL2pp/libSDL2pp/work/libSDL2pp-0.18.1/testdata\" -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_libSDL2pp/libSDL2pp/work/libSDL2pp-0.18.1 -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_libSDL2pp/libSDL2pp/work/build -isystem /opt/local/include/SDL2 -pipe -Os -DNDEBUG -I/opt/local/include -stdlib=libc++  -std=c++17 -arch x86_64 -mmacosx-version-min=10.12 -MD -MT tests/CMakeFiles/test_rwops.dir/test_rwops.cc.o -MF CMakeFiles/test_rwops.dir/test_rwops.cc.o.d -o CMakeFiles/test_rwops.dir/test_rwops.cc.o -c /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_libSDL2pp/libSDL2pp/work/libSDL2pp-0.18.1/tests/test_rwops.cc
Undefined symbols for architecture x86_64:
  "std::bad_optional_access::~bad_optional_access()", referenced from:
      __ZNSt3__127__throw_bad_optional_accessB7v160006Ev in test_optional.cc.o
  "typeinfo for std::bad_optional_access", referenced from:
      __ZNSt3__127__throw_bad_optional_accessB7v160006Ev in test_optional.cc.o
      GCC_except_table34 in test_optional.cc.o
  "vtable for std::bad_optional_access", referenced from:
      __ZNSt3__127__throw_bad_optional_accessB7v160006Ev in test_optional.cc.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

https://build.macports.org/builders/ports-10.12_x86_64-builder/builds/266241/steps/install-port/logs/stdio

Change History (5)

comment:1 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)

Yup:

bad_optional_access and bad_any_cast, and methods that throw them: optional::value and any_cast require macOS 10.13, iOS 12.0, tvOS 12.0, watchOS 5.0

comment:2 in reply to:  1 Changed 6 months ago by barracuda156

Replying to ryandesign:

Yup:

bad_optional_access and bad_any_cast, and methods that throw them: optional::value and any_cast require macOS 10.13, iOS 12.0, tvOS 12.0, watchOS 5.0

Do we have a solution for Clang-using systems? The port builds fine on 10.6 with GCC and passes tests, FWIW.

comment:3 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)

The missing functionality is undoubtedly part of libc++, which is why it doesn't affect gcc-using systems since they don't use libc++, nor 10.6 since it uses a newer MacPorts libc++ already. The solution is presumably to use legacysupport.use_mp_libcxx yes, assuming that works and does not cause any problems due to mixing of standard library versions.

comment:4 in reply to:  3 Changed 6 months ago by barracuda156

Replying to ryandesign:

The missing functionality is undoubtedly part of libc++, which is why it doesn't affect gcc-using systems since they don't use libc++, nor 10.6 since it uses a newer MacPorts libc++ already. The solution is presumably to use legacysupport.use_mp_libcxx yes, assuming that works and does not cause any problems due to mixing of standard library versions.

Thank you, I can try that locally, since I have 10.8 in a VM.

comment:5 Changed 6 months ago by barracuda156

Resolution: fixed
Status: assignedclosed

In cb6951a73c38783314d242f1c7599c22ca66552c/macports-ports (master):

libSDL2pp: fix build on 10.7–10.12

Closes: #69638

Note: See TracTickets for help on using tickets.