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
- is caused by
-
MDEV-34996 Buildbot MSAN options in buildbot rather than server
-
- Closed
-
adjusted per wlad's review - without CMP0066. compliler/linker flag changes where needed and adjusted commit message to be a bit more explicit why.
I'm hoping justification for 10.6 is sufficient. I don't currently have push access there so if acceptable can you hit the merge on the PR wlad?
If 10.5 is/was acceptable I'd take that too and simplify some upcoming msan BB changes with one less cmake argument.