PSA: Chrome is moving to libc++

291 views
Skip to first unread message

Manoj Gupta

unread,
Oct 20, 2017, 2:54:24 PM10/20/17
to Chromium OS dev
Hi,

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
crosbug.com (use label "Build-Toolchain"), or email chromeos-toolchain@google.com.

Thanks,
Manoj Gupta
(ChromeOS toolchain)

Manoj Gupta

unread,
Oct 25, 2017, 2:10:42 PM10/25/17
to Chromium OS dev
The migration to libc++ has been done. Chrome/ChromeOS version starting from chromeos-chrome-64.0.3249.0 are built with libc++.

Please report any issues at crosbug.com (use label "Build-Toolchain"), or email chromeos-toolchain@google.com.

Thanks,
Manoj
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages