Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Xen: Devel

[PATCH v2] tools, configure: Fix LIB_PATH computation in configure scripts

 

 

Xen devel RSS feed   Index | Next | Previous | View Threaded


boris.ostrovsky at amd

Jun 8, 2012, 1:23 PM

Post #1 of 5 (81 views)
Permalink
[PATCH v2] tools, configure: Fix LIB_PATH computation in configure scripts

# HG changeset patch
# User Boris Ostrovsky <boris.ostrovsky [at] amd>
# Date 1339185838 -7200
# Node ID fa21f847fc66619fad38923cd87d6ba51d731eba
# Parent 32034d1914a607d7b6f1f060352b4cac973600f8
tools, configure: Fix LIB_PATH computation in configure scripts

tool's configure script sets LIB_PATH by chopping off ${exec_prefix}
from $libdir and it does so by computing length of ${exec_prefix} value.
However, $libdir's value is a literal '${exec_prefix}/lib' string
(i.e. $exec_prefix is not substituted) and therefore LIB_PATH may be
computed incorrectly, most likely as "c_prefix}/lib64" assuming that
exec_prefix is NONE.

Instead, we should start at offset `expr length '${exec_prefix}/'
(which is 15).

Signed-off-by: Boris Ostrovsky <boris.ostrovsky [at] amd>

diff -r 32034d1914a6 -r fa21f847fc66 tools/configure
--- a/tools/configure Thu Jun 07 19:46:57 2012 +0100
+++ b/tools/configure Fri Jun 08 22:03:58 2012 +0200
@@ -6062,7 +6062,7 @@ fi

else

- LIB_PATH="${libdir:`expr length "$exec_prefix" + 1`}"
+ LIB_PATH="${libdir:`expr length '${exec_prefix}/'`}"

fi

diff -r 32034d1914a6 -r fa21f847fc66 tools/m4/default_lib.m4
--- a/tools/m4/default_lib.m4 Thu Jun 07 19:46:57 2012 +0100
+++ b/tools/m4/default_lib.m4 Fri Jun 08 22:03:58 2012 +0200
@@ -9,6 +9,6 @@ AC_DEFUN([AX_DEFAULT_LIB],
LIB_PATH="lib"
])
], [.
- LIB_PATH="${libdir:`expr length "$exec_prefix" + 1`}"
+ LIB_PATH="${libdir:`expr length '${exec_prefix}/'`}"
])
AC_SUBST(LIB_PATH)])


_______________________________________________
Xen-devel mailing list
Xen-devel [at] lists
http://lists.xen.org/xen-devel


Ian.Campbell at citrix

Jul 4, 2012, 4:00 AM

Post #2 of 5 (66 views)
Permalink
Re: [PATCH v2] tools, configure: Fix LIB_PATH computation in configure scripts [In reply to]

On Fri, 2012-06-08 at 21:23 +0100, Boris Ostrovsky wrote:
> # HG changeset patch
> # User Boris Ostrovsky <boris.ostrovsky [at] amd>
> # Date 1339185838 -7200
> # Node ID fa21f847fc66619fad38923cd87d6ba51d731eba
> # Parent 32034d1914a607d7b6f1f060352b4cac973600f8
> tools, configure: Fix LIB_PATH computation in configure scripts
>
> tool's configure script sets LIB_PATH by chopping off ${exec_prefix}
> from $libdir and it does so by computing length of ${exec_prefix} value.
> However, $libdir's value is a literal '${exec_prefix}/lib' string
> (i.e. $exec_prefix is not substituted) and therefore LIB_PATH may be
> computed incorrectly, most likely as "c_prefix}/lib64" assuming that
> exec_prefix is NONE.
>
> Instead, we should start at offset `expr length '${exec_prefix}/'
> (which is 15).
>
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky [at] amd>

Boris, sorry for letting this languish for so long.

Roger, any opinion on this patch?

