Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: build/linux/sysroot_ld_path.sh

Issue 2900193003: Use relative path in -L and -Wl,-rpath-link (Closed)
Patch Set: don't print on empty Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/config/posix/sysroot_ld_path.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/sh 1 #!/bin/sh
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2013 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 # Reads etc/ld.so.conf and/or etc/ld.so.conf.d/*.conf and returns the 6 # Reads etc/ld.so.conf and/or etc/ld.so.conf.d/*.conf and returns the
7 # appropriate linker flags. 7 # appropriate linker flags.
8 # 8 #
9 # sysroot_ld_path.sh /abspath/to/sysroot 9 # sysroot_ld_path.sh /abspath/to/sysroot
10 # 10 #
11 11
12 log_error_and_exit() { 12 log_error_and_exit() {
13 echo $0: $@ 13 echo $0: $@
14 exit 1 14 exit 1
15 } 15 }
16 16
17 process_entry() { 17 process_entry() {
18 if [ -z "$1" ] || [ -z "$2" ]; then 18 if [ -z "$1" ] || [ -z "$2" ]; then
19 log_error_and_exit "bad arguments to process_entry()" 19 log_error_and_exit "bad arguments to process_entry()"
20 fi 20 fi
21 local root="$1" 21 local root="$1"
22 local localpath="$2" 22 local localpath="$2"
23 23
24 echo $localpath | grep -qs '^/' 24 echo $localpath | grep -qs '^/'
25 if [ $? -ne 0 ]; then 25 if [ $? -ne 0 ]; then
26 log_error_and_exit $localpath does not start with / 26 log_error_and_exit $localpath does not start with /
27 fi 27 fi
28 local entry="$root$localpath" 28 local entry="$root$localpath"
29 echo -L$entry 29 echo $entry
30 echo -Wl,-rpath-link=$entry
31 } 30 }
32 31
33 process_ld_so_conf() { 32 process_ld_so_conf() {
34 if [ -z "$1" ] || [ -z "$2" ]; then 33 if [ -z "$1" ] || [ -z "$2" ]; then
35 log_error_and_exit "bad arguments to process_ld_so_conf()" 34 log_error_and_exit "bad arguments to process_ld_so_conf()"
36 fi 35 fi
37 local root="$1" 36 local root="$1"
38 local ld_so_conf="$2" 37 local ld_so_conf="$2"
39 38
40 # ld.so.conf may include relative include paths. pushd is a bashism. 39 # ld.so.conf may include relative include paths. pushd is a bashism.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 if [ -e "$LD_SO_CONF" ]; then 90 if [ -e "$LD_SO_CONF" ]; then
92 process_ld_so_conf "$1" "$LD_SO_CONF" | xargs echo 91 process_ld_so_conf "$1" "$LD_SO_CONF" | xargs echo
93 elif [ -e "$LD_SO_CONF_D" ]; then 92 elif [ -e "$LD_SO_CONF_D" ]; then
94 find "$LD_SO_CONF_D" -maxdepth 1 -name '*.conf' -print -quit > /dev/null 93 find "$LD_SO_CONF_D" -maxdepth 1 -name '*.conf' -print -quit > /dev/null
95 if [ $? -eq 0 ]; then 94 if [ $? -eq 0 ]; then
96 for entry in $LD_SO_CONF_D/*.conf; do 95 for entry in $LD_SO_CONF_D/*.conf; do
97 process_ld_so_conf "$1" "$entry" 96 process_ld_so_conf "$1" "$entry"
98 done | xargs echo 97 done | xargs echo
99 fi 98 fi
100 fi 99 fi
OLDNEW
« no previous file with comments | « build/config/posix/sysroot_ld_path.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698