All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH lttng-ust] Fix: Check g++ version before compiling 'hello.cxx' test
       [not found] <CAJ7wx-GFwfJ_yM6wSyydKuOxY3SQt37Zzs1UJTW3u7c7_cB8Uw@mail.gmail.com>
@ 2013-06-15 18:31 ` Christian Babeux
       [not found] ` <CAGDH53m4VBdcMO1hk4EcPP4b4n38UtVt68g6OQsrihboZgsATw@mail.gmail.com>
  1 sibling, 0 replies; 5+ messages in thread
From: Christian Babeux @ 2013-06-15 18:31 UTC (permalink / raw)
  To: Zifei Tong; +Cc: lttng-dev

Hi Zifei,

Checking specific version numbers might be a bit counterproductive
(e.g. what if some embedded platform as a GCC 4.7 with designated
initializer explicitly patched out?).

Going forward, I think checking for the designated initializer feature
via a small C++ testfile is more in line with the Autoconf philosophy.
Also, we should conditionally disable the compilation of the
tracepoint probes requiring designated initializers if not supported.

Thanks,

Christian

On Sat, Jun 15, 2013 at 2:08 PM, Zifei Tong <soariez@gmail.com> wrote:
> Designated initializer support that is required to compile c++
> tracepoint probes is only available since g++ 4.7.
>
> Fixes #557
>
> Signed-off-by: Zifei Tong <soariez@gmail.com>
> ---
>  README       |  3 ++-
>  configure.ac | 16 ++++++++++++++--
>  2 files changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/README b/README
> index 1f6b9d2..1c7a2f8 100644
> --- a/README
> +++ b/README
> @@ -111,7 +111,8 @@ USAGE:
>    - Enable instrumentation and control tracing with the "lttng" command
>      from lttng-tools. See lttng-tools doc/quickstart.txt.
>    - Note for C++ support: since LTTng-UST 2.3, both tracepoints and
> -    tracepoint probes can be compiled with g++.
> +    tracepoint probes can be compiled with g++. To compile tracepoint probes
> +    in g++, you need version 4.7 or above.
>
>
>  ENVIRONMENT VARIABLES:
> diff --git a/configure.ac b/configure.ac
> index 802ccaa..85a64a1 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -83,9 +83,21 @@ AC_CACHE_CHECK([whether the C++ compiler works],
>                 [rw_cv_prog_cxx_works],
>                 [AC_LANG_PUSH([C++])
>                 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
> -                               [rw_cv_prog_cxx_works=yes],
> +                               [check_gcc_cxx_version=yes],
>                                 [rw_cv_prog_cxx_works=no])
> -               AC_LANG_POP([C++])])
> +               AC_LANG_POP([C++])
> +               if test "$check_gcc_cxx_version" = "yes"; then
> +                       gcc_cxx_version=`$CXX -dumpversion`
> +                       gcc_cxx_major_version=$(echo $gcc_cxx_version | sed
> 's/^\([[0-9]]*\)\.[[0-9]]*.*$/\1/')
> +                       gcc_cxx_minor_version=$(echo $gcc_cxx_version | sed
> 's/^[[0-9]]*\.\([[0-9]]*\).*$/\1/')
> +                       if test "$gcc_cxx_major_version" -gt 4; then
> +                               rw_cv_prog_cxx_works="yes"
> +                       elif test "$gcc_cxx_major_version" -eq 4 -a
> "$gcc_cxx_minor_version" -ge 7; then
> +                               rw_cv_prog_cxx_works="yes"
> +                       else
> +                               rw_cv_prog_cxx_works="no"
> +                       fi
> +               fi])
>
>  AM_CONDITIONAL([CXX_WORKS], [test "x$rw_cv_prog_cxx_works" = "xyes"])
>
> --
> 1.8.3.1
>
> --
> Best Regards,
> 仝子飞 (Zifei Tong)
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH lttng-ust] Fix: Check g++ version before compiling 'hello.cxx' test
       [not found] ` <CAGDH53m4VBdcMO1hk4EcPP4b4n38UtVt68g6OQsrihboZgsATw@mail.gmail.com>
@ 2013-06-15 18:37   ` Mathieu Desnoyers
       [not found]   ` <20130615183726.GA13832@Krystal>
  1 sibling, 0 replies; 5+ messages in thread
From: Mathieu Desnoyers @ 2013-06-15 18:37 UTC (permalink / raw)
  To: Christian Babeux; +Cc: lttng-dev

* Christian Babeux (christian.babeux@efficios.com) wrote:
> Hi Zifei,
> 
> Checking specific version numbers might be a bit counterproductive
> (e.g. what if some embedded platform as a GCC 4.7 with designated
> initializer explicitly patched out?).
> 
> Going forward, I think checking for the designated initializer feature
> via a small C++ testfile is more in line with the Autoconf philosophy.
> Also, we should conditionally disable the compilation of the
> tracepoint probes requiring designated initializers if not supported.

Moreover, the documentation and patches should take LLVM into account.

Thanks,

Mathieu

> 
> Thanks,
> 
> Christian
> 
> On Sat, Jun 15, 2013 at 2:08 PM, Zifei Tong <soariez@gmail.com> wrote:
> > Designated initializer support that is required to compile c++
> > tracepoint probes is only available since g++ 4.7.
> >
> > Fixes #557
> >
> > Signed-off-by: Zifei Tong <soariez@gmail.com>
> > ---
> >  README       |  3 ++-
> >  configure.ac | 16 ++++++++++++++--
> >  2 files changed, 16 insertions(+), 3 deletions(-)
> >
> > diff --git a/README b/README
> > index 1f6b9d2..1c7a2f8 100644
> > --- a/README
> > +++ b/README
> > @@ -111,7 +111,8 @@ USAGE:
> >    - Enable instrumentation and control tracing with the "lttng" command
> >      from lttng-tools. See lttng-tools doc/quickstart.txt.
> >    - Note for C++ support: since LTTng-UST 2.3, both tracepoints and
> > -    tracepoint probes can be compiled with g++.
> > +    tracepoint probes can be compiled with g++. To compile tracepoint probes
> > +    in g++, you need version 4.7 or above.
> >
> >
> >  ENVIRONMENT VARIABLES:
> > diff --git a/configure.ac b/configure.ac
> > index 802ccaa..85a64a1 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -83,9 +83,21 @@ AC_CACHE_CHECK([whether the C++ compiler works],
> >                 [rw_cv_prog_cxx_works],
> >                 [AC_LANG_PUSH([C++])
> >                 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
> > -                               [rw_cv_prog_cxx_works=yes],
> > +                               [check_gcc_cxx_version=yes],
> >                                 [rw_cv_prog_cxx_works=no])
> > -               AC_LANG_POP([C++])])
> > +               AC_LANG_POP([C++])
> > +               if test "$check_gcc_cxx_version" = "yes"; then
> > +                       gcc_cxx_version=`$CXX -dumpversion`
> > +                       gcc_cxx_major_version=$(echo $gcc_cxx_version | sed
> > 's/^\([[0-9]]*\)\.[[0-9]]*.*$/\1/')
> > +                       gcc_cxx_minor_version=$(echo $gcc_cxx_version | sed
> > 's/^[[0-9]]*\.\([[0-9]]*\).*$/\1/')
> > +                       if test "$gcc_cxx_major_version" -gt 4; then
> > +                               rw_cv_prog_cxx_works="yes"
> > +                       elif test "$gcc_cxx_major_version" -eq 4 -a
> > "$gcc_cxx_minor_version" -ge 7; then
> > +                               rw_cv_prog_cxx_works="yes"
> > +                       else
> > +                               rw_cv_prog_cxx_works="no"
> > +                       fi
> > +               fi])
> >
> >  AM_CONDITIONAL([CXX_WORKS], [test "x$rw_cv_prog_cxx_works" = "xyes"])
> >
> > --
> > 1.8.3.1
> >
> > --
> > Best Regards,
> > 仝子飞 (Zifei Tong)
> >
> > _______________________________________________
> > lttng-dev mailing list
> > lttng-dev@lists.lttng.org
> > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH lttng-ust] Fix: Check g++ version before compiling 'hello.cxx' test
       [not found]   ` <20130615183726.GA13832@Krystal>
