Descriptionandroid: Make 64-bit chromes compile with clang.
Newer NDKs define snprintf() (and other functions) to a macro when using clang,
to implement a kind of _FORTIFY_SOURCE support. This means it's impossible to
declare your own base::snprintf(), like base/strings/string_util.h does. A
future NDK will have a better fortify story that doesn't depend on macros,
but for now build with -Dsnprintf=snprintf to tell the NDK that it shouldn't
define snprintf as a macro. This will disable fortify for snprintf.
This matters for 64-bit only because we use NDK 21 for 64-bit builds but
we use NDK 16 for 32-bit builds. NDK 16 never does any fortify stuff, so
while this CL does remove fortify checking for snprintf() (but not for any
other function), 64-bit binaries are still better-protected than 32-bit
binaries. (And ideally this situation is just temporary.)
With this, x64 and mips64el build fine with clang. With this and
https://codereview.chromium.org/2404193003/, arm64 builds fine with
clang. I verified that a clang-built arm64 Chromium starts up fine
on my Pixel XL and can navigate to a few websites.
BUG=539781
Committed: https://crrev.com/3ae9e5b283ea81dc1605f70970828064deacba2a
Cr-Commit-Position: refs/heads/master@{#424729}
Patch Set 1 #
Messages
Total messages: 21 (12 generated)
|