New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 742655 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug

Blocked on:
issue 760838
issue 778087
issue 779185
issue 788475
issue 801373

Blocking:
issue 838413
issue 742525
issue 761307



Sign in to add a comment

Switch to lld on Android

Project Member Reported by p...@chromium.org, Jul 14 2017

Issue description

I was curious how close we were to being able to link the Android port with lld, so I did a quick build with these flags:

target_os = "android"
target_cpu = "arm"  # (default)
is_debug = false
is_official_build = true
is_chrome_branded = true
use_goma = true
enable_resource_whitelist_generation = false
use_lld = true

After fixing a couple of minor bugs I reached the link stage for libchrome.so, which gave me error messages like this:

ld.lld: error: ../../third_party/android_tools/ndk/sources/cxx-stl/llvm-libc++/libcxx/include/string:662: relocation R_ARM_THM_CALL out of range

which is pretty much what I expected (lack of support for range extension thunks, i.e. https://reviews.llvm.org/D34691). Probably worth taking another look once that (and presumably the three next patches) land.
 

Comment 1 by p...@chromium.org, Aug 31 2017

Blockedon: 760838

Comment 2 by p...@chromium.org, Aug 31 2017

I was able to get a little further by patching in D34689, D34691 and D34692.

With that and these two CLs:
https://chromium-review.googlesource.com/c/chromium/src/+/644555
https://chromium-review.googlesource.com/c/chromium/src/+/644908
I was able to produce a .apk that starts up and appears to be capable of loading web pages.
Project Member

Comment 3 by bugdroid1@chromium.org, Aug 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1e3ea3b50cf7e9ad4145bf9f388ad0ac4fec147c

commit 1e3ea3b50cf7e9ad4145bf9f388ad0ac4fec147c
Author: Peter Collingbourne <pcc@chromium.org>
Date: Thu Aug 31 03:53:26 2017

Android: Disable relocation packing under lld for now.

lld's output is currently incompatible with the relocation packer
tool. We will probably want to implement relocation packing in lld
itself eventually.

Bug:  742655 ,  760838 
Change-Id: I91d12e3d29c31d7509e1e34f980f6ceab2746b4d
Reviewed-on: https://chromium-review.googlesource.com/644555
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#498748}
[modify] https://crrev.com/1e3ea3b50cf7e9ad4145bf9f388ad0ac4fec147c/build/config/android/rules.gni

Project Member

Comment 4 by bugdroid1@chromium.org, Aug 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3621c6195f98034ebdc5c838f87416dc2cb0396a

commit 3621c6195f98034ebdc5c838f87416dc2cb0396a
Author: Peter Collingbourne <pcc@chromium.org>
Date: Thu Aug 31 18:44:52 2017

Android: Use eu-strip instead of binutils strip to strip executables and DSOs.

binutils strip has a bug which causes it to corrupt the relro program
header in files created by lld.

Also stop passing --strip-unneeded to the strip command because
eu-strip does not understand it, and because the flag has no effect
on executables and DSOs, only on object files, as explained here:
https://www.technovelty.org/linux/stripping-shared-libraries.html

Bug:  742655 
Change-Id: Ic8585837ee41f84bb6d64dc42703d4f5707f7d6b
Reviewed-on: https://chromium-review.googlesource.com/644908
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#498933}
[modify] https://crrev.com/3621c6195f98034ebdc5c838f87416dc2cb0396a/build/android/BUILD.gn
[modify] https://crrev.com/3621c6195f98034ebdc5c838f87416dc2cb0396a/build/toolchain/android/BUILD.gn
[modify] https://crrev.com/3621c6195f98034ebdc5c838f87416dc2cb0396a/build/toolchain/gcc_link_wrapper.py
[modify] https://crrev.com/3621c6195f98034ebdc5c838f87416dc2cb0396a/build/toolchain/gcc_solink_wrapper.py
[modify] https://crrev.com/3621c6195f98034ebdc5c838f87416dc2cb0396a/build/toolchain/gcc_toolchain.gni

Project Member

Comment 5 by bugdroid1@chromium.org, Sep 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/571076ecb1419e97e8396ba82a174c095c08ba75

commit 571076ecb1419e97e8396ba82a174c095c08ba75
Author: Michael Achenbach <machenbach@chromium.org>
Date: Mon Sep 25 09:52:23 2017

[build] Port "Add patched eu-strip in third_party"

This ports:
https://chromium-review.googlesource.com/c/544798/

This is needed to unblock rolling build into v8 at:
https://chromium-review.googlesource.com/c/v8/v8/+/657634

Bug:  chromium:593874 ,  chromium:742655 
Change-Id: Ie00f2d13cfd052881a84b6e0cb95c336b7d2581c
Reviewed-on: https://chromium-review.googlesource.com/680815
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Sergiy Byelozyorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48134}
[modify] https://crrev.com/571076ecb1419e97e8396ba82a174c095c08ba75/.gitignore
[add] https://crrev.com/571076ecb1419e97e8396ba82a174c095c08ba75/third_party/eu-strip/README.v8
[add] https://crrev.com/571076ecb1419e97e8396ba82a174c095c08ba75/third_party/eu-strip/bin/eu-strip

