Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//build/config/compiler/compiler.gni") | 5 import("//build/config/compiler/compiler.gni") |
| 6 import("//build/config/sanitizers/sanitizers.gni") | 6 import("//build/config/sanitizers/sanitizers.gni") |
| 7 import("//build/config/sysroot.gni") | 7 import("//build/config/sysroot.gni") |
| 8 import("//build/toolchain/toolchain.gni") | 8 import("//build/toolchain/toolchain.gni") |
| 9 | 9 |
| 10 declare_args() { | 10 declare_args() { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 # Note: Android doesn't support rpath. | 79 # Note: Android doesn't support rpath. |
| 80 if (shlib_subdir != ".") { | 80 if (shlib_subdir != ".") { |
| 81 rpath_link = "${shlib_subdir}/" | 81 rpath_link = "${shlib_subdir}/" |
| 82 } else { | 82 } else { |
| 83 rpath_link = "." | 83 rpath_link = "." |
| 84 } | 84 } |
| 85 if (current_toolchain != default_toolchain || gcc_target_rpath == "") { | 85 if (current_toolchain != default_toolchain || gcc_target_rpath == "") { |
| 86 ldflags = [ | 86 ldflags = [ |
| 87 # Want to pass "\$". GN will re-escape as required for ninja. | 87 # Want to pass "\$". GN will re-escape as required for ninja. |
| 88 "-Wl,-rpath=\$ORIGIN/${rpath_link}", | 88 "-Wl,-rpath=\$ORIGIN/${rpath_link}", |
| 89 "-Wl,-rpath-link=${rpath_link}", | 89 "-Wl,-rpath-link=" + rebase_path(rpath_link, root_build_dir), |
|
brettw
2017/05/30 03:57:56
I don't understand this one, it looks like the inp
wychen
2017/05/30 06:34:05
You are right. They don't have an effect.
Reverted
| |
| 90 ] | 90 ] |
| 91 } else { | 91 } else { |
| 92 ldflags = [ | 92 ldflags = [ |
| 93 "-Wl,-rpath=${gcc_target_rpath}", | 93 "-Wl,-rpath=${gcc_target_rpath}", |
| 94 "-Wl,-rpath-link=${rpath_link}", | 94 "-Wl,-rpath-link=" + rebase_path(rpath_link, root_build_dir), |
| 95 ] | 95 ] |
| 96 } | 96 } |
| 97 } | 97 } |
| 98 } | 98 } |
| 99 | 99 |
| 100 # Settings for executables. | 100 # Settings for executables. |
| 101 config("executable_ldconfig") { | 101 config("executable_ldconfig") { |
| 102 # WARNING! //sandbox/linux:chrome_sandbox will not pick up this | 102 # WARNING! //sandbox/linux:chrome_sandbox will not pick up this |
| 103 # config, because it is a setuid binary that needs special flags. | 103 # config, because it is a setuid binary that needs special flags. |
| 104 # If you add things to this config, make sure you check to see | 104 # If you add things to this config, make sure you check to see |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 127 _rpath_link = rebase_path(root_out_dir, root_build_dir) | 127 _rpath_link = rebase_path(root_out_dir, root_build_dir) |
| 128 if (shlib_subdir != ".") { | 128 if (shlib_subdir != ".") { |
| 129 _rpath_link += "/$shlib_subdir" | 129 _rpath_link += "/$shlib_subdir" |
| 130 } | 130 } |
| 131 if (is_android) { | 131 if (is_android) { |
| 132 _rebased_sysroot = rebase_path(sysroot, root_build_dir) | 132 _rebased_sysroot = rebase_path(sysroot, root_build_dir) |
| 133 _rpath_link += ":$_rebased_sysroot/usr/lib" | 133 _rpath_link += ":$_rebased_sysroot/usr/lib" |
| 134 } | 134 } |
| 135 | 135 |
| 136 ldflags += [ | 136 ldflags += [ |
| 137 "-Wl,-rpath-link=$_rpath_link", | 137 "-Wl,-rpath-link=" + rebase_path(_rpath_link, root_build_dir), |
|
brettw
2017/05/30 03:57:56
Ditto here.
| |
| 138 | 138 |
| 139 # TODO(GYP): Do we need a check on the binutils version here? | 139 # TODO(GYP): Do we need a check on the binutils version here? |
| 140 # | 140 # |
| 141 # Newer binutils don't set DT_RPATH unless you disable "new" dtags | 141 # Newer binutils don't set DT_RPATH unless you disable "new" dtags |
| 142 # and the new DT_RUNPATH doesn't work without --no-as-needed flag. | 142 # and the new DT_RUNPATH doesn't work without --no-as-needed flag. |
| 143 "-Wl,--disable-new-dtags", | 143 "-Wl,--disable-new-dtags", |
| 144 ] | 144 ] |
| 145 } | 145 } |
| 146 } | 146 } |
| 147 | 147 |
| 148 config("no_exceptions") { | 148 config("no_exceptions") { |
| 149 cflags_cc = [ "-fno-exceptions" ] | 149 cflags_cc = [ "-fno-exceptions" ] |
| 150 cflags_objcc = cflags_cc | 150 cflags_objcc = cflags_cc |
| 151 } | 151 } |
| OLD | NEW |