Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1126)

Issue 2409173004: android: Make 64-bit chromes compile with clang. (Closed)

Created:
4 years, 2 months ago by Nico
Modified:
4 years, 2 months ago
CC:
chromium-reviews, hans, jbudorick
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

android: 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -2 lines) Patch
M build/config/android/BUILD.gn View 2 chunks +15 lines, -2 lines 0 comments Download
M build/config/android/config.gni View 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (12 generated)
Nico
4 years, 2 months ago (2016-10-11 21:58:43 UTC) #3
hans
lgtm but maybe you want someone with more Android skills to sign off
4 years, 2 months ago (2016-10-12 07:12:19 UTC) #12
Nico
On 2016/10/12 07:12:19, hans wrote: > lgtm but maybe you want someone with more Android ...
4 years, 2 months ago (2016-10-12 10:47:41 UTC) #13
Primiano Tucci (use gerrit)
Ok I investigated a bit and it seems that your assumption "64-bit targets build with ...
4 years, 2 months ago (2016-10-12 12:13:32 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2409173004/1
4 years, 2 months ago (2016-10-12 13:33:32 UTC) #16
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 2 months ago (2016-10-12 13:39:09 UTC) #17
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/3ae9e5b283ea81dc1605f70970828064deacba2a Cr-Commit-Position: refs/heads/master@{#424729}
4 years, 2 months ago (2016-10-12 13:40:51 UTC) #19
agrieve
On 2016/10/12 12:13:32, Primiano Tucci wrote: > Ok I investigated a bit and it seems ...
4 years, 2 months ago (2016-10-12 13:52:26 UTC) #20
Primiano Tucci (use gerrit)
4 years, 2 months ago (2016-10-12 14:41:19 UTC) #21
Message was sent while issue was closed.
On 2016/10/12 13:52:26, agrieve wrote:
> I believe the rationale for this is that no 64-bit devices exist that don't
run
android 21 or above.
Correct. 64 bit was introduced in L.

> We could have ChromeModern target 21+ as well, but don't want to pay the cost
of having to compile the .so twice (unless the wins are worth it)
I am extremely happy about having to think only about one .so thanks :-)
They (chrome vs modern) are already not identical because we still build both
independently (from the same source) and our build not being fully reproducible,
but this is another story. I can guarantee this itself already causes me lot of
headaches on crash reports.

Powered by Google App Engine
This is Rietveld 408576698