使用os161 mips编译的gdb-7.8的链接错误

时间:2018-12-19 03:39:10

标签: linux gcc gdb linker-errors os161

我正在使用Ubuntu 18.10。我用:

./configure --target=mips-harvard-os161 --prefix=$HOME/os161/tools  

使用os161 mips编译的gdb-7.8编译错误。

我该如何解决?


下面的.../home/kapperchino/Downloads/

.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(sim-io.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(sim-info.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(sim-module.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(sim-options.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(sim-profile.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(sim-signal.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(sim-trace.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(sim-utils.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(sim-watch.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(interp.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(sim-main.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(sim-hload.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(sim-engine.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(sim-stop.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(sim-resume.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(sim-reason.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(irun.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(sim-command.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(sim-core.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(sim-events.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(sim-fpu.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/./../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(sim-load.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/./../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(sim-memopt.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(cp1.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(engine.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(semantics.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here
/usr/bin/ld: libsim.a(idecode.o): in function `sim_addr_range_hit_p':
.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: multiple definition of `sim_addr_range_hit_p'; nrun.o:.../gdb-7.8+os161-2.1/sim/mips/../common/sim-arange.c:290: first defined here

1 个答案:

答案 0 :(得分:0)

我知道我来晚了,但我认为会有很多人从中受益。

我遇到了相同的问题,这是因为“外部内联”以及GNU GCC如何解释它(c89和c99对此解释不同)。我使用了-fgnu89-inline CFLAG,但这没有任何帮助(我想应该是在旧版本上,但是现在GNU说,在当前版本的GCC上,CFLAG可能会引起它确实遇到的问题),所以我决定自己改变。

有2个文件更改:

1)现在转到INLINE_SIM_MAIN的定义。如果您的编辑器不支持跳转到定义,则位于文件“ sim-inline.h”内的gdb * / sim / common中

  • 搜索“外部INLINE2”。
  • 删除extern并添加静态

2)在同一目录中,打开“ sim-arange.h”,并将INLINE也转换为静态。

在我花费了大量时间后,这为我解决了这个问题。希望对您有所帮助。