Detect an incomplete libsupc++ (GCC 16 references libstdc++ symbols) by linking the check with -z defs and a non-elidable new, else use libstdc++. --- libptytty-2.0.orig/CMakeLists.txt 2026-09-26 21:41:29.366215109 +0200 +++ libptytty-2.0/CMakeLists.txt 2026-09-26 21:41:29.377528241 +0200 @@ -46,11 +46,11 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GN " struct e { }; - void f () + e *f () { try { - new e (); + return new e (); } catch (...) { @@ -60,7 +60,7 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GN ") execute_process( WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp" - COMMAND ${CMAKE_C_COMPILER} -x c++ -shared -fPIC -o test.so test.cxx -lsupc++ + COMMAND ${CMAKE_C_COMPILER} -x c++ -shared -fPIC -Wl,-z,defs -o test.so test.cxx -lsupc++ OUTPUT_VARIABLE OUTPUT ERROR_VARIABLE OUTPUT RESULT_VARIABLE RESULT)