Hello!
I'm building a Linux shared library that incorporates V8. This is working perfectly with the debug V8 monolith, but not at all with release. I've noticed that V8's release build produces an archive full of LLVM IR bitcode files instead of normal ELF objects.
V8 release build args:
enable_precompiled_headers=false
fatal_linker_warnings=false
is_component_build=false
is_debug=false
is_official_build=true
use_custom_libcxx=false
v8_enable_i18n_support=false
v8_enable_pointer_compression=false
v8_enable_31bit_smis_on_64bit_arch=false
v8_monolithic=true
v8_use_external_startup_data=false
chrome_pgo_phase=0
Link command line:
clang++ --shared --no-undefined -fvisibility=hidden $(OBJECTS) -lv8_monolith -lpthread
Error:
/usr/bin/ld: [...]/libv8_monolith.a: error adding symbols: file format not recognized
Assuming this has something to do with LTO, I tried "-flto=thin", but that just produced a different error:
Link command line:
clang++ --shared --no-undefined -fvisibility=hidden -flto=thin $(OBJECTS) -lv8_monolith -lpthread
Error:
/usr/bin/ld: error: LLVM gold plugin has failed to create LTO module: Invalid record
Does anyone know what I'm doing wrong? Thanks in advance!