llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.01k stars 11.96k forks source link

CommandLine Error: Option 'clang-component' registered more than once! #28807

Open llvmbot opened 8 years ago

llvmbot commented 8 years ago
Bugzilla Link 28433
Version trunk
OS Linux
Reporter LLVM Bugzilla Contributor
CC @nemanjai

Extended Description

on ppc64le I get:

trippels@gcc2-power8 AST % valgrind --track-origins=yes /home/trippels/llvm_build/bin/clang-tblgen -gen-clang-attr-ast-visitor -I /home/trippels/llvm/tools/clang/include/clang/AST/../../ -I /home/trippels/llvm/tools/clang/include/clang/AST -I /home/trippels/llvm/lib/Target -I /home/trippels/llvm/include /home/trippels/llvm/tools/clang/include/clang/AST/../Basic/Attr.td -o /home/trippels/llvm_build/tools/clang/include/clang/AST/AttrVisitor.inc.tmp                         
==24123== Memcheck, a memory error detector
==24123== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==24123== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==24123== Command: /home/trippels/llvm_build/bin/clang-tblgen -gen-clang-attr-ast-visitor -I /home/trippels/llvm/tools/clang/include/clang/AST/../../ -I /home/trippels/llvm/tools/clang/include/clang/AST -I /home/trippels/llvm/lib/Target -I /home/trippels/llvm/include /home/trippels/llvm/tools/clang/include/clang/AST/../Basic/Attr.td -o /home/trippels/llvm_build/tools/clang/include/clang/AST/AttrVisitor.inc.tmp
==24123== 
: CommandLine Error: Option 'clang-component' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options
==24123== Invalid free() / delete / delete[] / realloc()
==24123==    at 0x4095394: free (in /usr/lib64/valgrind/vgpreload_memcheck-ppc64le-linux.so)
==24123==    by 0x100676BF: llvm::SmallPtrSetImplBase::~SmallPtrSetImplBase() (SmallPtrSet.h:82)
==24123==    by 0x100A9EE7: llvm::SmallPtrSetImpl<llvm::Record*>::~SmallPtrSetImpl() (in /home/trippels/llvm_build/bin/clang-tblgen)
==24123==    by 0x100A9E97: llvm::SmallPtrSet<llvm::Record*, 16u>::~SmallPtrSet() (in /home/trippels/llvm_build/bin/clang-tblgen)
==24123==    by 0x100AB98B: llvm::cl::Option::~Option() (in /home/trippels/llvm_build/bin/clang-tblgen)
==24123==    by 0x100AB5CF: llvm::cl::opt<ActionType, false, llvm::cl::parser<ActionType> >::~opt() (in /home/trippels/llvm_build/bin/clang-tblgen)
==24123==    by 0x466232B: __run_exit_handlers (in /usr/lib64/libc-2.20.so)
==24123==    by 0x4662373: exit (in /usr/lib64/libc-2.20.so)
==24123==    by 0x414A793: llvm::report_fatal_error(llvm::Twine const&, bool) (in /home/trippels/llvm-install/lib/libLLVMSupport.so)
==24123==    by 0x414A93B: llvm::report_fatal_error(char const*, bool) (in /home/trippels/llvm-install/lib/libLLVMSupport.so)
==24123==    by 0x41292DF: llvm::cl::Option::addArgument() (in /home/trippels/llvm-install/lib/libLLVMSupport.so)
==24123==    by 0x41293E7: llvm::cl::opt<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, false, llvm::cl::parser<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::done() (in /home/trippels/llvm-install/lib/libLLVMSupport.so)
==24123==  Address 0x100cfd50 is 112 bytes inside data symbol "_ZN12_GLOBAL__N_16ActionE"
llvmbot commented 8 years ago

Only happens when using -DBUILD_SHARED_LIBS=on.

To reproduce run e.g.:

trippels@gcc2-power8 llvm_build % cmake -DBUILD_SHARED_LIBS=on -DGCC_INSTALL_PREFIX=~/gcc_6/usr/local/ -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -DCMAKE_INSTALL_PREFIX=~/llvm-install -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_ASSERTIONS=on -DLLVM_TARGETS_TO_BUILD="PowerPC" -DENABLE_PIC=1 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DLLVM_BINUTILS_INCDIR=/home/trippels/include -DCMAKE_C_COMPILER=/home/trippels/gcc_6/usr/local/bin/gcc -DCMAKE_CXX_COMPILER=/home/trippels/gcc_6/usr/local/bin/g++ ../llvm
trippels@gcc2-power8 llvm_build % LD_PRELOAD=/usr/lib64/libtcmalloc.so.4.2.2 ninja -j 60 
...
[549/2350] Building CommentCommandInfo.inc...
FAILED: cd /home/trippels/llvm_build/tools/clang/include/clang/AST && /home/trippels/llvm_build/bin/clang-tblgen -gen-clang-comment-command-info -I /home/trippels/llvm/tools/clang/include/clang/AST -I /home/trippels/llvm/lib/Target -I /home/trippels/llvm/include /home/trippels/llvm/tools/clang/include/clang/AST/CommentCommands.td -o /home/trippels/llvm_build/tools/clang/include/clang/AST/CommentCommandInfo.inc.tmp
: CommandLine Error: Option 'clang-component' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options
src/tcmalloc.cc:278] Attempt to free invalid pointer 0x100ebbd8
/bin/sh: line 1: 126818 Aborted                 /home/trippels/llvm_build/bin/clang-tblgen -gen-clang-comment-command-info -I /home/trippels/llvm/tools/clang/include/clang/AST -I /home/trippels/llvm/lib/Target -I /home/trippels/llvm/include /home/trippels/llvm/tools/clang/include/clang/AST/CommentCommands.td -o /home/trippels/llvm_build/tools/clang/include/clang/AST/CommentCommandInfo.inc.tmp
[549/2350] Building CommentHTMLTags.inc...
FAILED: cd /home/trippels/llvm_build/tools/clang/include/clang/AST && /home/trippels/llvm_build/bin/clang-tblgen -gen-clang-comment-html-tags -I /home/trippels/llvm/tools/clang/include/clang/AST -I /home/trippels/llvm/lib/Target -I /home/trippels/llvm/include /home/trippels/llvm/tools/clang/include/clang/AST/CommentHTMLTags.td -o /home/trippels/llvm_build/tools/clang/include/clang/AST/CommentHTMLTags.inc.tmp
: CommandLine Error: Option 'clang-component' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options
src/tcmalloc.cc:278] Attempt to free invalid pointer 0x100ebbd8
/bin/sh: line 1: 126813 Aborted                 /home/trippels/llvm_build/bin/clang-tblgen -gen-clang-comment-html-tags -I /home/trippels/llvm/tools/clang/include/clang/AST -I /home/trippels/llvm/lib/Target -I /home/trippels/llvm/include /home/trippels/llvm/tools/clang/include/clang/AST/CommentHTMLTags.td -o /home/trippels/llvm_build/tools/clang/include/clang/AST/CommentHTMLTags.inc.tmp
...