From d49126c0ee1dd0d68aa12bdf9eb7b87f023a85e2 Mon Sep 17 00:00:00 2001 From: Gordana Cmiljanovic Date: Tue, 19 Dec 2017 15:18:23 +0000 Subject: [PATCH] [MIPS] Fix ld.bfd linker issue for mipsel Adding -Wl,--start-group, -Wl,--end-group so that ld.bfd can resolve library dependencies in case of Android component build for mipsel. Bug: 794486 Change-Id: I9ce1867b614aea51382637bc59aa7c7b8c2adbde Reviewed-on: https://chromium-review.googlesource.com/823905 Reviewed-by: Dirk Pranke Commit-Queue: Robert Sesek Cr-Original-Commit-Position: refs/heads/master@{#525039} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 71279763dbdd0d8d3a3cb1fb038587ab752ace47 --- toolchain/gcc_toolchain.gni | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/toolchain/gcc_toolchain.gni b/toolchain/gcc_toolchain.gni index 74b252970..be2d29e0e 100644 --- a/toolchain/gcc_toolchain.gni +++ b/toolchain/gcc_toolchain.gni @@ -402,7 +402,11 @@ template("gcc_toolchain") { rebase_path("//build/toolchain/gcc_solink_wrapper.py", root_build_dir) command = "$python_path \"$solink_wrapper\" --readelf=\"$readelf\" --nm=\"$nm\" $strip_switch--sofile=\"$unstripped_sofile\" --tocfile=\"$tocfile\"$map_switch --output=\"$sofile\"$whitelist_flag -- $link_command" - rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive $solink_libs_section_prefix {{libs}} $solink_libs_section_postfix" + if (target_cpu == "mipsel" && is_component_build && is_android) { + rspfile_content = "-Wl,--start-group -Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive $solink_libs_section_prefix {{libs}} $solink_libs_section_postfix -Wl,--end-group" + } else { + rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive $solink_libs_section_prefix {{libs}} $solink_libs_section_postfix" + } description = "SOLINK $sofile"