diff mbox

[Ping] Port of VTV for Cygwin and MinGW

Message ID 54CA78F1.1020204@ubuntu.com
State New
Headers show

Commit Message

Matthias Klose Jan. 29, 2015, 6:16 p.m. UTC
On 01/29/2015 07:12 PM, H.J. Lu wrote:
> On Thu, Jan 29, 2015 at 10:05 AM, Matthias Klose <doko@ubuntu.com> wrote:
>> that fixes the build failure. ok to commit?
>>
>> 2015-01-29  Matthias Klose  <doko@ubuntu.com>
>>
>>         * acinclude.m4 (GLIBCXX_ENABLE_VTABLE_VERIFY): Define VTV_CYGMIN
>>         unconditionally.
>>         * configure: Regenerate.
>>
> 
>  This is wrong.  You are checking vtv_cygmin before it is defined.

my bad, somebody should obviously build both variants ... now testing this variant.

Comments

Jakub Jelinek Jan. 29, 2015, 6:26 p.m. UTC | #1
On Thu, Jan 29, 2015 at 07:16:17PM +0100, Matthias Klose wrote:
> On 01/29/2015 07:12 PM, H.J. Lu wrote:
> > On Thu, Jan 29, 2015 at 10:05 AM, Matthias Klose <doko@ubuntu.com> wrote:
> >> that fixes the build failure. ok to commit?
> >>
> >> 2015-01-29  Matthias Klose  <doko@ubuntu.com>
> >>
> >>         * acinclude.m4 (GLIBCXX_ENABLE_VTABLE_VERIFY): Define VTV_CYGMIN
> >>         unconditionally.
> >>         * configure: Regenerate.
> >>
> > 
> >  This is wrong.  You are checking vtv_cygmin before it is defined.
> 
> my bad, somebody should obviously build both variants ... now testing this variant.

Even with this patch vtv_cygmin is uninitialized.  It will be likely empty
string, unless somebody has vtv_cygmin in the environment, but it is better
to initialize it, see the patch I've posted.

> --- acinclude.m4        (revision 220257)
> +++ acinclude.m4        (working copy)
> @@ -2320,8 +2320,6 @@
>    AC_MSG_CHECKING([for vtable verify support])
>    AC_MSG_RESULT([$enable_vtable_verify])
> 
> -  AM_CONDITIONAL(VTV_CYGMIN, test $vtv_cygmin = yes)
> -
>    if test $enable_vtable_verify = yes; then
>      case ${target_os} in
>        cygwin*|mingw32*)
> @@ -2341,6 +2339,8 @@
>      VTV_CXXLINKFLAGS=
>    fi
> 
> +  AM_CONDITIONAL(VTV_CYGMIN, test $vtv_cygmin = yes)
> +
>    AC_SUBST(VTV_CXXFLAGS)
>    AC_SUBST(VTV_PCH_CXXFLAGS)
>    AC_SUBST(VTV_CXXLINKFLAGS)
> 

	Jakub
H.J. Lu Jan. 29, 2015, 6:28 p.m. UTC | #2
On Thu, Jan 29, 2015 at 10:26 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Thu, Jan 29, 2015 at 07:16:17PM +0100, Matthias Klose wrote:
>> On 01/29/2015 07:12 PM, H.J. Lu wrote:
>> > On Thu, Jan 29, 2015 at 10:05 AM, Matthias Klose <doko@ubuntu.com> wrote:
>> >> that fixes the build failure. ok to commit?
>> >>
>> >> 2015-01-29  Matthias Klose  <doko@ubuntu.com>
>> >>
>> >>         * acinclude.m4 (GLIBCXX_ENABLE_VTABLE_VERIFY): Define VTV_CYGMIN
>> >>         unconditionally.
>> >>         * configure: Regenerate.
>> >>
>> >
>> >  This is wrong.  You are checking vtv_cygmin before it is defined.
>>
>> my bad, somebody should obviously build both variants ... now testing this variant.
>
> Even with this patch vtv_cygmin is uninitialized.  It will be likely empty
> string, unless somebody has vtv_cygmin in the environment, but it is better
> to initialize it, see the patch I've posted.
>
>> --- acinclude.m4        (revision 220257)
>> +++ acinclude.m4        (working copy)
>> @@ -2320,8 +2320,6 @@
>>    AC_MSG_CHECKING([for vtable verify support])
>>    AC_MSG_RESULT([$enable_vtable_verify])
>>
>> -  AM_CONDITIONAL(VTV_CYGMIN, test $vtv_cygmin = yes)
>> -
>>    if test $enable_vtable_verify = yes; then
>>      case ${target_os} in
>>        cygwin*|mingw32*)
>> @@ -2341,6 +2339,8 @@
>>      VTV_CXXLINKFLAGS=
>>    fi
>>
>> +  AM_CONDITIONAL(VTV_CYGMIN, test $vtv_cygmin = yes)
>> +
>

