diff mbox

PATCH: PR driver/46712: exec-tool.in doesn't work with -fuse-linker-plugin in a gcc+binutils combined tree

Message ID 20101129203628.GA5115@intel.com
State New
Headers show

Commit Message

H.J. Lu Nov. 29, 2010, 8:36 p.m. UTC
exec-tool.in uses LT_RCU to check recursive calls on as/ld in a
gcc+binutils combined tree. However, it doesn't work with
-fuse-linker-plugin, which calls ld, which calls as.  This patch
checks and exports LT_RCU_$id instead of LT_RCU.  OK for trunk?

Thanks.


H.J.
---
2010-11-29  H.J. Lu  <hongjiu.lu@intel.com>

    	PR driver/46712
	* exec-tool.in (id): New.
	Check and export LT_RCU_$id instead of LT_RCU.

Comments

Ralf Wildenhues Nov. 29, 2010, 10 p.m. UTC | #1
* H.J. Lu wrote on Mon, Nov 29, 2010 at 09:36:28PM CET:
> exec-tool.in uses LT_RCU to check recursive calls on as/ld in a
> gcc+binutils combined tree. However, it doesn't work with
> -fuse-linker-plugin, which calls ld, which calls as.  This patch
> checks and exports LT_RCU_$id instead of LT_RCU.  OK for trunk?

I'm not sure if a build maintainer can approve this, but it looks good
to me with one nit below.

Thanks,
Ralf

> 2010-11-29  H.J. Lu  <hongjiu.lu@intel.com>
> 
>     	PR driver/46712
> 	* exec-tool.in (id): New.
> 	Check and export LT_RCU_$id instead of LT_RCU.

> --- a/gcc/exec-tool.in
> +++ b/gcc/exec-tool.in
> @@ -28,6 +28,7 @@ fast_install=@enable_fast_install@
>  objdir=@objdir@
>  
>  invoked=`basename "$0"`
> +id=$invoked
>  case "$invoked" in
>    as)
>      original=$ORIGINAL_AS_FOR_TARGET
> @@ -44,6 +45,7 @@ case "$invoked" in
>      fi
>      prog=ld-new$exeext
>      dir=ld
> +    id=ld
>      ;;
>    nm)
>      original=$ORIGINAL_NM_FOR_TARGET
> @@ -68,9 +70,11 @@ case "$original" in
>        # libtool has not relinked ld-new yet, but we cannot just use the
>        # previous stage (because then the relinking would just never happen!).
>        # So we take extra care to use prev-ld/ld-new *on recursive calls*.
> +      eval LT_RCU="\${LT_RCU_$id}"
>        test x"$LT_RCU" = x"1" && exec $scriptdir/../prev-$dir/$prog ${1+"$@"}
>  
> -      LT_RCU=1; export LT_RCU
> +      eval LT_RCU_$id=1
> +      eval export LT_RCU_$id

FWIW, this last eval is not necessary.

>        $scriptdir/../$dir/$prog ${1+"$@"}
>        result=$?
>        exit $result
Paolo Bonzini Nov. 29, 2010, 10:46 p.m. UTC | #2
On 11/29/2010 11:00 PM, Ralf Wildenhues wrote:
> I'm not sure if a build maintainer can approve this, but it looks good
> to me with one nit below.

It is part of the build scripts, and it's okay with the eval removed.

Paolo
diff mbox

Patch

diff --git a/gcc/exec-tool.in b/gcc/exec-tool.in
index 0ae8f2a..e6ae329 100644
--- a/gcc/exec-tool.in
+++ b/gcc/exec-tool.in
@@ -28,6 +28,7 @@  fast_install=@enable_fast_install@
 objdir=@objdir@
 
 invoked=`basename "$0"`
+id=$invoked
 case "$invoked" in
   as)
     original=$ORIGINAL_AS_FOR_TARGET
@@ -44,6 +45,7 @@  case "$invoked" in
     fi
     prog=ld-new$exeext
     dir=ld
+    id=ld
     ;;
   nm)
     original=$ORIGINAL_NM_FOR_TARGET
@@ -68,9 +70,11 @@  case "$original" in
       # libtool has not relinked ld-new yet, but we cannot just use the
       # previous stage (because then the relinking would just never happen!).
       # So we take extra care to use prev-ld/ld-new *on recursive calls*.
+      eval LT_RCU="\${LT_RCU_$id}"
       test x"$LT_RCU" = x"1" && exec $scriptdir/../prev-$dir/$prog ${1+"$@"}
 
-      LT_RCU=1; export LT_RCU
+      eval LT_RCU_$id=1
+      eval export LT_RCU_$id
       $scriptdir/../$dir/$prog ${1+"$@"}
       result=$?
       exit $result
@@ -83,5 +87,3 @@  case "$original" in
     exec $original ${1+"$@"}
     ;;
 esac
-
-