Cc: rahulchaudhry@chromium.org llozano@chromium.org srhines@google.com
Project Member

Comment 7 by bugdroid1@chromium.org, Oct 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/tools/build/+/b827b1556374ceccf81c892e9d2cd299cd3223b3

commit b827b1556374ceccf81c892e9d2cd299cd3223b3
Author: Peter Collingbourne <pcc@google.com>
Date: Tue Oct 17 17:45:36 2017

Add ToTAndroidCFI bot (build).

Bug:  742655 
Change-Id: Ib8280a7daa4757a07f651ec1ca83424578690cfa
Reviewed-on: https://chromium-review.googlesource.com/722169
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Peter Collingbourne <pcc@chromium.org>

[modify] https://crrev.com/b827b1556374ceccf81c892e9d2cd299cd3223b3/scripts/slave/recipe_modules/chromium_tests/chromium_clang.py
[modify] https://crrev.com/b827b1556374ceccf81c892e9d2cd299cd3223b3/masters/master.chromium.clang/builders.pyl

Project Member

Comment 8 by bugdroid1@chromium.org, Oct 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/def1f90a6cc0393760e1d2e99eed104776ecfe94

commit def1f90a6cc0393760e1d2e99eed104776ecfe94
Author: Peter Collingbourne <pcc@chromium.org>
Date: Tue Oct 17 17:56:19 2017

Add ToTAndroidCFI bot (src).

Start with a small number of test suites for now. The rest will need to
wait until the patches from the associated bug land.

Bug:  742655 
Change-Id: I42d0fb8301c9f4f8e61a90b17d645d10be649c34
Reviewed-on: https://chromium-review.googlesource.com/722170
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509428}
[modify] https://crrev.com/def1f90a6cc0393760e1d2e99eed104776ecfe94/testing/buildbot/chromium.clang.json
[modify] https://crrev.com/def1f90a6cc0393760e1d2e99eed104776ecfe94/tools/mb/mb_config.pyl

Blockedon: 778087
Project Member

Comment 10 by bugdroid1@chromium.org, Oct 26 2017

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/clank/internal/apps/+/b2c59a9b81bcac41149da8425ee10c9f95e4a905

commit b2c59a9b81bcac41149da8425ee10c9f95e4a905
Author: Andrew Grieve <agrieve@chromium.org>
Date: Thu Oct 26 15:09:09 2017

Blockedon: 779185
Project Member

Comment 12 by bugdroid1@chromium.org, Oct 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/tools/build/+/51b717ed1d3d26841fee4c360a6a2ccf4fa95915

commit 51b717ed1d3d26841fee4c360a6a2ccf4fa95915
Author: Peter Collingbourne <pcc@google.com>
Date: Fri Oct 27 22:52:52 2017

