ChromeOS toolchain team plans to migrate Chrome on ChromeOS early next week to be built with LLVM’s
libc++ instead of GCC’s libstdc++ (
CL:717537).
This is a part of our plan to bring C++14 support to Chrome and will also enable security features including
CFI (Control-Flow Integrity) that we plan to deploy in future.
Important note [USER ACTION MAY BE REQUIRED!!]::
SimpleChrome developers may have to remove their old Out directories in case they run into linker errors as described below.
In addition, anyone relying on an incremental Chrome build in chroot may also have to clean the old Out directories.
Details:
Libc++ is NOT ABI compatible with libstdc++. Therefore, libstdc++/libc++ compiled objects may NOT be intermixed.
The linker will produce errors when such a situation happens.
For instance, when foo.o (compiled with libstdc++) using std::string and std::cout and main.o (compiled with libc++) are mixed,
Linker raises undefined reference errors:
main.o:main.cpp:function main: error: undefined reference to 'foo(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)' data.o:data.cpp:function foo(std::string&):
error: undefined reference to 'std::cout'
data.o:data.cpp:function foo(std::string&):
error: undefined reference to 'std::ostream::operator<<(std::ostream& (*)(std::ostream&))
If you discover any issues related to this migration, please report them at
Thanks,
Manoj Gupta
(ChromeOS toolchain)