If I'm reading the script right this is the else clause of
[AS_IF([test "\${exec_prefix}/lib" = "$libdir"],

so at this point we know libdir != ${exec_prefix}/lib, is there any
guarantee that it even starts with \${exec_prefix} ?

I think this patch is complementary too rather than conflicting with /
subsumed by Matt's "tools: honour --libdir when it is passed
to ./configure" ?

Ian.

>
> diff -r 32034d1914a6 -r fa21f847fc66 tools/configure
> --- a/tools/configure Thu Jun 07 19:46:57 2012 +0100
> +++ b/tools/configure Fri Jun 08 22:03:58 2012 +0200
> @@ -6062,7 +6062,7 @@ fi
>
> else
>
> - LIB_PATH="${libdir:`expr length "$exec_prefix" + 1`}"
> + LIB_PATH="${libdir:`expr length '${exec_prefix}/'`}"
>
> fi
>
> diff -r 32034d1914a6 -r fa21f847fc66 tools/m4/default_lib.m4
> --- a/tools/m4/default_lib.m4 Thu Jun 07 19:46:57 2012 +0100
> +++ b/tools/m4/default_lib.m4 Fri Jun 08 22:03:58 2012 +0200
> @@ -9,6 +9,6 @@ AC_DEFUN([AX_DEFAULT_LIB],
> LIB_PATH="lib"
> ])
> ], [.
> - LIB_PATH="${libdir:`expr length "$exec_prefix" + 1`}"
> + LIB_PATH="${libdir:`expr length '${exec_prefix}/'`}"
> ])
> AC_SUBST(LIB_PATH)])
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel [at] lists
> http://lists.xen.org/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel [at] lists
http://lists.xen.org/xen-devel


roger.pau at citrix

Jul 4, 2012, 4:26 AM

Post #3 of 5 (66 views)
Permalink
Re: [PATCH v2] tools, configure: Fix LIB_PATH computation in configure scripts [In reply to]

