Hi,

I have built lldb using llvm-3.7 on FreeBSD10 (amd64) and I see this error.

$./lldb

: CommandLine Error: Option 'aarch64-reserve-x18' registered more than once!

Abort trap

I did debug a little bit  & found that

The global instance "ReserveX18"  @
llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp:38

getting initialized twice. Backtrace is attached in a txt file.

The below commit (which is not in llvm-3.7 release) removes this global
variable which solves the error.

https://github.com/llvm-mirror/llvm/commit/e934b449d4181ebb92bd40e2dc4a034f114b671b#diff-992adb02aad3be42cdff964655e42801

Is there any other way to resolve this error? or we need to back port the
above llvm commit to llvm 3.7 release?

Thanks

Rajendra
Breakpoint 5, __cxx_global_var_init () at 
bundle/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp:38
38      ReserveX18("aarch64-reserve-x18", cl::Hidden,
(gdb) bt
#0  __cxx_global_var_init () at 
bundle/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp:38
#1  0x00000008014edde9 in _GLOBAL__sub_I_AArch64RegisterInfo.cpp () at 
lib/Target/AArch64/AArch64GenRegisterInfo.inc:4165
#2  0x000000080061c7a0 in ?? () from /libexec/ld-elf.so.1
#3  0x000000080061bd17 in ?? () from /libexec/ld-elf.so.1
#4  0x000000080061a129 in ?? () from /libexec/ld-elf.so.1
#5  0x0000000000000000 in ?? ()

 2nd time initialization of shared library:

Breakpoint 5, __cxx_global_var_init () at 
bundle/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp:38
38      ReserveX18("aarch64-reserve-x18", cl::Hidden,
(gdb) bt
#0  __cxx_global_var_init () at 
bundle/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp:38
#1  0x000000080c4b8de9 in _GLOBAL__sub_I_AArch64RegisterInfo.cpp () at 
lib/Target/AArch64/AArch64GenRegisterInfo.inc:4165
#2  0x000000080061c7a0 in ?? () from /libexec/ld-elf.so.1
#3  0x0000000800620d87 in ?? () from /libexec/ld-elf.so.1
#4  0x000000080061dad3 in ?? () from /libexec/ld-elf.so.1
#5  0x00000008088a9346 in _PyImport_GetDynLoadFunc (fqname=0x8097c3e34 "_lldb", 
shortname=0x8097c3e34 "_lldb", 
    pathname=0x80a6cf054 
"/media/seagatedrive/jenkins/3.7/install/bin/../lib/python2.7/site-packages/lldb/_lldb.so",
 fp=0x8080fdfd0)
    at Python/dynload_shlib.c:130
#6  0x0000000808886d9e in _PyImport_LoadDynamicModule (name=0x8097c3e34 
"_lldb", 
    pathname=0x80a6cf054 
"/media/seagatedrive/jenkins/3.7/install/bin/../lib/python2.7/site-packages/lldb/_lldb.so",
 fp=0x8080fdfd0)
    at ./Python/importdl.c:42
#7  0x0000000808883810 in load_module (name=0x8097c3e34 "_lldb", 
fp=0x8080fdfd0, 
    pathname=0x80a6cf054 
"/media/seagatedrive/jenkins/3.7/install/bin/../lib/python2.7/site-packages/lldb/_lldb.so",
 type=3, loader=0x0)
    at Python/import.c:1919
#8  0x0000000808886719 in imp_load_module (self=0x0, args=0x80a6c94c8) at 
Python/import.c:3186
#9  0x00000008087e22e0 in PyCFunction_Call (func=0x8097b5098, arg=0x80a6c94c8, 
kw=0x0) at Objects/methodobject.c:81
#10 0x00000008088689e4 in call_function (pp_stack=0x7fffffffd398, oparg=4) at 
Python/ceval.c:4035
#11 0x0000000808864e17 in PyEval_EvalFrameEx (f=0x8007bec50, throwflag=0) at 
Python/ceval.c:2681
#12 0x0000000808868d75 in fast_function (func=0x8097bfde8, 
pp_stack=0x7fffffffd668, n=0, na=0, nk=0) at Python/ceval.c:4121
#13 0x0000000808868b1c in call_function (pp_stack=0x7fffffffd668, oparg=0) at 
Python/ceval.c:4056
#14 0x0000000808864e17 in PyEval_EvalFrameEx (f=0x80a60e218, throwflag=0) at 
Python/ceval.c:2681
#15 0x00000008088669c8 in PyEval_EvalCodeEx (co=0x80a6cde30, 
globals=0x8097c54b0, locals=0x8097c54b0, args=0x0, argcount=0, kws=0x0, 
kwcount=0, defs=0x0, 
    defcount=0, closure=0x0) at Python/ceval.c:3267
#16 0x0000000808860afa in PyEval_EvalCode (co=0x80a6cde30, globals=0x8097c54b0, 
locals=0x8097c54b0) at Python/ceval.c:669
#17 0x00000008088816de in PyImport_ExecCodeModuleEx (name=0x809c3c100 "lldb", 
co=0x80a6cde30, 
    pathname=0x809c3cb00 
"/media/seagatedrive/jenkins/3.7/install/bin/../lib/python2.7/site-packages/lldb/__init__.py")
 at Python/import.c:713
#18 0x000000080888223b in load_source_module (name=0x809c3c100 "lldb", 
    pathname=0x809c3cb00 
"/media/seagatedrive/jenkins/3.7/install/bin/../lib/python2.7/site-packages/lldb/__init__.py",
 fp=0x8080fdea0)
    at Python/import.c:1103
#19 0x00000008088837d0 in load_module (name=0x809c3c100 "lldb", fp=0x8080fdea0, 
    pathname=0x809c3cb00 