Revert "Skip the sizes step on ToTAndroidCFI for now." and "Enable add_tests_as_compile_targets on ToTAndroidCFI."

It should now be possible to link the browser and most other targets
with lld as a result of the range extension thunk patches landing.

This reverts commit e910f736030efbf2de26306a903f6d28524e23af
and 9584f34836224d8a48898d50072d9b57be35b52e.

Bug:  742655 
Change-Id: Ic61bfdd21d83b3b1a8f4b604480b90cd3d0f58b2
Reviewed-on: https://chromium-review.googlesource.com/742185
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Peter Collingbourne <pcc@chromium.org>

[modify] https://crrev.com/51b717ed1d3d26841fee4c360a6a2ccf4fa95915/scripts/slave/recipe_modules/chromium_tests/chromium_clang.py

Project Member

Comment 13 by bugdroid1@chromium.org, Oct 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/04768475aee45a41039be8d73984ba47d842ed89

commit 04768475aee45a41039be8d73984ba47d842ed89
Author: Peter Collingbourne <pcc@chromium.org>
Date: Sat Oct 28 01:20:44 2017

Add more tests to the Android CFI bot.

We should hopefully be able to build these now.

The list of tests was taken from "Android N5X Swarm Builder" on
chromium.android.

Bug: 469376,  742655 
Change-Id: I5d831654eef915ba2c78b890fba80c9ca3d87b31
Reviewed-on: https://chromium-review.googlesource.com/742384
Reviewed-by: John Budorick <jbudorick@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512365}
[modify] https://crrev.com/04768475aee45a41039be8d73984ba47d842ed89/testing/buildbot/chromium.clang.json

Cc: lizeb@chromium.org pasko@chromium.org
Labels: OS-Android
Owner: p...@chromium.org
Status: Assigned (was: Untriaged)
Blocking: 742525
Project Member

Comment 16 by bugdroid1@chromium.org, Nov 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/breakpad/breakpad/+/3bbf3fb0db6d751405b6fc30daba478445089e4d

commit 3bbf3fb0db6d751405b6fc30daba478445089e4d
Author: Peter Collingbourne <pcc@google.com>
Date: Tue Nov 07 14:56:36 2017

dump_symbols: Stop rejecting files with Android packed relocation sections.

The lld linker has native support for creating packed relocation
sections, and as a result we can expect files with these sections to
have symbols.

Bug:  chromium:742655 
Change-Id: I48a50bff041146f51b3a8b730d7a778f832787f6
Reviewed-on: https://chromium-review.googlesource.com/754239
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>

[modify] https://crrev.com/3bbf3fb0db6d751405b6fc30daba478445089e4d/src/common/linux/dump_symbols.cc

Project Member

Comment 17 by bugdroid1@chromium.org, Nov 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3b69f0114cfc34b201e8f735171aec59fad6ce78

commit 3b69f0114cfc34b201e8f735171aec59fad6ce78
Author: Peter Collingbourne <pcc@chromium.org>
Date: Tue Nov 07 18:34:41 2017

Roll src/third_party/breakpad/breakpad/ 5dad29423..3bbf3fb0d (3 commits)

https://chromium.googlesource.com/breakpad/breakpad.git/+log/5dad29423e62..3bbf3fb0db6d

$ git log 5dad29423..3bbf3fb0d --date=short --no-merges --format='%ad %ae %s'
2017-11-03 pcc dump_symbols: Stop rejecting files with Android packed relocation sections.
2017-11-02 jswang Create LongStringDictionary and replace SimpleStringDictionary on iOS
2017-11-02 adamharrison Don’t set exit_after_write to false for tvOS.

Created with:
  roll-dep src/third_party/breakpad/breakpad

Bug:  742655 
Change-Id: I979a14dcaf182d59a234ef906bbb7b7af1e431e3
Reviewed-on: https://chromium-review.googlesource.com/756920
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#514517}
[modify] https://crrev.com/3b69f0114cfc34b201e8f735171aec59fad6ce78/DEPS
[modify] https://crrev.com/3b69f0114cfc34b201e8f735171aec59fad6ce78/third_party/breakpad/BUILD.gn

