| Index: build/config/gcc/BUILD.gn | 
| diff --git a/build/config/gcc/BUILD.gn b/build/config/gcc/BUILD.gn | 
| index edfb92c768fec30d14f1e1b35c277b4c8a42e2ec..9f5ca7158baeace901f92f55f6e359ddee23da37 100644 | 
| --- a/build/config/gcc/BUILD.gn | 
| +++ b/build/config/gcc/BUILD.gn | 
| @@ -2,6 +2,8 @@ | 
| # Use of this source code is governed by a BSD-style license that can be | 
| # found in the LICENSE file. | 
|  | 
| +import("//build/toolchain/toolchain.gni") | 
| + | 
| # This config causes functions not to be automatically exported from shared | 
| # libraries. By default, all symbols are exported but this means there are | 
| # lots of exports that slow everything down. In general we explicitly mark | 
| @@ -27,10 +29,14 @@ config("executable_ldconfig") { | 
| ] | 
| } else { | 
| # Android doesn't support rpath. | 
| +    rpath_link = "" | 
| +    if (shlib_subdir != ".") { | 
| +      rpath_link = "${shlib_subdir}/" | 
| +    } | 
| ldflags = [ | 
| # Want to pass "\$". GN will re-escape as required for ninja. | 
| -      "-Wl,-rpath=\$ORIGIN/", | 
| -      "-Wl,-rpath-link=", | 
| +      "-Wl,-rpath=\$ORIGIN/${rpath_link}", | 
| +      "-Wl,-rpath-link=${rpath_link}", | 
|  | 
| # Newer binutils don't set DT_RPATH unless you disable "new" dtags | 
| # and the new DT_RUNPATH doesn't work without --no-as-needed flag. | 
|  |