使用旧的MIPS gcc编译valgrind

时间:2014-07-02 03:30:00

标签: gcc mips valgrind

我们的嵌入式系统使用旧的gcc-gcc版本3.4.4

当我为它编译valgrind 3.9时,我发现了一些错误。我一个接一个地处理它们,但是对于最后一个链接错误,我无法处理它:

memcheck_mips32_linux-mc_leakcheck.o: In function `find_chunk_for':
/storage/source/valgrind-3.9.0/memcheck/mc_leakcheck.c:287: relocation truncated to fit: R_MIPS_HI16 against `_gp_disp'
memcheck_mips32_linux-mc_leakcheck.o: In function `find_active_chunks':
/storage/source/valgrind-3.9.0/memcheck/mc_leakcheck.c:333: relocation truncated to fit: R_MIPS_HI16 against `_gp_disp'
memcheck_mips32_linux-mc_leakcheck.o: In function `lc_is_a_chunk_ptr':
/storage/source/valgrind-3.9.0/memcheck/mc_leakcheck.c:523: relocation truncated to fit: R_MIPS_HI16 against `_gp_disp'
memcheck_mips32_linux-mc_leakcheck.o: In function `lc_push':
/storage/source/valgrind-3.9.0/memcheck/mc_leakcheck.c:563: relocation truncated to fit: R_MIPS_HI16 against `_gp_disp'
memcheck_mips32_linux-mc_leakcheck.o: In function `pp_heuristic':
/storage/source/valgrind-3.9.0/memcheck/mc_leakcheck.c:593: relocation truncated to fit: R_MIPS_HI16 against `_gp_disp'
memcheck_mips32_linux-mc_leakcheck.o: In function `aligned_ptr_above_page0_is_vtable_addr':
/storage/source/valgrind-3.9.0/memcheck/mc_leakcheck.c:612: relocation truncated to fit: R_MIPS_HI16 against `_gp_disp'
memcheck_mips32_linux-mc_leakcheck.o: In function `heuristic_reachedness':
/storage/source/valgrind-3.9.0/memcheck/mc_leakcheck.c:687: relocation truncated to fit: R_MIPS_HI16 against `_gp_disp'

我尝试添加-G4选项以重新编译,但失败了:

./configure --host=mips-linux --prefix=/storage/source/valgrind-3.9.0/valgrind_install CFLAGS="-G4"

配置将失败并显示:

****configure: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used****
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for mips-linux-strip... mips-linux-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether ln -s works... yes
checking for mips-linux-gcc... mips-linux-gcc
checking whether the C compiler works... no
configure: error: in `/storage/source/valgrind-3.9.0':
configure: error: C compiler cannot create executables
See `config.log' for more details

我甚至尝试修改生成Makefile并向C_FLAGS添加-G4选项,但它不起作用。我仍然无法使用-G4选项编译文件。

  1. 我不知道-G4选项是否可以解决此链接错误。如果是,我该怎么办?
  2. 还有其他方法可以让valgrind与我的工具链一起使用吗?
  3. 我无法将此工具链更改为更新版本,因为它与整个系统绑定。

0 个答案:

没有答案