On Mon, 18 Jan 2021 14:47:36 +0100 Brendan Jackman <jackmanb@xxxxxxxxxx> wrote: > On Mon, 18 Jan 2021 at 14:41, Jesper Dangaard Brouer <brouer@xxxxxxxxxx> wrote: > > > > Hi All, > > > > After rebasing (my MTU patchset) to bpf-next (232164e041e925a) I'm > > getting this error when compiling selftests (full error below signature): > > > > "CLNG-BPF [test_maps] atomics.o" > > "fatal error: error in backend: line 27: Invalid usage of the XADD return value" > > "PLEASE submit a bug report to https://bugs.llvm.org/ [...]" > > > > It looked like a LLVM bug, so I compiled llvm-11.1.0-rc1, but it still fails. > > > > I noticed Brendan Jackman changes... could this be related? > > Yes, since bpf-next commit 98d666d05a1d970 ("bpf: Add tests for new > BPF atomic operations") you need llvm-project commit 286daafd6512 (was > https://reviews.llvm.org/D72184) for the selftests, which will be in > Clang 12. You'll need to build LLVM from master. > I'm compiling from LLVM 'main' branch (commit e6d758de82b6) but it unfortunately fails to compile (see error below). Any recommended LLVM commit id that works? [...] ../include/llvm/ExecutionEngine/Orc/Shared/RPCUtils.h:1513:27: note: remove ‘std::move’ call ../include/llvm/ExecutionEngine/Orc/Shared/RPCUtils.h:1519:27: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move] 1519 | return std::move(Err); | ^ ../include/llvm/ExecutionEngine/Orc/Shared/RPCUtils.h:1519:27: note: remove ‘std::move’ call ../include/llvm/ExecutionEngine/Orc/Shared/RPCUtils.h:1526:29: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move] 1526 | return std::move(Err); | ^ ../include/llvm/ExecutionEngine/Orc/Shared/RPCUtils.h:1526:29: note: remove ‘std::move’ call [2237/3183] Building CXX object tools/clang/lib/ASTMatchers/Dynamic/CMakeFiles/obj.clangDynamicASTMatchers.dir/Registry.cpp.o FAILED: tools/clang/lib/ASTMatchers/Dynamic/CMakeFiles/obj.clangDynamicASTMatchers.dir/Registry.cpp.o /usr/lib64/ccache/c++ -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/clang/lib/ASTMatchers/Dynamic -I/home/jbrouer/git/llvm-project/clang/lib/ASTMatchers/Dynamic -I/home/jbrouer/git/llvm-project/clang/include -Itools/clang/include -Iinclude -I/home/jbrouer/git/llvm-project/llvm/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O2 -DNDEBUG -fno-exceptions -fno-rtti -std=c++14 -MD -MT tools/clang/lib/ASTMatchers/Dynamic/CMakeFiles/obj.clangDynamicASTMatchers.dir/Registry.cpp.o -MF tools/clang/lib/ASTMatchers/Dynamic/CMakeFiles/obj.clangDynamicASTMatchers.dir/Registry.cpp.o.d -o tools/clang/lib/ASTMatchers/Dynamic/CMakeFiles/obj.clangDynamicASTMatchers.dir/Registry.cpp.o -c /home/jbrouer/git/llvm-project/clang/lib/ASTMatchers/Dynamic/Registry.cpp c++: fatal error: Killed signal terminated program cc1plus compilation terminated. [2255/3183] Building CXX object tools/clang/lib/ASTMatchers/CMakeFiles/obj.clangASTMatchers.dir/ASTMatchFinder.cpp.o [2262/3183] Building CXX object tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaExpr.cpp.o ninja: build stopped: subcommand failed. -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer