Compile mysql with CFI enabled

Hi all,

I try to compile mysql with CFI enabled by LLVM. The version of the softwares are as following:

  1. clang-6.0
  2. mysql-5.6.26
  3. binutils-2.28.1
    I can compile mysal with the flowing configuration:

CC=“clang” CXX=“clang++” CFLAGS="-g -flto -fvisibility=hidden -fsanitize=cfi" CXXFLAGS="-g -flto -fvisibility=hidden -fsanitize=cfi" cmake -DCMAKE_{EXE,SHARED,MODULE}_LINKER_FLAGS="-flto -fsanitize=cfi" -DCMAKE_AR=/home/zhangjun/work/llvm/llvm-3.7.1/bin/llvm-ar -DCMAKE_RANLIB=/home/zhangjun/work/llvm/llvm-3.7.1/bin/llvm-ranlib -DCMAKE_INSTALL_PREFIX=…/mysql -DWITH_BOOST=./boost .

and the reported error is as following:

ld: /home/zhangjun/work/llvm/llvm/tools/gold/goldplugin.cpp:879: ld_plugin_status allSymbolsReadHook(): Assertion ObjFilename.second' failed. clang-6.0: error: unable to execute command: Aborted (core dumped) clang-6.0: error: linker command failed due to signal (use -v to see invocation) make[2]: *** [extra/comp_err] Error 254 make[2]: Leaving directory /home/zhangjun/work/mysql/mysql-5.6.26’
make[1]: *** [extra/CMakeFiles/comp_err.dir/all] Error 2
make[1]: Leaving directory `/home/zhangjun/work/mysql/mysql-5.6.26’
make: *** [all] Error 2

Please help me!