[LLVMbugs] [Bug 3071] New: CommandLine. h assertion failed with linking LLVM to a shared library

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Nov 15 07:19:41 PST 2008


http://llvm.org/bugs/show_bug.cgi?id=3071

           Summary: CommandLine.h assertion failed with linking LLVM to a
                    shared library
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: rushpl at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=2206)
 --> (http://llvm.org/bugs/attachment.cgi?id=2206)
Test code showing the assertion fail

The following error shows up after running my program that is linked to my
custom library that is made in a fashion described in the Summary.

test1: /usr/src/packages/BUILD/llvm-2.3/include/llvm/Support/CommandLine.h:477:
void llvm::cl::parser<DataType>::addLiteralOption(const char*, const DT&, const
char*) [with DT = const llvm::TargetMachineRegistryEntry*, DataType = const
llvm::TargetMachineRegistryEntry*]: Assertion `findOption(Name) ==
Values.size() && "Option already exists!"' failed.

(Yes my LLVM packages are not the latest 2.4 but edwin on IRC confirmed with
the latest - I suppose)
I attached a sample code that will produce the error. It requires CMake for
building. Furthermore it has been suggested to also paste the building phase in
case somebody can spot something wrong with it.

rush at rushpod:~/Programowanie/LLVM_DblDef> cmake .
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
NOTICE Libs: /usr/lib/llvm/LLVMExecutionEngine.o /usr/lib/llvm/LLVMJIT.o
/usr/lib/llvm/LLVMX86.o /usr/lib/llvm/libLLVMSelectionDAG.a
/usr/lib/llvm/libLLVMCodeGen.a /usr/lib/llvm/libLLVMScalarOpts.a
/usr/lib/llvm/libLLVMTransformUtils.a /usr/lib/llvm/libLLVMipa.a
/usr/lib/llvm/libLLVMAnalysis.a /usr/lib/llvm/libLLVMTarget.a
/usr/lib/llvm/libLLVMCore.a /usr/lib/llvm/libLLVMSupport.a
/usr/lib/llvm/libLLVMSystem.a
NOTICE linking with /usr/lib/llvm/LLVMExecutionEngine.o
NOTICE linking with /usr/lib/llvm/LLVMJIT.o
NOTICE linking with /usr/lib/llvm/LLVMX86.o
NOTICE linking with /usr/lib/llvm/libLLVMSelectionDAG.a
NOTICE linking with /usr/lib/llvm/libLLVMCodeGen.a
NOTICE linking with /usr/lib/llvm/libLLVMScalarOpts.a
NOTICE linking with /usr/lib/llvm/libLLVMTransformUtils.a
NOTICE linking with /usr/lib/llvm/libLLVMipa.a
NOTICE linking with /usr/lib/llvm/libLLVMAnalysis.a
NOTICE linking with /usr/lib/llvm/libLLVMTarget.a
NOTICE linking with /usr/lib/llvm/libLLVMCore.a
NOTICE linking with /usr/lib/llvm/libLLVMSupport.a
NOTICE linking with /usr/lib/llvm/libLLVMSystem.a
-- Configuring done
-- Generating done
-- Build files have been written to: /home/rush/Programowanie/LLVM_DblDef
rush at rushpod:~/Programowanie/LLVM_DblDef> make VERBOSE=1
/usr/bin/cmake -H/home/rush/Programowanie/LLVM_DblDef
-B/home/rush/Programowanie/LLVM_DblDef --check-build-system
CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start
/home/rush/Programowanie/LLVM_DblDef/CMakeFiles
/home/rush/Programowanie/LLVM_DblDef/CMakeFiles/progress.make
make -f CMakeFiles/Makefile2 all
make[1]: Wejście do katalogu `/home/rush/Programowanie/LLVM_DblDef'
make -f CMakeFiles/testlib.dir/build.make CMakeFiles/testlib.dir/depend
make[2]: Wejście do katalogu `/home/rush/Programowanie/LLVM_DblDef'
cd /home/rush/Programowanie/LLVM_DblDef && /usr/bin/cmake -E cmake_depends
"Unix Makefiles" /home/rush/Programowanie/LLVM_DblDef
/home/rush/Programowanie/LLVM_DblDef /home/rush/Programowanie/LLVM_DblDef
/home/rush/Programowanie/LLVM_DblDef
/home/rush/Programowanie/LLVM_DblDef/CMakeFiles/testlib.dir/DependInfo.cmake
--color=
Dependee
"/home/rush/Programowanie/LLVM_DblDef/CMakeFiles/testlib.dir/DependInfo.cmake"
is newer than depender
"/home/rush/Programowanie/LLVM_DblDef/CMakeFiles/testlib.dir/depend.internal".
Scanning dependencies of target testlib
make[2]: Opuszczenie katalogu `/home/rush/Programowanie/LLVM_DblDef'
make -f CMakeFiles/testlib.dir/build.make CMakeFiles/testlib.dir/build
make[2]: Wejście do katalogu `/home/rush/Programowanie/LLVM_DblDef'
/usr/bin/cmake -E cmake_progress_report
/home/rush/Programowanie/LLVM_DblDef/CMakeFiles 2
[ 50%] Building CXX object CMakeFiles/testlib.dir/testlib.c++.o
/usr/bin/c++   -D__STDC_LIMIT_MACROS -Dtestlib_EXPORTS -fPIC   -o
CMakeFiles/testlib.dir/testlib.c++.o -c
/home/rush/Programowanie/LLVM_DblDef/testlib.c++
Linking CXX shared library libtestlib.so
/usr/bin/cmake -E cmake_link_script CMakeFiles/testlib.dir/link.txt --verbose=1
/usr/bin/c++  -fPIC   -shared -Wl,-soname,libtestlib.so -o libtestlib.so
CMakeFiles/testlib.dir/testlib.c++.o /usr/lib/llvm/LLVMExecutionEngine.o
/usr/lib/llvm/LLVMJIT.o /usr/lib/llvm/LLVMX86.o
/usr/lib/llvm/libLLVMSelectionDAG.a /usr/lib/llvm/libLLVMCodeGen.a
/usr/lib/llvm/libLLVMScalarOpts.a /usr/lib/llvm/libLLVMTransformUtils.a
/usr/lib/llvm/libLLVMipa.a /usr/lib/llvm/libLLVMAnalysis.a
/usr/lib/llvm/libLLVMTarget.a /usr/lib/llvm/libLLVMCore.a
/usr/lib/llvm/libLLVMSupport.a /usr/lib/llvm/libLLVMSystem.a -lpthread -ldl
make[2]: Opuszczenie katalogu `/home/rush/Programowanie/LLVM_DblDef'
/usr/bin/cmake -E cmake_progress_report
/home/rush/Programowanie/LLVM_DblDef/CMakeFiles  2
[ 50%] Built target testlib
make -f CMakeFiles/test1.dir/build.make CMakeFiles/test1.dir/depend
make[2]: Wejście do katalogu `/home/rush/Programowanie/LLVM_DblDef'
cd /home/rush/Programowanie/LLVM_DblDef && /usr/bin/cmake -E cmake_depends
"Unix Makefiles" /home/rush/Programowanie/LLVM_DblDef
/home/rush/Programowanie/LLVM_DblDef /home/rush/Programowanie/LLVM_DblDef
/home/rush/Programowanie/LLVM_DblDef
/home/rush/Programowanie/LLVM_DblDef/CMakeFiles/test1.dir/DependInfo.cmake
--color=
Dependee
"/home/rush/Programowanie/LLVM_DblDef/CMakeFiles/test1.dir/DependInfo.cmake" is
newer than depender
"/home/rush/Programowanie/LLVM_DblDef/CMakeFiles/test1.dir/depend.internal".
Scanning dependencies of target test1
make[2]: Opuszczenie katalogu `/home/rush/Programowanie/LLVM_DblDef'
make -f CMakeFiles/test1.dir/build.make CMakeFiles/test1.dir/build
make[2]: Wejście do katalogu `/home/rush/Programowanie/LLVM_DblDef'
/usr/bin/cmake -E cmake_progress_report
/home/rush/Programowanie/LLVM_DblDef/CMakeFiles 1
[100%] Building CXX object CMakeFiles/test1.dir/test1.c++.o
/usr/bin/c++   -D__STDC_LIMIT_MACROS  -o CMakeFiles/test1.dir/test1.c++.o -c
/home/rush/Programowanie/LLVM_DblDef/test1.c++
Linking CXX executable test1
/usr/bin/cmake -E cmake_link_script CMakeFiles/test1.dir/link.txt --verbose=1
/usr/bin/c++     -fPIC CMakeFiles/test1.dir/test1.c++.o  -o test1 -rdynamic
libtestlib.so /usr/lib/llvm/LLVMExecutionEngine.o /usr/lib/llvm/LLVMJIT.o
/usr/lib/llvm/LLVMX86.o /usr/lib/llvm/libLLVMSelectionDAG.a
/usr/lib/llvm/libLLVMCodeGen.a /usr/lib/llvm/libLLVMScalarOpts.a
/usr/lib/llvm/libLLVMTransformUtils.a /usr/lib/llvm/libLLVMipa.a
/usr/lib/llvm/libLLVMAnalysis.a /usr/lib/llvm/libLLVMTarget.a
/usr/lib/llvm/libLLVMCore.a /usr/lib/llvm/libLLVMSupport.a
/usr/lib/llvm/libLLVMSystem.a -lpthread -ldl
-Wl,-rpath,/home/rush/Programowanie/LLVM_DblDef
make[2]: Opuszczenie katalogu `/home/rush/Programowanie/LLVM_DblDef'
/usr/bin/cmake -E cmake_progress_report
/home/rush/Programowanie/LLVM_DblDef/CMakeFiles  1
[100%] Built target test1
make[1]: Opuszczenie katalogu `/home/rush/Programowanie/LLVM_DblDef'
/usr/bin/cmake -E cmake_progress_start
/home/rush/Programowanie/LLVM_DblDef/CMakeFiles 0
rush at rushpod:~/Programowanie/LLVM_DblDef> ./test1
test1: /usr/src/packages/BUILD/llvm-2.3/include/llvm/Support/CommandLine.h:477:
void llvm::cl::parser<DataType>::addLiteralOption(const char*, const DT&, const
char*) [with DT = const llvm::TargetMachineRegistryEntry*, DataType = const
llvm::TargetMachineRegistryEntry*]: Assertion `findOption(Name) ==
Values.size() && "Option already exists!"' failed.
Przerwane
rush at rushpod:~/Programowanie/LLVM_DblDef>


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list