Or we can just do

AM_CONDITIONAL(VTV_CYGMIN, test x$vtv_cygmin = xyes)
Jakub Jelinek Jan. 29, 2015, 6:30 p.m. UTC | #3
On Thu, Jan 29, 2015 at 10:28:17AM -0800, H.J. Lu wrote:
> >> --- acinclude.m4        (revision 220257)
> >> +++ acinclude.m4        (working copy)
> >> @@ -2320,8 +2320,6 @@
> >>    AC_MSG_CHECKING([for vtable verify support])
> >>    AC_MSG_RESULT([$enable_vtable_verify])
> >>
> >> -  AM_CONDITIONAL(VTV_CYGMIN, test $vtv_cygmin = yes)
> >> -
> >>    if test $enable_vtable_verify = yes; then
> >>      case ${target_os} in
> >>        cygwin*|mingw32*)
> >> @@ -2341,6 +2339,8 @@
> >>      VTV_CXXLINKFLAGS=
> >>    fi
> >>
> >> +  AM_CONDITIONAL(VTV_CYGMIN, test $vtv_cygmin = yes)
> >> +
> >
> 
> Or we can just do
> 
> AM_CONDITIONAL(VTV_CYGMIN, test x$vtv_cygmin = xyes)

Or that, but that is not what you've checked in.
Some shells will be upset about test $vtv_cygmin = yes when
$vtv_cygmin expands to empty string.

	Jakub
H.J. Lu Jan. 29, 2015, 6:34 p.m. UTC | #4
On Thu, Jan 29, 2015 at 10:30 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Thu, Jan 29, 2015 at 10:28:17AM -0800, H.J. Lu wrote:
>> >> --- acinclude.m4        (revision 220257)
>> >> +++ acinclude.m4        (working copy)
>> >> @@ -2320,8 +2320,6 @@
>> >>    AC_MSG_CHECKING([for vtable verify support])
>> >>    AC_MSG_RESULT([$enable_vtable_verify])
>> >>
>> >> -  AM_CONDITIONAL(VTV_CYGMIN, test $vtv_cygmin = yes)
>> >> -
>> >>    if test $enable_vtable_verify = yes; then
>> >>      case ${target_os} in
>> >>        cygwin*|mingw32*)
>> >> @@ -2341,6 +2339,8 @@
>> >>      VTV_CXXLINKFLAGS=
>> >>    fi
>> >>
>> >> +  AM_CONDITIONAL(VTV_CYGMIN, test $vtv_cygmin = yes)
>> >> +
>> >
>>
>> Or we can just do
>>
>> AM_CONDITIONAL(VTV_CYGMIN, test x$vtv_cygmin = xyes)
>
> Or that, but that is not what you've checked in.
> Some shells will be upset about test $vtv_cygmin = yes when
> $vtv_cygmin expands to empty string.
>

Yes, I got

checking for vtable verify support... no
/export/gnu/import/git/sources/gcc/libstdc++-v3/configure: line 17481:
test: =: unary operator expected

At least it doesn't stop bootstrap.  Either fix is fine with me.
diff mbox

Patch

Index: acinclude.m4
===================================================================
--- acinclude.m4        (revision 220257)
+++ acinclude.m4        (working copy)
@@ -2320,8 +2320,6 @@ 
   AC_MSG_CHECKING([for vtable verify support])
   AC_MSG_RESULT([$enable_vtable_verify])

-  AM_CONDITIONAL(VTV_CYGMIN, test $vtv_cygmin = yes)
-
   if test $enable_vtable_verify = yes; then
     case ${target_os} in
       cygwin*|mingw32*)
@@ -2341,6 +2339,8 @@ 
     VTV_CXXLINKFLAGS=
   fi

+  AM_CONDITIONAL(VTV_CYGMIN, test $vtv_cygmin = yes)
+
   AC_SUBST(VTV_CXXFLAGS)
   AC_SUBST(VTV_PCH_CXXFLAGS)
   AC_SUBST(VTV_CXXLINKFLAGS)