@ 2013-06-18 12:13     ` Zifei Tong
       [not found]     ` <CAJ7wx-G_eoCvxvsamFbJVVTLy4RX_TqfoJeSZh7DBmb3=68Lxg@mail.gmail.com>
  1 sibling, 0 replies; 5+ messages in thread
From: Zifei Tong @ 2013-06-18 12:13 UTC (permalink / raw)
  To: Mathieu Desnoyers; +Cc: lttng-dev

I've updated the patch addressing the problems mentioned earlier.

> Going forward, I think checking for the designated initializer feature
> via a small C++ testfile is more in line with the Autoconf philosophy.

> Moreover, the documentation and patches should take LLVM into account.

Tested on a Ububtu system with g++ 4.6, g++ 4.7 and clang++.

Fix: Check C++ designated initializers support before compiling 'hello.cxx' test

Fixes #557

Signed-off-by: Zifei Tong <soariez@gmail.com>
---
 README       |  3 ++-
 configure.ac | 15 ++++++++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/README b/README
index 1f6b9d2..a2ff00b 100644
--- a/README
+++ b/README
@@ -111,7 +111,8 @@ USAGE:
   - Enable instrumentation and control tracing with the "lttng" command
     from lttng-tools. See lttng-tools doc/quickstart.txt.
   - Note for C++ support: since LTTng-UST 2.3, both tracepoints and
