The test case provided compiles successfully for me. I think that the failure is caused by an incorrectly built standard library.
I've attached a build script that I use internally to rebuild all standard libraries. Note that this script does not install the binaries and libraries to the path /opt/cheerp though. Can you check if your build commands are similar to that script?
My first guess would be to check if -DCMAKE_CXX_FLAGS="${CXXFLAGS} -nostdlib" is used for libcxx and -DCMAKE_CXX_FLAGS="${CXXFLAGS} -nostdlib -frtti" for libcxxabi.
The test case provided compiles successfully for me. I think that the failure is caused by an incorrectly built standard library.
I've attached a build script that I use internally to rebuild all standard libraries. Note that this script does not install the binaries and libraries to the path /opt/cheerp though. Can you check if your build commands are similar to that script?
My first guess would be to check if -DCMAKE_ CXX_FLAGS= "${CXXFLAGS} -nostdlib" is used for libcxx and -DCMAKE_ CXX_FLAGS= "${CXXFLAGS} -nostdlib -frtti" for libcxxabi.