Different name mangling in C++

276 Views Asked by At

I am trying to compile my project against latest V8 and mangling error occures.

/usr/bin/cmake -E cmake_link_script CMakeFiles/tea.dir/link.txt --verbose=1
/home/vahvarh/try_teajs/v8_things/v8/third_party/llvm-build/Release+Asserts/bin/clang++   -std=c++17 -fPIC -ggdb -Wno-unused-result -pthread CMakeFiles/tea.dir/src/common.cc.o CMakeFiles/tea.dir/src/system.cc.o CMakeFiles/tea.dir/src/cache.cc.o CMakeFiles/tea.dir/src/gc.cc.o CMakeFiles/tea.dir/src/app.cc.o CMakeFiles/tea.dir/src/path.cc.o CMakeFiles/tea.dir/src/lib/binary/bytestorage.cc.o CMakeFiles/tea.dir/src/teajs.cc.o -o tea   -L/home/vahvarh/try_teajs/v8_things/v8/out/x64.debug  -Wl,-rpath,/home/vahvarh/try_teajs/v8_things/v8/out/x64.debug:/home/vahvarh/try_teajs/teajs/build liblibtea.so -lpthread -ldl -lfcgi -lv8 -lv8_libplatform 
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
CMakeFiles/tea.dir/src/app.cc.o: in function `TeaJS_App::init(int, char**)':
app.cc:(.text+0x3790): undefined reference to `v8::platform::NewDefaultPlatform(int, v8::platform::IdleTaskSupport, v8::platform::InProcessStackDumping, std::unique_ptr<v8::TracingController, std::default_delete<v8::TracingController> >)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [CMakeFiles/tea.dir/build.make:209: tea] Error 1
make[2]: Leaving directory '/home/vahvarh/try_teajs/teajs/build'
make[1]: *** [CMakeFiles/Makefile2:356: CMakeFiles/tea.dir/all] Error 2
make[1]: Leaving directory '/home/vahvarh/try_teajs/teajs/build'
make: *** [Makefile:103: all] Error 2

I tried getting name mangiling and they differ. I am at loss why and how this happens. Tried both debian-provided g++ and v8-provided clang++ with same result.

Below is the output of nm against app.cc.o (my file) and libv8_libplatform.so (v8 library)

vahvarh@dev:~/try_teajs/teajs$ nm build/CMakeFiles/tea.dir/src/app.cc.o | grep -i NewDefaultPlatform
                 U _ZN2v88platform18NewDefaultPlatformEiNS0_15IdleTaskSupportENS0_21InProcessStackDumpingESt10unique_ptrINS_17TracingControllerESt14default_deleteIS4_EE
vahvarh@dev:~/try_teajs/teajs$ nm /home/vahvarh/try_teajs/v8_things/v8/out/x64.debug/libv8_libplatform.so | grep -i NewDefaultPlatform
0000000000054c30 T _ZN2v88platform18NewDefaultPlatformEiNS0_15IdleTaskSupportENS0_21InProcessStackDumpingENSt4__Cr10unique_ptrINS_17TracingControllerENS3_14default_deleteIS5_EEEE
0

There are 0 best solutions below