[PATCH rtems-tools] trace: Use c++14 instead of c++11 if possible
Christian Mauderer
oss at c-mauderer.de
Thu Jul 23 16:31:35 UTC 2020
Hello Joel,
On 22/07/2020 21:39, Joel Sherrill wrote:
>
>
> On Wed, Jul 22, 2020 at 2:26 PM Christian Mauderer <oss at c-mauderer.de
> <mailto:oss at c-mauderer.de>> wrote:
>
> Ping again.
>
> It's clearly not BSP specific. So I would like to get an approval for
> that before pushing it anywhere.
>
>
> CentOS 7's gcc appears to have the option and I would assume this is the
> oldest distribution anyone is using.
Currently CentOS 6 is still supported (till end of this year). So that
would most likely be a better reference. But it's not really a problem:
The patch adds a check whether c++14 is available and uses it if it is.
If it is not available it will fall back to c++11 which is the same
cflag we had before. So it works on CentOS 6 too.
>
> $ gcc --version
> gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
>
> Go ahead and push it.
Thanks. I'll do that. I'll also update rtems-source-builder to use the
new version.
Best regards
Christian
>
> --joel
>
>
> On 15/06/2020 17:36, Christian Mauderer wrote:
> > Ping.
> >
> > Currently shouldn't be a matter for much hosts (less than 20 including
> > FreeBSD, Fedora, Arch, openSUSE according to distrowatch [1]) but I
> > assume that llvm 10 will spread fast.
> >
> >
> > [1]
> >
> http://distrowatch.org/search.php?pkg=llvm&relation=greaterequal&pkgver=10&distrorange=InLatest#pkgsearch
> >
> >
> > On 08/06/2020 08:52, Christian Mauderer wrote:
> >> llvm version 10 uses features from c++14 standard in the headers.
> With
> >> that, the record/record-main-lttng.cc doesn't build any more.
> This patch
> >> makes sure that c++14 is used if it is available.
> >> ---
> >> trace/wscript | 6 +++++-
> >> 1 file changed, 5 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/trace/wscript b/trace/wscript
> >> index 656f92b..53a1ab4 100644
> >> --- a/trace/wscript
> >> +++ b/trace/wscript
> >> @@ -45,6 +45,7 @@ def configure(conf):
> >> if conf.check(header_name='zlib.h', features='cxx',
> mandatory=False):
> >> conf.check_cxx(lib = 'z')
> >> conf.check_cxx(lib = 'ws2_32', mandatory=False)
> >> + conf.check_cxx(cxxflags='-std=c++14', mandatory=False,
> define_name="HAVE_STD_CXX14")
> >> conf.write_config_header('config.h')
> >>
> >> def build(bld):
> >> @@ -60,7 +61,10 @@ def build(bld):
> >> conf['warningflags'] = ['-Wall', '-Wextra', '-pedantic']
> >> conf['optflags'] = bld.env.C_OPTS
> >> conf['cflags'] = ['-pipe', '-g'] + conf['optflags']
> >> - conf['cxxflags'] = ['-std=c++11'] + conf['cflags']
> >> + cxxstd = '-std=c++11'
> >> + if bld.env.HAVE_STD_CXX14:
> >> + cxxstd = '-std=c++14'
> >> + conf['cxxflags'] = [cxxstd] + conf['cflags']
> >> conf['linkflags'] = ['-g']
> >> conf['lib'] = []
> >> if bld.env.LIB_WS2_32:
> >>
> > _______________________________________________
> > devel mailing list
> > devel at rtems.org <mailto:devel at rtems.org>
> > http://lists.rtems.org/mailman/listinfo/devel
> >
> _______________________________________________
> devel mailing list
> devel at rtems.org <mailto:devel at rtems.org>
> http://lists.rtems.org/mailman/listinfo/devel
>
More information about the devel
mailing list