Ian Campbell wrote:
> On Fri, 2012-06-08 at 21:23 +0100, Boris Ostrovsky wrote:
>> # HG changeset patch
>> # User Boris Ostrovsky<boris.ostrovsky [at] amd>
>> # Date 1339185838 -7200
>> # Node ID fa21f847fc66619fad38923cd87d6ba51d731eba
>> # Parent 32034d1914a607d7b6f1f060352b4cac973600f8
>> tools, configure: Fix LIB_PATH computation in configure scripts
>>
>> tool's configure script sets LIB_PATH by chopping off ${exec_prefix}
>> from $libdir and it does so by computing length of ${exec_prefix} value.
>> However, $libdir's value is a literal '${exec_prefix}/lib' string
>> (i.e. $exec_prefix is not substituted) and therefore LIB_PATH may be
>> computed incorrectly, most likely as "c_prefix}/lib64" assuming that
>> exec_prefix is NONE.
>>
>> Instead, we should start at offset `expr length '${exec_prefix}/'
>> (which is 15).
>>
>> Signed-off-by: Boris Ostrovsky<boris.ostrovsky [at] amd>
>
> Boris, sorry for letting this languish for so long.
>
> Roger, any opinion on this patch?
>
> If I'm reading the script right this is the else clause of
> [AS_IF([test "\${exec_prefix}/lib" = "$libdir"],
>
> so at this point we know libdir != ${exec_prefix}/lib, is there any
> guarantee that it even starts with \${exec_prefix} ?
>
> I think this patch is complementary too rather than conflicting with /
> subsumed by Matt's "tools: honour --libdir when it is passed
> to ./configure" ?

I think this patch is not needed anymore if we apply Matt's one, since
Matt's patch gets rid of LIB_PATH usage, and instead uses exec_prefix
and libdir directly.

> Ian.
>
>> diff -r 32034d1914a6 -r fa21f847fc66 tools/configure
>> --- a/tools/configure Thu Jun 07 19:46:57 2012 +0100
>> +++ b/tools/configure Fri Jun 08 22:03:58 2012 +0200
>> @@ -6062,7 +6062,7 @@ fi
>>
>> else
>>
>> - LIB_PATH="${libdir:`expr length "$exec_prefix" + 1`}"
>> + LIB_PATH="${libdir:`expr length '${exec_prefix}/'`}"
>>
>> fi
>>
>> diff -r 32034d1914a6 -r fa21f847fc66 tools/m4/default_lib.m4
>> --- a/tools/m4/default_lib.m4 Thu Jun 07 19:46:57 2012 +0100
>> +++ b/tools/m4/default_lib.m4 Fri Jun 08 22:03:58 2012 +0200
>> @@ -9,6 +9,6 @@ AC_DEFUN([AX_DEFAULT_LIB],
>> LIB_PATH="lib"
>> ])
>> ], [.
>> - LIB_PATH="${libdir:`expr length "$exec_prefix" + 1`}"
>> + LIB_PATH="${libdir:`expr length '${exec_prefix}/'`}"
>> ])
>> AC_SUBST(LIB_PATH)])
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel [at] lists
>> http://lists.xen.org/xen-devel
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel [at] lists
> http://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel [at] lists
http://lists.xen.org/xen-devel


Ian.Campbell at citrix

Jul 4, 2012, 4:27 AM

Post #4 of 5 (65 views)
Permalink
Re: [PATCH v2] tools, configure: Fix LIB_PATH computation in configure scripts [In reply to]

On Wed, 2012-07-04 at 12:26 +0100, Roger Pau Monne wrote:
> Ian Campbell wrote:
> > On Fri, 2012-06-08 at 21:23 +0100, Boris Ostrovsky wrote:
> >> # HG changeset patch
> >> # User Boris Ostrovsky<boris.ostrovsky [at] amd>
> >> # Date 1339185838 -7200
> >> # Node ID fa21f847fc66619fad38923cd87d6ba51d731eba
> >> # Parent 32034d1914a607d7b6f1f060352b4cac973600f8
> >> tools, configure: Fix LIB_PATH computation in configure scripts
> >>
> >> tool's configure script sets LIB_PATH by chopping off ${exec_prefix}
> >> from $libdir and it does so by computing length of ${exec_prefix} value.
> >> However, $libdir's value is a literal '${exec_prefix}/lib' string
> >> (i.e. $exec_prefix is not substituted) and therefore LIB_PATH may be
> >> computed incorrectly, most likely as "c_prefix}/lib64" assuming that
> >> exec_prefix is NONE.
> >>
> >> Instead, we should start at offset `expr length '${exec_prefix}/'
> >> (which is 15).
> >>
> >> Signed-off-by: Boris Ostrovsky<boris.ostrovsky [at] amd>
> >
> > Boris, sorry for letting this languish for so long.
> >
> > Roger, any opinion on this patch?
> >
> > If I'm reading the script right this is the else clause of
> > [AS_IF([test "\${exec_prefix}/lib" = "$libdir"],
> >
> > so at this point we know libdir != ${exec_prefix}/lib, is there any
> > guarantee that it even starts with \${exec_prefix} ?
> >
> > I think this patch is complementary too rather than conflicting with /
> > subsumed by Matt's "tools: honour --libdir when it is passed
> > to ./configure" ?
>
> I think this patch is not needed anymore if we apply Matt's one, since
> Matt's patch gets rid of LIB_PATH usage, and instead uses exec_prefix
> and libdir directly.

So Matt's patch could/should remove tools/m4/default_lib.m4?

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel [at] lists
http://lists.xen.org/xen-devel


roger.pau at citrix

Jul 4, 2012, 4:31 AM

Post #5 of 5 (67 views)
Permalink
Re: [PATCH v2] tools, configure: Fix LIB_PATH computation in configure scripts [In reply to]

Ian Campbell wrote:
> On Wed, 2012-07-04 at 12:26 +0100, Roger Pau Monne wrote:
>> Ian Campbell wrote:
>>> On Fri, 2012-06-08 at 21:23 +0100, Boris Ostrovsky wrote:
>>>> # HG changeset patch
>>>> # User Boris Ostrovsky<boris.ostrovsky [at] amd>
>>>> # Date 1339185838 -7200
>>>> # Node ID fa21f847fc66619fad38923cd87d6ba51d731eba
>>>> # Parent 32034d1914a607d7b6f1f060352b4cac973600f8
>>>> tools, configure: Fix LIB_PATH computation in configure scripts
>>>>
>>>> tool's configure script sets LIB_PATH by chopping off ${exec_prefix}
>>>> from $libdir and it does so by computing length of ${exec_prefix} value.
>>>> However, $libdir's value is a literal '${exec_prefix}/lib' string
>>>> (i.e. $exec_prefix is not substituted) and therefore LIB_PATH may be
>>>> computed incorrectly, most likely as "c_prefix}/lib64" assuming that
>>>> exec_prefix is NONE.
>>>>
>>>> Instead, we should start at offset `expr length '${exec_prefix}/'
>>>> (which is 15).
>>>>
>>>> Signed-off-by: Boris Ostrovsky<boris.ostrovsky [at] amd>
>>> Boris, sorry for letting this languish for so long.
>>>
>>> Roger, any opinion on this patch?
>> >
>>> If I'm reading the script right this is the else clause of
>>> [AS_IF([test "\${exec_prefix}/lib" = "$libdir"],
>>>
>>> so at this point we know libdir != ${exec_prefix}/lib, is there any
>>> guarantee that it even starts with \${exec_prefix} ?
>>>
>>> I think this patch is complementary too rather than conflicting with /
>>> subsumed by Matt's "tools: honour --libdir when it is passed
>>> to ./configure" ?
>> I think this patch is not needed anymore if we apply Matt's one, since
>> Matt's patch gets rid of LIB_PATH usage, and instead uses exec_prefix
>> and libdir directly.
>
> So Matt's patch could/should remove tools/m4/default_lib.m4?

Yes, I've already replied to that thread also :)


_______________________________________________
Xen-devel mailing list
Xen-devel [at] lists
http://lists.xen.org/xen-devel

Xen devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.