-    tracepoint probes can be compiled with g++.
+    tracepoint probes can be compiled in C++. To compile tracepoint probes
+    in C++, you need g++ >= 4.7 or Clang.


 ENVIRONMENT VARIABLES:
diff --git a/configure.ac b/configure.ac
index 802ccaa..0bc7992 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,8 +83,21 @@ AC_CACHE_CHECK([whether the C++ compiler works],
 		[rw_cv_prog_cxx_works],
 		[AC_LANG_PUSH([C++])
 		AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
-				[rw_cv_prog_cxx_works=yes],
+				[check_cxx_designated_initializers=yes],
 				[rw_cv_prog_cxx_works=no])
+		if test "$check_cxx_designated_initializers" = "yes"; then
+			AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+				struct foo { int a; int b; };
+				void fct(void)
+				{
+					struct foo f = {.a = 0, .b = 1};
+				}
+			]])],[
+				rw_cv_prog_cxx_works=yes
+			],[
+				rw_cv_prog_cxx_works=no
+			])
+		fi
 		AC_LANG_POP([C++])])

 AM_CONDITIONAL([CXX_WORKS], [test "x$rw_cv_prog_cxx_works" = "xyes"])
-- 
1.8.3.1

On 6/16/13, Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:
> * Christian Babeux (christian.babeux@efficios.com) wrote:
>> Hi Zifei,
>>
>> Checking specific version numbers might be a bit counterproductive
>> (e.g. what if some embedded platform as a GCC 4.7 with designated
>> initializer explicitly patched out?).
>>
>> Going forward, I think checking for the designated initializer feature
>> via a small C++ testfile is more in line with the Autoconf philosophy.
>> Also, we should conditionally disable the compilation of the
>> tracepoint probes requiring designated initializers if not supported.
>
> Moreover, the documentation and patches should take LLVM into account.
>
> Thanks,
>
> Mathieu
>
>>
>> Thanks,
>>
>> Christian
>>
>> On Sat, Jun 15, 2013 at 2:08 PM, Zifei Tong <soariez@gmail.com> wrote:
>> > Designated initializer support that is required to compile c++
>> > tracepoint probes is only available since g++ 4.7.
>> >
>> > Fixes #557
>> >
>> > Signed-off-by: Zifei Tong <soariez@gmail.com>
>> > ---
>> >  README       |  3 ++-
>> >  configure.ac | 16 ++++++++++++++--
>> >  2 files changed, 16 insertions(+), 3 deletions(-)
>> >
>> > diff --git a/README b/README
>> > index 1f6b9d2..1c7a2f8 100644
>> > --- a/README
>> > +++ b/README
>> > @@ -111,7 +111,8 @@ USAGE:
>> >    - Enable instrumentation and control tracing with the "lttng"
>> > command
>> >      from lttng-tools. See lttng-tools doc/quickstart.txt.
>> >    - Note for C++ support: since LTTng-UST 2.3, both tracepoints and
>> > -    tracepoint probes can be compiled with g++.
>> > +    tracepoint probes can be compiled with g++. To compile tracepoint
>> > probes
>> > +    in g++, you need version 4.7 or above.
>> >
>> >
>> >  ENVIRONMENT VARIABLES:
>> > diff --git a/configure.ac b/configure.ac
>> > index 802ccaa..85a64a1 100644
>> > --- a/configure.ac
>> > +++ b/configure.ac
>> > @@ -83,9 +83,21 @@ AC_CACHE_CHECK([whether the C++ compiler works],
>> >                 [rw_cv_prog_cxx_works],
>> >                 [AC_LANG_PUSH([C++])
>> >                 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
>> > -                               [rw_cv_prog_cxx_works=yes],
>> > +                               [check_gcc_cxx_version=yes],
>> >                                 [rw_cv_prog_cxx_works=no])
>> > -               AC_LANG_POP([C++])])
>> > +               AC_LANG_POP([C++])
>> > +               if test "$check_gcc_cxx_version" = "yes"; then
>> > +                       gcc_cxx_version=`$CXX -dumpversion`
>> > +                       gcc_cxx_major_version=$(echo $gcc_cxx_version |
>> > sed
>> > 's/^\([[0-9]]*\)\.[[0-9]]*.*$/\1/')
>> > +                       gcc_cxx_minor_version=$(echo $gcc_cxx_version |
>> > sed
>> > 's/^[[0-9]]*\.\([[0-9]]*\).*$/\1/')
>> > +                       if test "$gcc_cxx_major_version" -gt 4; then
>> > +                               rw_cv_prog_cxx_works="yes"
>> > +                       elif test "$gcc_cxx_major_version" -eq 4 -a
>> > "$gcc_cxx_minor_version" -ge 7; then
>> > +                               rw_cv_prog_cxx_works="yes"
>> > +                       else
>> > +                               rw_cv_prog_cxx_works="no"
>> > +                       fi
>> > +               fi])
>> >
>> >  AM_CONDITIONAL([CXX_WORKS], [test "x$rw_cv_prog_cxx_works" = "xyes"])
>> >
>> > --
>> > 1.8.3.1
>> >
>> > --
>> > Best Regards,
>> > 仝子飞 (Zifei Tong)
>> >
>> > _______________________________________________
>> > lttng-dev mailing list
>> > lttng-dev@lists.lttng.org
>> > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>>
>> _______________________________________________
>> lttng-dev mailing list
>> lttng-dev@lists.lttng.org
>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
> --
> Mathieu Desnoyers
> EfficiOS Inc.
> http://www.efficios.com
>

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH lttng-ust] Fix: Check g++ version before compiling 'hello.cxx' test
       [not found]     ` <CAJ7wx-G_eoCvxvsamFbJVVTLy4RX_TqfoJeSZh7DBmb3=68Lxg@mail.gmail.com>
@ 2013-06-18 13:50       ` Mathieu Desnoyers
  0 siblings, 0 replies; 5+ messages in thread
