Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-36156

building MSAN -stdlib=libc++ test requires -fsanitize=memory

Details

    Description

      MDEV-34996 was incomplete it its testing of -stdlib=libc++ as this required -fsanitize=memory

      The MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=memory prior to MY_CHECK_CXX_COMPILER_FLAG("-stdlib=libc++") doesn't set the CMAKE_REQUIRED_FLAGS so results in:

      /source/CMakeLists.txt(249):  MY_CHECK_CXX_COMPILER_FLAG(-stdlib=libc++ )
      /source/cmake/check_compiler_flag.cmake(28):  STRING(REGEX REPLACE [-,= +] _ result have_CXX_-stdlib=libc++ )
      /source/cmake/check_compiler_flag.cmake(29):  SET(SAVE_CMAKE_REQUIRED_FLAGS  )
      /source/cmake/check_compiler_flag.cmake(30):  SET(CMAKE_REQUIRED_FLAGS  -stdlib=libc++ )
      /source/cmake/check_compiler_flag.cmake(31):  CHECK_CXX_SOURCE_COMPILES(int main(void) { return 0; } have_CXX__stdlib_libc__ FAIL_REGEX;argument unused during compilation;FAIL_REGEX;unsupported .*option;FAIL_REGEX;unknown .*option;FAIL_REGEX;unrecognized .*option;FAIL_REGEX;ignoring unknown option;FAIL_REGEX;warning:.*ignored;FAIL_REGEX;warning:.*is valid for.*but not for;FAIL_REGEX;warning:.*redefined;FAIL_REGEX;[Ww]arning: [Oo]ption )
      -- Performing Test have_CXX__stdlib_libc__
      -- Performing Test have_CXX__stdlib_libc__ - Failed
      /source/cmake/check_compiler_flag.cmake(33):  SET(CMAKE_REQUIRED_FLAGS  )
      /source/CMakeLists.txt(250):  IF(NOT have_CXX__stdlib_libc__ )
      /source/CMakeLists.txt(251):  MESSAGE(FATAL_ERROR C++ Compiler requires support for -stdlib=libc++ )
      CMake Error at CMakeLists.txt:251 (MESSAGE):
        C++ Compiler requires support for -stdlib=libc++
       
       
      -- Configuring incomplete, errors occurred!
      See also "/build/CMakeFiles/CMakeOutput.log".
      See also "/build/CMakeFiles/CMakeError.log".
      buildbot@2f11790aa1e1:/build$ rm -rf .ninja_*
      buildbot@2f11790aa1e1:/build$ tail -n 30 /build/CMakeFiles/CMakeError.log
      Change Dir: /build/CMakeFiles/CMakeScratch/TryCompile-RfQ4we
       
      Run Build Command(s):/usr/bin/ninja cmTC_2cfad && [1/2] Building CXX object CMakeFiles/cmTC_2cfad.dir/src.cxx.o
      [2/2] Linking CXX executable cmTC_2cfad
      FAILED: cmTC_2cfad 
      : && /usr/bin/clang++ -stdlib=libc++ -L/msan-libs -Wl,-rpath=/msan-libs CMakeFiles/cmTC_2cfad.dir/src.cxx.o -o cmTC_2cfad   && :
      /usr/bin/ld: /msan-libs/libc++.so.1: undefined reference to `__msan_memset'
      /usr/bin/ld: /msan-libs/libc++.so.1: undefined reference to `__msan_retval_origin_tls'
      /usr/bin/ld: /msan-libs/libc++.so.1: undefined reference to `__msan_unpoison'
      /usr/bin/ld: /msan-libs/libc++.so.1: undefined reference to `__msan_param_origin_tls'
      /usr/bin/ld: /msan-libs/libc++.so.1: undefined reference to `__msan_memcpy'
      /usr/bin/ld: /msan-libs/libc++.so.1: undefined reference to `__msan_retval_tls'
      /usr/bin/ld: /msan-libs/libc++.so.1: undefined reference to `__msan_va_arg_overflow_size_tls'
      /usr/bin/ld: /msan-libs/libc++.so.1: undefined reference to `__msan_va_arg_origin_tls'
      /usr/bin/ld: /msan-libs/libc++.so.1: undefined reference to `__sanitizer_dtor_callback_fields'
      /usr/bin/ld: /msan-libs/libc++.so.1: undefined reference to `__msan_memmove'
      /usr/bin/ld: /msan-libs/libc++.so.1: undefined reference to `__msan_chain_origin'
      /usr/bin/ld: /msan-libs/libc++.so.1: undefined reference to `__sanitizer_dtor_callback_vptr'
      /usr/bin/ld: /msan-libs/libc++.so.1: undefined reference to `__msan_va_arg_tls'
      /usr/bin/ld: /msan-libs/libc++.so.1: undefined reference to `__msan_warning_with_origin_noreturn'
      /usr/bin/ld: /msan-libs/libc++.so.1: undefined reference to `__msan_set_alloca_origin_with_descr'
      /usr/bin/ld: /msan-libs/libc++.so.1: undefined reference to `__msan_init'
      /usr/bin/ld: /msan-libs/libc++.so.1: undefined reference to `__msan_param_tls'
      clang++: error: linker command failed with exit code 1 (use -v to see invocation)
      ninja: build stopped: subcommand failed.
      

      Attachments

        Issue Links

          Activity

            People

              danblack Daniel Black
              danblack Daniel Black
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.