"/media/seagatedrive/jenkins/3.7/install/bin/../lib/python2.7/site-packages/lldb/__init__.py",
 type=1, loader=0x0)
#20 0x00000008088824a1 in load_package (name=0x809c3c100 "lldb", 
    pathname=0x809c3c600 
"/media/seagatedrive/jenkins/3.7/install/bin/../lib/python2.7/site-packages/lldb")
 at Python/import.c:1170
#21 0x000000080888382c in load_module (name=0x809c3c100 "lldb", fp=0x0, 
    pathname=0x809c3c600 
"/media/seagatedrive/jenkins/3.7/install/bin/../lib/python2.7/site-packages/lldb",
 type=5, loader=0x0) at Python/import.c:1924
#22 0x00000008088854ac in import_submodule (mod=0x808b309c0 <_Py_NoneStruct>, 
subname=0x809c3c100 "lldb", fullname=0x809c3c100 "lldb")
    at Python/import.c:2704
#23 0x0000000808884ca0 in load_next (mod=0x808b309c0 <_Py_NoneStruct>, 
altmod=0x808b309c0 <_Py_NoneStruct>, p_name=0x7fffffffdcc8, buf=0x809c3c100 
"lldb", 
    p_buflen=0x7fffffffdcd8) at Python/import.c:2519
#24 0x000000080888409d in import_module_level (name=0x80a437b59 
"embedded_interpreter", globals=0x8007bad70, locals=0x8007bad70, 
    fromlist=0x808b309c0 <_Py_NoneStruct>, level=-1) at Python/import.c:2228
#25 0x0000000808884401 in PyImport_ImportModuleLevel (name=0x80a437b54 
"lldb.embedded_interpreter", globals=0x8007bad70, locals=0x8007bad70, 
    fromlist=0x808b309c0 <_Py_NoneStruct>, level=-1) at Python/import.c:2292
#26 0x0000000808859200 in builtin___import__ (self=0x0, args=0x809768a48, 
kwds=0x0) at Python/bltinmodule.c:49
#27 0x00000008087e22ff in PyCFunction_Call (func=0x8007a0fc8, arg=0x809768a48, 
kw=0x0) at Objects/methodobject.c:85
#28 0x000000080878cc11 in PyObject_Call (func=0x8007a0fc8, arg=0x809768a48, 
kw=0x0) at Objects/abstract.c:2529
#29 0x0000000808868254 in PyEval_CallObjectWithKeywords (func=0x8007a0fc8, 
arg=0x809768a48, kw=0x0) at Python/ceval.c:3904
#30 0x0000000808864312 in PyEval_EvalFrameEx (f=0x800796c20, throwflag=0) at 
Python/ceval.c:2348
#31 0x00000008088669c8 in PyEval_EvalCodeEx (co=0x80977e8b0, 
globals=0x8007bad70, locals=0x8007bad70, args=0x0, argcount=0, kws=0x0, 
kwcount=0, defs=0x0, 
    defcount=0, closure=0x0) at Python/ceval.c:3267
#32 0x0000000808860afa in PyEval_EvalCode (co=0x80977e8b0, globals=0x8007bad70, 
locals=0x8007bad70) at Python/ceval.c:669
#33 0x0000000808894973 in run_mod (mod=0x809d17240, filename=0x8088ecebd 
"<string>", globals=0x8007bad70, locals=0x8007bad70, flags=0x0, 
arena=0x809c853e0)
    at Python/pythonrun.c:1371
#34 0x0000000808894827 in PyRun_StringFlags (
    str=0x805ae0743 "sys.dont_write_bytecode = 1; import 
lldb.embedded_interpreter; from lldb.embedded_interpreter import 
run_python_interpreter; from lldb.embedded_interpreter import run_one_line", 
start=257, globals=0x8007bad70, locals=0x8007bad70, flags=0x0) at 
Python/pythonrun.c:1334
#35 0x00000008088936b4 in PyRun_SimpleStringFlags (
    command=0x805ae0743 "sys.dont_write_bytecode = 1; import 
lldb.embedded_interpreter; from lldb.embedded_interpreter import 
run_python_interpreter; from lldb.embedded_interpreter import run_one_line", 
flags=0x0) at Python/pythonrun.c:975
#36 0x0000000803011f68 in 
lldb_private::ScriptInterpreterPython::InitializePrivate ()
    at 
bundle/llvm/tools/lldb/source/Interpreter/ScriptInterpreterPython.cpp:3140
#37 0x0000000802f6019d in lldb_private::SystemInitializerCommon::Initialize 
(this=0x809c19070)
    at 
bundle/llvm/tools/lldb/source/Initialization/SystemInitializerCommon.cpp:144
#38 0x0000000801410862 in lldb_private::SystemInitializerFull::Initialize 
(this=0x809c19070)
    at bundle/llvm/tools/lldb/source/API/SystemInitializerFull.cpp:226
#39 0x0000000802f6077a in lldb_private::SystemLifetimeManager::Initialize 
(this=0x809c25ee0, initializer=..., 
    plugin_callback=0x801376650 
<LoadPlugin(std::__1::shared_ptr<lldb_private::Debugger> const&, 
lldb_private::FileSpec const&, lldb_private::Error&)>)
    at bundle/llvm/tools/lldb/source/Initialization/SystemLifetimeManager.cpp:43
#40 0x00000008013764b8 in lldb::SBDebugger::Initialize () at 
bundle/llvm/tools/lldb/source/API/SBDebugger.cpp:123
#41 0x000000000040a842 in main (argc=1, argv=0x7fffffffea00, 
envp=0x7fffffffea10) at bundle/llvm/tools/lldb/tools/driver/Driver.cpp:1223
_______________________________________________
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

Reply via email to