[RTEMS Project] #4965: "trace" tool source requires C++17, build fails without it.

RTEMS trac trac at rtems.org
Fri Nov 10 07:55:25 UTC 2023


#4965: "trace" tool source requires C++17, build fails without it.
----------------------------+--------------------
  Reporter:  Michael South  |      Owner:  (none)
      Type:  defect         |     Status:  new
  Priority:  normal         |  Milestone:
 Component:  tool/rsb       |    Version:  7
  Severity:  blocker        |   Keywords:
Blocked By:                 |   Blocking:
----------------------------+--------------------
 sb-set-builder to build 7/rtems-arm fails with "C++17 needed" warnings and
 errors. If wscript is patched to include "-std=c++17" then the build is
 successful.

 **Attempted:**

 Build 7/arm on recentish Gentoo x86_64 build host.

 {{{
 git clone git://git.rtems.org/rtems-source-builder.git /XXX/rsb
 git clone git://git.rtems.org/rtems.git /XXX/kernel
 }}}

 {{{
 $ sb-set-builder --topdir=/XXX/rsb/rtems --prefix=/XXX/build/v7/tools 7
 /rtems-arm
 }}}

 **Build log:**

 {{{
 RTEMS Source Builder - Set Builder, 6 (633023de6517 modified)
  Command Line: /XXX/rsb/source-builder/sb-set-builder
 --topdir=/XXX/rsb/rtems --prefix=/XXX/build/v7/tools 7/rtems-arm
  Python: 3.11.5 (main, Oct  5 2023, 20:30:58) [GCC 12.3.1 20230526]
 Build Set: 7/rtems-arm
 Build Set: tools/rtems-default-tools.bset
 ...
 config: tools/rtems-tools-6.cfg
 package: rtems-tools-7dc34d2cabf5e9f77b6a9d035b01a75a6f593044-1
 ...
 + SB_HOST_CPPFLAGS=
 + SB_HOST_CFLAGS='-O2 -g -pipe '
 + SB_HOST_CXXFLAGS='-O2 -g -pipe '
 + SB_HOST_LDFLAGS=' -L/XXX/rsb/rtems/build/tmp/sb-500/tools/rtems-default-
 tools/XXX/build/v7/tools/lib'
 + SB_HOST_LIBS=
 + SB_BUILD_CFLAGS='-O2 -g -pipe -I/XXX/rsb/rtems/build/tmp/sb-500/tools
 /rtems-default-tools/XXX/build/v7/tools/include'
 + SB_BUILD_CXXFLAGS='-O2 -g -pipe -I/XXX/rsb/rtems/build/tmp/sb-500/tools
 /rtems-default-tools/XXX/build/v7/tools/include'
 + SB_BUILD_LDFLAGS=' -L/XXX/rsb/rtems/build/tmp/sb-500/tools/rtems-
 default-tools/XXX/build/v7/tools/lib'
 + SB_BUILD_LBS=
 + SB_CFLAGS='-O2 -g -pipe -I/XXX/rsb/rtems/build/tmp/sb-500/tools/rtems-
 default-tools/XXX/build/v7/tools/include '
 + SB_CXXFLAGS='-O2 -g -pipe -I/XXX/rsb/rtems/build/tmp/sb-500/tools/rtems-
 default-tools/XXX/build/v7/tools/include '
 + SB_ARCH=x86_64
 + SB_OS=linux
 ...
 [255/259] Compiling trace/record/record-filter-zlib.cc
 [256/259] Compiling trace/record/record-client-base.cc
 [257/259] Compiling trace/record/inih/ini.c
 In file included from /usr/lib/llvm/16/include/llvm/ADT/StringRef.h:12,
                  from
 /usr/lib/llvm/16/include/llvm/ADT/StringMapEntry.h:19,
                  from /usr/lib/llvm/16/include/llvm/ADT/StringMap.h:17,
                  from
 /usr/lib/llvm/16/include/llvm/DebugInfo/Symbolize/Symbolize.h:16,
                  from ../trace/record/record-main-lttng.cc:48:
 /usr/lib/llvm/16/include/llvm/ADT/DenseMapInfo.h:294:52: error: 'variant'
 is not a member of 'std'
   294 | template <typename... Ts> struct DenseMapInfo<std::variant<Ts...>>
 {
       |                                                    ^~~~~~~
 /usr/lib/llvm/16/include/llvm/ADT/DenseMapInfo.h:294:52: note:
 'std::variant' is only available from C++17 onwards
 /usr/lib/llvm/16/include/llvm/ADT/DenseMapInfo.h:294:52: error: 'variant'
 is not a member of 'std'
 }}}

 and it's all downhill from there

 {{{
 Waf: Leaving directory `/XXX/rsb/rtems/build/rtems-tools-
 7dc34d2cabf5e9f77b6a9d035b01a75a6f593044-1/rtems-tools-
 7dc34d2cabf5e9f77b6a9d035b01a75a6f593044/build'
 Build failed
  -> task in 'rtems-record-lttng' failed with exit status 1 (run with -v to
 display more information)
 shell cmd failed: /bin/sh -ex  /XXX/rsb/rtems/build/rtems-tools-
 7dc34d2cabf5e9f77b6a9d035b01a75a6f593044-1/do-build
 error: building rtems-tools-7dc34d2cabf5e9f77b6a9d035b01a75a6f593044-1
 }}}

 **Fix:**

 Patched to replace "-std=c++14" with "-std=c++17". Build and install was
 successful. (I'll send the patch to the mailing list.)

--
Ticket URL: <http://devel.rtems.org/ticket/4965>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list