Cc: thomasanderson@chromium.org
Now that use_lld=true "just works" for target_os="android", I tried it out to see what the size savings would be:

-rwxr-xr-x 1 agrieve eng 47875512 Nov 25 01:12 libmonochrome.so.orig
-rwxr-xr-x 1 agrieve eng 46285536 Nov 24 20:17 libmonochrome.so.lld
-rwxr-xr-x 1 agrieve eng 48783516 Nov 22 05:44 libmonochrome.so.thin
-rwxr-xr-x 1 agrieve eng 48823452 Nov 24 21:36 libmonochrome.so.thinO1

All are using packed relocations.
.thin was with use_thin_lto GN arg.
.thin01 was the same, but with -Wl,--lto-O1 (default is --lto-O0)

-Wl,--lto-Oz does not seem to exist...

So... The switch to lld will shrink native code by ~1.5MB, but then enabling -lto will increase it by 2.5MB (or a net 0.9 from now).
Also note: these builds are all without an orderfile.
Also: I forget to set is_chrome_branded=true, which is (sadly) still required to strip unwind information. Looking at just sections that match "text|data|rel|plt|got", we get:

libmonochrome.so.orig   45084319
libmonochrome.so.lld    43239535
libmonochrome.so.thin   46288233
libmonochrome.so.thin01 46329089

Blockedon: 788475
I was wrong about --lto-O0 being the default. Setting it explicitly yields:

libmonochrome.so.thinO0    43280350

This flag is already set in our GN rules for is_linux, so we should clearly just enable for is_android as well.

There are also two more flags enabled for is_linux && lto: -Wl,-mllvm,-function-sections -Wl,-mllvm,-data-sections. However, they didn't have any effect when I enabled them for android.

Here's the update list of sizes:
libmonochrome.so.thin     46288233
libmonochrome.so.orig     45084319
libmonochrome.so.lld      43239535
libmonochrome.so.thinO0   43280350

LTO still increases size a little bit, but basically negligible. 

Finally, here's a build with is_cfi=true:
libmonochrome.so.cfi      45468465

Project Member

Comment 24 by bugdroid1@chromium.org, Nov 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0aa02c66f0ab83489bbee2d669ee3f8335fe6552

commit 0aa02c66f0ab83489bbee2d669ee3f8335fe6552
Author: Andrew Grieve <agrieve@chromium.org>
Date: Tue Nov 28 04:38:00 2017

Enable Linux binary-size-related lto flags to Android

Shrinks thin-lto android build by ~3MB

Bug:  742655 
Change-Id: I12ccaa8b13f021bae96a704ae5edadb2540cedb6
Reviewed-on: https://chromium-review.googlesource.com/789441
Commit-Queue: agrieve <agrieve@chromium.org>
Reviewed-by: Peter Collingbourne <pcc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519570}
[modify] https://crrev.com/0aa02c66f0ab83489bbee2d669ee3f8335fe6552/build/config/compiler/BUILD.gn

Project Member

Comment 25 by bugdroid1@chromium.org, Dec 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/66205b643e9c51fe1fffce934e62ff4f8da32063

commit 66205b643e9c51fe1fffce934e62ff4f8da32063
Author: Peter Collingbourne <pcc@chromium.org>
Date: Wed Dec 13 03:39:49 2017

Only add runtime dependencies to the ordered libraries list.

We cannot find library dependencies to add to a target's ordered
libraries list by searching the build directory because the build
directory may contain libraries that appear to be dependencies but are
in fact unrelated libraries that share a name with a system library
that the target depends on. For example, we may be building a target
that depends on the system's libGLESv2.so, and the build directory may
contain a library named libGLESv2.so as a result of building ANGLE. The
resulting APK would try to load libGLESv2.so using the crazy linker,
which might fail to load the system's library.