From: Mathieu Desnoyers @ 2013-06-18 13:50 UTC (permalink / raw)
  To: Zifei Tong; +Cc: lttng-dev

* Zifei Tong (soariez@gmail.com) wrote:
> I've updated the patch addressing the problems mentioned earlier.
> 
> > Going forward, I think checking for the designated initializer feature
> > via a small C++ testfile is more in line with the Autoconf philosophy.
> 
> > Moreover, the documentation and patches should take LLVM into account.
> 
> Tested on a Ububtu system with g++ 4.6, g++ 4.7 and clang++.
> 
> Fix: Check C++ designated initializers support before compiling 'hello.cxx' test
> 

merged into master, with a tiny coding style fix in the test snippet.

Thanks !

Mathieu

> Fixes #557
> 
> Signed-off-by: Zifei Tong <soariez@gmail.com>
> ---
>  README       |  3 ++-
>  configure.ac | 15 ++++++++++++++-
>  2 files changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/README b/README
> index 1f6b9d2..a2ff00b 100644
> --- a/README
> +++ b/README
> @@ -111,7 +111,8 @@ USAGE:
>    - Enable instrumentation and control tracing with the "lttng" command
>      from lttng-tools. See lttng-tools doc/quickstart.txt.
>    - Note for C++ support: since LTTng-UST 2.3, both tracepoints and
> -    tracepoint probes can be compiled with g++.
> +    tracepoint probes can be compiled in C++. To compile tracepoint probes
> +    in C++, you need g++ >= 4.7 or Clang.
> 
> 
>  ENVIRONMENT VARIABLES:
> diff --git a/configure.ac b/configure.ac
> index 802ccaa..0bc7992 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -83,8 +83,21 @@ AC_CACHE_CHECK([whether the C++ compiler works],
>  		[rw_cv_prog_cxx_works],
>  		[AC_LANG_PUSH([C++])
>  		AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
> -				[rw_cv_prog_cxx_works=yes],
> +				[check_cxx_designated_initializers=yes],
>  				[rw_cv_prog_cxx_works=no])
> +		if test "$check_cxx_designated_initializers" = "yes"; then
> +			AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
> +				struct foo { int a; int b; };
> +				void fct(void)
> +				{
> +					struct foo f = {.a = 0, .b = 1};
> +				}
> +			]])],[
> +				rw_cv_prog_cxx_works=yes
> +			],[
> +				rw_cv_prog_cxx_works=no
> +			])
> +		fi
>  		AC_LANG_POP([C++])])
> 
>  AM_CONDITIONAL([CXX_WORKS], [test "x$rw_cv_prog_cxx_works" = "xyes"])
> -- 
> 1.8.3.1
> 
> On 6/16/13, Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:
> > * Christian Babeux (christian.babeux@efficios.com) wrote:
> >> Hi Zifei,
> >>
> >> Checking specific version numbers might be a bit counterproductive
> >> (e.g. what if some embedded platform as a GCC 4.7 with designated
> >> initializer explicitly patched out?).
> >>
> >> Going forward, I think checking for the designated initializer feature
> >> via a small C++ testfile is more in line with the Autoconf philosophy.
> >> Also, we should conditionally disable the compilation of the
> >> tracepoint probes requiring designated initializers if not supported.
> >
> > Moreover, the documentation and patches should take LLVM into account.
> >
> > Thanks,
> >
> > Mathieu
> >
> >>
> >> Thanks,
> >>
> >> Christian
> >>
> >> On Sat, Jun 15, 2013 at 2:08 PM, Zifei Tong <soariez@gmail.com> wrote:
> >> > Designated initializer support that is required to compile c++
> >> > tracepoint probes is only available since g++ 4.7.
> >> >
> >> > Fixes #557
> >> >
> >> > Signed-off-by: Zifei Tong <soariez@gmail.com>
> >> > ---
> >> >  README       |  3 ++-
> >> >  configure.ac | 16 ++++++++++++++--
> >> >  2 files changed, 16 insertions(+), 3 deletions(-)
> >> >
> >> > diff --git a/README b/README
> >> > index 1f6b9d2..1c7a2f8 100644
> >> > --- a/README
> >> > +++ b/README
> >> > @@ -111,7 +111,8 @@ USAGE:
> >> >    - Enable instrumentation and control tracing with the "lttng"
> >> > command
> >> >      from lttng-tools. See lttng-tools doc/quickstart.txt.
> >> >    - Note for C++ support: since LTTng-UST 2.3, both tracepoints and
> >> > -    tracepoint probes can be compiled with g++.
> >> > +    tracepoint probes can be compiled with g++. To compile tracepoint
> >> > probes
> >> > +    in g++, you need version 4.7 or above.
> >> >
> >> >
> >> >  ENVIRONMENT VARIABLES:
> >> > diff --git a/configure.ac b/configure.ac
> >> > index 802ccaa..85a64a1 100644
> >> > --- a/configure.ac
> >> > +++ b/configure.ac
> >> > @@ -83,9 +83,21 @@ AC_CACHE_CHECK([whether the C++ compiler works],
> >> >                 [rw_cv_prog_cxx_works],
> >> >                 [AC_LANG_PUSH([C++])
> >> >                 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
> >> > -                               [rw_cv_prog_cxx_works=yes],
> >> > +                               [check_gcc_cxx_version=yes],
> >> >                                 [rw_cv_prog_cxx_works=no])
> >> > -               AC_LANG_POP([C++])])
> >> > +               AC_LANG_POP([C++])
> >> > +               if test "$check_gcc_cxx_version" = "yes"; then
> >> > +                       gcc_cxx_version=`$CXX -dumpversion`
> >> > +                       gcc_cxx_major_version=$(echo $gcc_cxx_version |
> >> > sed
> >> > 's/^\([[0-9]]*\)\.[[0-9]]*.*$/\1/')
> >> > +                       gcc_cxx_minor_version=$(echo $gcc_cxx_version |
> >> > sed
> >> > 's/^[[0-9]]*\.\([[0-9]]*\).*$/\1/')
> >> > +                       if test "$gcc_cxx_major_version" -gt 4; then
> >> > +                               rw_cv_prog_cxx_works="yes"
> >> > +                       elif test "$gcc_cxx_major_version" -eq 4 -a
> >> > "$gcc_cxx_minor_version" -ge 7; then
> >> > +                               rw_cv_prog_cxx_works="yes"
> >> > +                       else
> >> > +                               rw_cv_prog_cxx_works="no"
> >> > +                       fi
> >> > +               fi])
> >> >
> >> >  AM_CONDITIONAL([CXX_WORKS], [test "x$rw_cv_prog_cxx_works" = "xyes"])
> >> >
> >> > --
> >> > 1.8.3.1
> >> >
> >> > --
> >> > Best Regards,
> >> > 仝子飞 (Zifei Tong)
> >> >
> >> > _______________________________________________
> >> > lttng-dev mailing list
> >> > lttng-dev@lists.lttng.org
> >> > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> >>
> >> _______________________________________________
> >> lttng-dev mailing list
> >> lttng-dev@lists.lttng.org
> >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> >
> > --
> > Mathieu Desnoyers
> > EfficiOS Inc.
> > http://www.efficios.com
> >

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH lttng-ust] Fix: Check g++ version before compiling 'hello.cxx' test
@ 2013-06-15 18:08 Zifei Tong
  0 siblings, 0 replies; 5+ messages in thread
