1From 78eac8c99451681f4c403b3ea727ee61651a3c1a Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Wed, 16 Nov 2011 16:58:34 +0000
4Subject: [PATCH] libtool: Avoid relinking when cross compiling, its pointless
5
6There is no point in having "executable" binaries in the .libs
7directory linked with different rpaths to the target which
8could concivably be run on the build system when cross compiling.
9
10This patch removes the extra rpaths ($compile_rpath) so that the
11output from the "link" stage can be used on the target. We can then
12avoid having to "relink" during the install stage.
13
14This saves some build time (do_install is over 2 minutes faster for
15pulseaudio).
16
17This patch also removes an annoying "seems to be moved" warning
18which is totally bogus in the sysroot case.
19
20Upstream-Status: Inappropriate [upstream are unlikely to take a patch like this]
21
22RP 2011/11/16
23
24Updated by: Robert Yang <liezhi.yang@windriver.com>
25---
26 build-aux/ltmain.in | 56 ++++++++++++++++++++++-----------------------
27 1 file changed, 28 insertions(+), 28 deletions(-)
28
29diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
30index fa157775..816ea5a0 100644
31--- a/build-aux/ltmain.in
32+++ b/build-aux/ltmain.in
33@@ -2513,7 +2513,7 @@ func_mode_install ()
34 	dir=$func_dirname_result
35 	func_append dir "$objdir"
36
37-	if test -n "$relink_command"; then
38+	if test "$fast_install" = no && test -n "$relink_command"; then
39 	  # Strip any trailing slash from the destination.
40 	  func_stripname '' '/' "$libdir"
41 	  destlibdir=$func_stripname_result
42@@ -2552,7 +2552,7 @@ func_mode_install ()
43 	  shift
44
45 	  srcname=$realname
46-	  test -n "$relink_command" && srcname=${realname}T
47+	  test "$fast_install" = no && test -n "$relink_command" && srcname="$realname"T
48
49 	  # Install the shared library and build the symlinks.
50 	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
51@@ -6411,18 +6411,18 @@ func_mode_link ()
52 	    # Hardcode the library path.
53 	    # Skip directories that are in the system default run-time
54 	    # search path.
55-	    case " $sys_lib_dlsearch_path " in
56-	    *" $absdir "*) ;;
57-	    *)
58-	      case "$compile_rpath$compile_rpath_tail " in
59-	      *" $absdir "*) ;;
60-	      *) case $absdir in
61-                 "$progdir/"*) func_append compile_rpath " $absdir" ;;
62-                 *) func_append compile_rpath_tail " $absdir" ;;
63-		 esac
64-	      esac
65-	      ;;
66-	    esac
67+	    #case " $sys_lib_dlsearch_path " in
68+	    #*" $absdir "*) ;;
69+	    #*)
70+	    #  case "$compile_rpath$compile_rpath_tail " in
71+	    #  *" $absdir "*) ;;
72+	    #  *) case $absdir in
73+            #     "$progdir/"*) func_append compile_rpath " $absdir" ;;
74+            #     *) func_append compile_rpath_tail " $absdir" ;;
75+	#	 esac
76+	    #  esac
77+	    #  ;;
78+	    #esac
79 	    case " $sys_lib_dlsearch_path " in
80 	    *" $libdir "*) ;;
81 	    *)
82@@ -6488,18 +6488,18 @@ func_mode_link ()
83 	    # Hardcode the library path.
84 	    # Skip directories that are in the system default run-time
85 	    # search path.
86-	    case " $sys_lib_dlsearch_path " in
87-	    *" $absdir "*) ;;
88-	    *)
89-	      case "$compile_rpath$compile_rpath_tail " in
90-	      *" $absdir "*) ;;
91-	      *) case $absdir in
92-                 "$progdir/"*) func_append compile_rpath " $absdir" ;;
93-                 *) func_append compile_rpath_tail " $absdir" ;;
94-		 esac
95-	      esac
96-	      ;;
97-	    esac
98+	    #case " $sys_lib_dlsearch_path " in
99+	    #*" $absdir "*) ;;
100+	    #*)
101+	    #  case "$compile_rpath$compile_rpath_tail " in
102+	    #  *" $absdir "*) ;;
103+	    #  *) case $absdir in
104+            #     "$progdir/"*) func_append compile_rpath " $absdir" ;;
105+            #     *) func_append compile_rpath_tail " $absdir" ;;
106+	#	 esac
107+	    #  esac
108+	    #  ;;
109+	    #esac
110 	    case " $sys_lib_dlsearch_path " in
111 	    *" $libdir "*) ;;
112 	    *)
113@@ -6843,8 +6843,8 @@ func_mode_link ()
114 		  eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
115 		  test -z "$libdir" && \
116 		    func_fatal_error "'$deplib' is not a valid libtool archive"
117-		  test "$absdir" != "$libdir" && \
118-		    func_warning "'$deplib' seems to be moved"
119+		  #test "$absdir" != "$libdir" && \
120+		  #  func_warning "'$deplib' seems to be moved"
121
122 		  path=-L$absdir
123 		fi
124--
1252.39.5
126
127