The solution is to use GN's write_runtime_deps feature to export the
runtime dependency list from the build system and create an ordered
libraries list from that.

Bug:  742655 
Change-Id: Ifdbf3de6b78b56af22dbfe0d12d80db5a48fe9db
Reviewed-on: https://chromium-review.googlesource.com/821600
Reviewed-by: agrieve <agrieve@chromium.org>
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523675}
[modify] https://crrev.com/66205b643e9c51fe1fffce934e62ff4f8da32063/build/android/gyp/write_ordered_libraries.py
[modify] https://crrev.com/66205b643e9c51fe1fffce934e62ff4f8da32063/build/config/android/rules.gni

Labels: Performance-Size

Comment 27 by p...@chromium.org, Jan 11 2018

Blockedon: 801373
Blocking: 761307
Cc: yunlian@chromium.org
Project Member

Comment 30 by bugdroid1@chromium.org, Jan 13 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/49a01149d060d05d99cc3fa336c350b9b434d7d0

commit 49a01149d060d05d99cc3fa336c350b9b434d7d0
Author: Peter Collingbourne <pcc@chromium.org>
Date: Sat Jan 13 04:18:16 2018

Android: chrome_sync_shell requires linker support for relocation packing.

Fixes crashes on older devices in component builds of
chrome_sync_shell_test_apk when linked with lld.

Bug:  742655 
Change-Id: Iafcb6fe797f9aa382a6115dad0b3fd43acbbef19
Reviewed-on: https://chromium-review.googlesource.com/866112
Reviewed-by: agrieve <agrieve@chromium.org>
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529158}
[modify] https://crrev.com/49a01149d060d05d99cc3fa336c350b9b434d7d0/chrome/android/BUILD.gn

Project Member

Comment 31 by bugdroid1@chromium.org, Jan 19 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2ca66ef8ae32044a7ec9ea40ad1d9ee4ae295be1

commit 2ca66ef8ae32044a7ec9ea40ad1d9ee4ae295be1
Author: Peter Collingbourne <pcc@google.com>
Date: Fri Jan 19 22:20:01 2018

Switch the default linker to lld on Android.

All known blockers have now been fixed. This CL is likely to uncover
unknown blockers, and is a likely culprit for any issues involving
crash dumping or symbolization on Android.

MIPS is excluded because of an incompatibility between Android MIPS
prebuilts and lld (https://github.com/android-ndk/ndk/issues/617).

Bug:  742655 
Change-Id: Ic12eebce867f3804bb97d18566afc011fa962a26
Reviewed-on: https://chromium-review.googlesource.com/872225
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Reviewed-by: agrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530632}
[modify] https://crrev.com/2ca66ef8ae32044a7ec9ea40ad1d9ee4ae295be1/build/config/compiler/compiler.gni

Project Member

Comment 32 by bugdroid1@chromium.org, Jan 20 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7b895661b955a3ae520a83eec7f1b3db282ddbc0

commit 7b895661b955a3ae520a83eec7f1b3db282ddbc0
Author: Peter Collingbourne <pcc@chromium.org>
Date: Sat Jan 20 03:43:00 2018

Disable lld for ARM versions older than 7.

lld currently does not support ARMv<7.

Bug:  742655 
Change-Id: I54afff09a704bcf6a07e97235242c84f18f35601
Reviewed-on: https://chromium-review.googlesource.com/877499
Reviewed-by: agrieve <agrieve@chromium.org>
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530745}
[modify] https://crrev.com/7b895661b955a3ae520a83eec7f1b3db282ddbc0/build/config/compiler/compiler.gni

Project Member

Comment 33 by bugdroid1@chromium.org, Jan 20 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2a51ee5b6f17f2bc0dcf1b61e7234db797b1924c

commit 2a51ee5b6f17f2bc0dcf1b61e7234db797b1924c
Author: Peter Collingbourne <pcc@chromium.org>
Date: Sat Jan 20 04:45:29 2018

