Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 # Wrapper script named "ld" that either executes gold or the system linker. | 6 # Wrapper script named "ld" that either executes gold or the system linker. |
| 7 | 7 |
| 8 # The gold binary was built on 64-bit Ubuntu Lucid. Don't run it on | 8 # The gold binaries are built on 64-bit Ubuntu Lucid and 32-bit Ubuntu Lucid, |
| 9 # non-64-bit machines. Note that "uname -m" prints the kernel architecture, | 9 # for x86_64 and i686, respectively. |
| 10 # while this binary will also fail on 64-bit kernels with 32-bit userlands. | 10 # Note that we do not use "uname -m" because it prints the kernel architecture, |
| 11 # which can cause failures on 64-bit kernels with 32-bit userlands. | |
| 11 | 12 |
| 12 base_dir=$(dirname "$0") | 13 base_dir=$(dirname "$0") |
| 13 machine=$(getconf LONG_BIT) | 14 machine=$(getconf LONG_BIT) |
| 14 if [ "$machine" = "64" ]; then | 15 if [ "$machine" = "64" ]; then |
| 15 exec $base_dir/gold64 "$@" | 16 exec $base_dir/gold64 "$@" |
| 17 elif [ "$machine" = "32" ]; then | |
| 18 exec $base_dir/gold32 "$@" | |
| 16 else | 19 else |
| 17 # Fall back on the ld found in $PATH. | 20 echo Unknown architecture |
|
Evan Martin
2012/02/29 20:25:48
Maybe include the script name, so that someone who
| |
| 18 exec ld "$@" | 21 exit 1 |
| 19 fi | 22 fi |
| OLD | NEW |