can't build simple app / linking error

Bug #1517618 reported by valexey
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cheerp
Invalid
Undecided
Unassigned

Bug Description

Dummy program:
===
void webMain() [[client]]
{
}
===

Cause this error: ERROR: Linking globals named '_ZTVSt9bad_alloc': symbol multiply defined!

More details:

 /opt/cheerp/bin/clang++ -O3 -target cheerp main.cpp -o main.bc -v
clang version 3.7.0 (https://github.com/leaningtech/cheerp-clang 77eca1ea55c8e2bba8732131697734cc4de60283) (https://github.com/leaningtech/cheerp-llvm 77fab8d5331f12b814f0aaf09d4e17f933f60401)
Target: cheerp--webbrowser
Thread model: posix
 "/opt/cheerp/bin/clang-3.7" -cc1 -triple cheerp--webbrowser -emit-llvm-bc -disable-free -disable-llvm-verifier -main-file-name main.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -no-integrated-as -mconstructor-aliases -v -dwarf-column-info -resource-dir /opt/cheerp/bin/../lib/clang/3.7.0 -c-isystem /home/valexey/Projects/cheerp/cheerp-libcxx/cheerp-libcxxabi/include -cxx-isystem /home/valexey/Projects/cheerp/cheerp-libcxx/include -internal-isystem /opt/cheerp/include/c++/v1 -internal-isystem /opt/cheerp/bin/../lib/clang/3.7.0/include -internal-externc-isystem /opt/cheerp/include -internal-externc-isystem /opt/cheerp/include/client -O3 -fdeprecated-macro -fno-dwarf-directory-asm -fdebug-compilation-dir /home/valexey/Projects/formula/c++ -ferror-limit 19 -fmessage-length 211 -mstackrealign -fno-rtti -fno-threadsafe-statics -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o /tmp/main-2b8fed.bc -x c++ main.cpp
clang -cc1 version 3.7.0 based upon LLVM 3.7.0svn default target x86_64-unknown-linux-gnu
#include "..." search starts here:
#include <...> search starts here:
 /home/valexey/Projects/cheerp/cheerp-libcxx/include
 /opt/cheerp/include/c++/v1
 /opt/cheerp/bin/../lib/clang/3.7.0/include
 /opt/cheerp/include
 /opt/cheerp/include/client
 /opt/cheerp/include/common
End of search list.
 "/opt/cheerp/bin/llvm-link" -o /tmp/main-f3743b.bc /tmp/main-2b8fed.bc /opt/cheerp/lib/libc.bc /opt/cheerp/lib/libm.bc /opt/cheerp/lib/libc++.bc /opt/cheerp/lib/libc++abi.bc
ERROR: Linking globals named '_ZTVSt9bad_alloc': symbol multiply defined!
clang-3.7: error: linker command failed with exit code 1 (use -v to see invocation)

Revision history for this message
Sander van Veen (sandervv+launchpad) wrote :

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.

Changed in cheerp:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.