Revert "Disable lld for ARM versions older than 7." and "Switch the default linker to lld on Android."

This reverts commits 7b895661b955a3ae520a83eec7f1b3db282ddbc0
and 2ca66ef8ae32044a7ec9ea40ad1d9ee4ae295be1.

Broke the chromium.perf Android builder. Fix under review:
https://chromium-review.googlesource.com/c/chromium/tools/build/+/877513

TBR=agrieve@chromium.org

Bug:  742655 
Change-Id: I26eb5bbc8740801ab11f7aa13a62343400a5337e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/877619
Reviewed-by: Peter Collingbourne <pcc@chromium.org>
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530751}
[modify] https://crrev.com/2a51ee5b6f17f2bc0dcf1b61e7234db797b1924c/build/config/compiler/compiler.gni

Project Member

Comment 35 by bugdroid1@chromium.org, Jan 22 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/19466659246a1ae1a77760fc241a868da6c57020

commit 19466659246a1ae1a77760fc241a868da6c57020
Author: Peter Collingbourne <pcc@chromium.org>
Date: Mon Jan 22 23:49:23 2018

Reland "Disable lld for ARM versions older than 7." and "Switch the default linker to lld on Android."

This relands commits 7b895661b955a3ae520a83eec7f1b3db282ddbc0 and
2ca66ef8ae32044a7ec9ea40ad1d9ee4ae295be1 which were reverted in commit
7450c138da28094f40dcd8da177ac1d643018da8.

> Switch the default linker to lld on Android.
>
> All known blockers have now been fixed. This CL is likely to uncover
> unknown blockers, and is a likely culprit for any issues involving
> crash dumping or symbolization on Android.
>
> MIPS is excluded because of an incompatibility between Android MIPS
> prebuilts and lld (https://github.com/android-ndk/ndk/issues/617).

> Disable lld for ARM versions older than 7.
>
> lld currently does not support ARMv<7.

Bug:  742655 
Change-Id: I3f8848fad91f9132288fe7b704c74cd58f8e5eae
Reviewed-on: https://chromium-review.googlesource.com/879346
Reviewed-by: agrieve <agrieve@chromium.org>
Commit-Queue: Peter Collingbourne <pcc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531064}
[modify] https://crrev.com/19466659246a1ae1a77760fc241a868da6c57020/build/config/compiler/compiler.gni

Project Member

Comment 36 by bugdroid1@chromium.org, Jan 31 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4adaab615822018cddf21a359677e9fdae1d63e9

commit 4adaab615822018cddf21a359677e9fdae1d63e9
Author: Nico Weber <thakis@chromium.org>
Date: Wed Jan 31 20:46:53 2018

android: enable --icf=all for x86 and x64.

We used to not pass --icf=all on Android because the NDK's gold has
some bug.  But we should only use that conditional if use_lld isn't set
(and use_lld is set by default on most Android archs now).

Bug:  576197 , 742655 
Change-Id: I27cd0b39351224fe243a92f886e7d68e3f7d7fc4
Reviewed-on: https://chromium-review.googlesource.com/895883
Reviewed-by: Peter Collingbourne <pcc@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533392}
[modify] https://crrev.com/4adaab615822018cddf21a359677e9fdae1d63e9/build/config/compiler/BUILD.gn

Status: Fixed (was: Assigned)
\o/

Comment 38 by p...@chromium.org, Mar 6 2018

For the record, this is the build where the switch happened: https://ci.chromium.org/buildbot/chromium.perf/Android%20Builder/221241

I looked at the median libmonochrome.so link time for 5 builds either side of the switch and it decreased from 2m5s to 1m34s.

Comment 39 by ruiu@google.com, Mar 6 2018

Nice improvement in link time, but I actually expected even more, like at least 2x, so it's a bit weird...

Comment 40 by p...@chromium.org, Mar 6 2018

The official android build uses --symbol-ordering-file, it's possible that we need to optimize that feature more.
Blocking: 838413

Sign in to add a comment