From: Zifei Tong @ 2013-06-15 18:08 UTC (permalink / raw)
  To: lttng-dev

Designated initializer support that is required to compile c++
tracepoint probes is only available since g++ 4.7.

Fixes #557

Signed-off-by: Zifei Tong <soariez@gmail.com>
---
 README       |  3 ++-
 configure.ac | 16 ++++++++++++++--
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/README b/README
index 1f6b9d2..1c7a2f8 100644
--- a/README
+++ b/README
@@ -111,7 +111,8 @@ USAGE:
   - Enable instrumentation and control tracing with the "lttng" command
     from lttng-tools. See lttng-tools doc/quickstart.txt.
   - Note for C++ support: since LTTng-UST 2.3, both tracepoints and
-    tracepoint probes can be compiled with g++.
+    tracepoint probes can be compiled with g++. To compile tracepoint probes
+    in g++, you need version 4.7 or above.


 ENVIRONMENT VARIABLES:
diff --git a/configure.ac b/configure.ac
index 802ccaa..85a64a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,9 +83,21 @@ AC_CACHE_CHECK([whether the C++ compiler works],
 		[rw_cv_prog_cxx_works],
 		[AC_LANG_PUSH([C++])
 		AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
-				[rw_cv_prog_cxx_works=yes],
+				[check_gcc_cxx_version=yes],
 				[rw_cv_prog_cxx_works=no])
-		AC_LANG_POP([C++])])
+		AC_LANG_POP([C++])
+		if test "$check_gcc_cxx_version" = "yes"; then
+			gcc_cxx_version=`$CXX -dumpversion`
+			gcc_cxx_major_version=$(echo $gcc_cxx_version | sed
's/^\([[0-9]]*\)\.[[0-9]]*.*$/\1/')
+			gcc_cxx_minor_version=$(echo $gcc_cxx_version | sed
's/^[[0-9]]*\.\([[0-9]]*\).*$/\1/')
+			if test "$gcc_cxx_major_version" -gt 4; then
+				rw_cv_prog_cxx_works="yes"
+			elif test "$gcc_cxx_major_version" -eq 4 -a
"$gcc_cxx_minor_version" -ge 7; then
+				rw_cv_prog_cxx_works="yes"
+			else
+				rw_cv_prog_cxx_works="no"
+			fi
+		fi])

 AM_CONDITIONAL([CXX_WORKS], [test "x$rw_cv_prog_cxx_works" = "xyes"])

-- 
1.8.3.1

-- 
Best Regards,
仝子飞 (Zifei Tong)

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-06-18 13:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAJ7wx-GFwfJ_yM6wSyydKuOxY3SQt37Zzs1UJTW3u7c7_cB8Uw@mail.gmail.com>
2013-06-15 18:31 ` [PATCH lttng-ust] Fix: Check g++ version before compiling 'hello.cxx' test Christian Babeux
     [not found] ` <CAGDH53m4VBdcMO1hk4EcPP4b4n38UtVt68g6OQsrihboZgsATw@mail.gmail.com>
2013-06-15 18:37   ` Mathieu Desnoyers
     [not found]   ` <20130615183726.GA13832@Krystal>
2013-06-18 12:13     ` Zifei Tong
     [not found]     ` <CAJ7wx-G_eoCvxvsamFbJVVTLy4RX_TqfoJeSZh7DBmb3=68Lxg@mail.gmail.com>
2013-06-18 13:50       ` Mathieu Desnoyers
2013-06-15 18:08 Zifei Tong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.