Правильна ли эта оценка, и если да, что я могу сделать, чтобы ее исправить?
libc-with-memsan — это моя самокомпилированная библиотека libc++.
Команды clang:
Код: Выделить всё
LIBCXX="/nix/store/1al3szdgkdqsz7r7fcndvrvsc8vx215b-libc-with-memsan-18.1.8"
MSAN_CFLAGS="-fsanitize=memory -stdlib=libc++ -L${LIBCXX}/lib -lc++abi -I${LIBCXX}/include -I${LIBCXX}/include/c++/v1"
clang++ ${MSAN_CFLAGS} src/main.cpp -o target/output -fsanitize=memory -fsanitize-memory-track-origins -Wl,--verbose,-rpath,${LIBCXX}/lib -v
Код: Выделить всё
clang version 18.1.8
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /nix/store/5h0y9g4vmz9189zbzawhy3rxwgwqa5xw-clang-18.1.8/bin
Found candidate GCC installation: /nix/store/1hn524ifk2hqksf0m9klmh9gkfkfvgqv-gcc-13.2.0/lib/gcc/x86_64-unknown-linux-gnu/13.2.0
Found candidate GCC installation: /nix/store/1hn524ifk2hqksf0m9klmh9gkfkfvgqv-gcc-13.2.0/lib64/gcc/x86_64-unknown-linux-gnu/13.2.0
Selected GCC installation: /nix/store/1hn524ifk2hqksf0m9klmh9gkfkfvgqv-gcc-13.2.0/lib64/gcc/x86_64-unknown-linux-gnu/13.2.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
"/nix/store/5h0y9g4vmz9189zbzawhy3rxwgwqa5xw-clang-18.1.8/bin/clang++" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -dumpdir target/output- -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name main.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/home/tim/Documents/mpi_test -v -fcoverage-compilation-dir=/home/tim/Documents/mpi_test -nostdsysteminc -resource-dir /nix/store/n0gsdqcq4hjkc92qdpyb2aw9lihrpbfs-clang-wrapper-18.1.8/resource-root -idirafter /nix/store/0ywz89gl18p0y5m7m8kz8vh1bkry0syf-glibc-2.39-52-dev/include -isystem /nix/store/g1f6lp35qm498n6fa0g6a6qic1rqra6s-openmpi-with-memsan-4.1.6-dev/include -isystem /nix/store/z03vnq1lvv0xz98rdbssa8mg77dv47ns-openmpi-4.1.6-dev/include -isystem /nix/store/1al3szdgkdqsz7r7fcndvrvsc8vx215b-libc-with-memsan-18.1.8/include -isystem /nix/store/frs3xih2qnnz97rsw6ba202h9vmn31w3-compiler-rt-libc-18.1.8-dev/include -isystem /nix/store/1hn524ifk2hqksf0m9klmh9gkfkfvgqv-gcc-13.2.0/include/c++/13.2.0 -isystem /nix/store/1hn524ifk2hqksf0m9klmh9gkfkfvgqv-gcc-13.2.0/include/c++/13.2.0/x86_64-unknown-linux-gnu -I /nix/store/1al3szdgkdqsz7r7fcndvrvsc8vx215b-libc-with-memsan-18.1.8/include -I /nix/store/1al3szdgkdqsz7r7fcndvrvsc8vx215b-libc-with-memsan-18.1.8/include/c++/v1 -internal-isystem /nix/store/n0gsdqcq4hjkc92qdpyb2aw9lihrpbfs-clang-wrapper-18.1.8/resource-root/include -source-date-epoch 315532800 -fdeprecated-macro -ferror-limit 19 -fsanitize=memory -fsanitize-system-ignorelist=/nix/store/n0gsdqcq4hjkc92qdpyb2aw9lihrpbfs-clang-wrapper-18.1.8/resource-root/share/msan_ignorelist.txt -fsanitize-memory-track-origins=2 -fsanitize-memory-use-after-dtor -fno-sanitize-address-use-odr-indicator -fno-assume-sane-operator-new -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /run/user/1000/main-8ebcbb.o -x c++ src/main.cpp
clang -cc1 version 18.1.8 based upon LLVM 18.1.8 default target x86_64-unknown-linux-gnu
ignoring duplicate directory "/nix/store/1al3szdgkdqsz7r7fcndvrvsc8vx215b-libc-with-memsan-18.1.8/include"
as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include search starts here:
/nix/store/1al3szdgkdqsz7r7fcndvrvsc8vx215b-libc-with-memsan-18.1.8/include/c++/v1
/nix/store/g1f6lp35qm498n6fa0g6a6qic1rqra6s-openmpi-with-memsan-4.1.6-dev/include
/nix/store/z03vnq1lvv0xz98rdbssa8mg77dv47ns-openmpi-4.1.6-dev/include
/nix/store/1al3szdgkdqsz7r7fcndvrvsc8vx215b-libc-with-memsan-18.1.8/include
/nix/store/frs3xih2qnnz97rsw6ba202h9vmn31w3-compiler-rt-libc-18.1.8-dev/include
/nix/store/1hn524ifk2hqksf0m9klmh9gkfkfvgqv-gcc-13.2.0/include/c++/13.2.0
/nix/store/1hn524ifk2hqksf0m9klmh9gkfkfvgqv-gcc-13.2.0/include/c++/13.2.0/x86_64-unknown-linux-gnu
/nix/store/n0gsdqcq4hjkc92qdpyb2aw9lihrpbfs-clang-wrapper-18.1.8/resource-root/include
/nix/store/0ywz89gl18p0y5m7m8kz8vh1bkry0syf-glibc-2.39-52-dev/include
End of search list.
In file included from src/main.cpp:2:
In file included from /nix/store/g1f6lp35qm498n6fa0g6a6qic1rqra6s-openmpi-with-memsan-4.1.6-dev/include/mpi.h:2911:
In file included from /nix/store/g1f6lp35qm498n6fa0g6a6qic1rqra6s-openmpi-with-memsan-4.1.6-dev/include/openmpi/ompi/mpi/cxx/mpicxx.h:42:
In file included from /nix/store/1al3szdgkdqsz7r7fcndvrvsc8vx215b-libc-with-memsan-18.1.8/include/c++/v1/map:574:
In file included from /nix/store/1al3szdgkdqsz7r7fcndvrvsc8vx215b-libc-with-memsan-18.1.8/include/c++/v1/__algorithm/equal.h:20:
In file included from /nix/store/1al3szdgkdqsz7r7fcndvrvsc8vx215b-libc-with-memsan-18.1.8/include/c++/v1/__string/constexpr_c_functions.h:14:
In file included from /nix/store/1al3szdgkdqsz7r7fcndvrvsc8vx215b-libc-with-memsan-18.1.8/include/c++/v1/__memory/construct_at.h:23:
In file included from /nix/store/1al3szdgkdqsz7r7fcndvrvsc8vx215b-libc-with-memsan-18.1.8/include/c++/v1/new:364:
In file included from /nix/store/1al3szdgkdqsz7r7fcndvrvsc8vx215b-libc-with-memsan-18.1.8/include/c++/v1/cstdlib:87:
In file included from /nix/store/1al3szdgkdqsz7r7fcndvrvsc8vx215b-libc-with-memsan-18.1.8/include/c++/v1/stdlib.h:94:
/nix/store/1hn524ifk2hqksf0m9klmh9gkfkfvgqv-gcc-13.2.0/include/c++/13.2.0/stdlib.h:38:12: error: no member named 'abort' in namespace 'std'
38 | using std::abort;
| ~~~~~^
/nix/store/1hn524ifk2hqksf0m9klmh9gkfkfvgqv-gcc-13.2.0/include/c++/13.2.0/stdlib.h:39:12: error: no member named 'atexit' in namespace 'std'
39 | using std::atexit;
| ~~~~~^
/nix/store/1hn524ifk2hqksf0m9klmh9gkfkfvgqv-gcc-13.2.0/include/c++/13.2.0/stdlib.h:40:12: error: no member named 'exit' in namespace 'std'
40 | using std::exit;
| ~~~~~^
main.cpp -> openmpi -> libc++ -> libc++ -> ... -> libc++ -> gcc ? !?!?!
Я скомпилировал libc++, используя руководство здесь: Инструкции по сборке LLVM для libc++
Я клонировал репозиторий llvm-проекта на Github и построил его согласно этим инструкциям.
В частности, я использовал эти команды:
Код: Выделить всё
CC=clang CXX=clang++ cmake -G Ninja -S runtimes -B build -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" -DCMAKE_INSTALL_PREFIX=$out -DLLVM_USE_SANITIZER="MemoryWithOrigins" -DLIBCXXABI_USE_LLVM_UNWINDER=OFF
ninja -C build cxx cxxabi unwind
ninja -C build install-cxx install-cxxabi install-unwind
PS:
- Игнорируйте странные пути, это просто махинации NixOS.
- Как видно из импорта, я использую OpenMPI. Ошибка та же самая при использовании mpicxx с серверной частью clang++, так что проблема не в этом.
Подробнее здесь: https://stackoverflow.com/questions/791 ... espace-std
Мобильная версия