我试图为MIPS架构交叉编译valgrind但是我遇到了错误。
$ make
make all-recursive
make[1]: Entering directory `/valgrind-3.9.0'
Making all in include
make[2]: Entering directory `/valgrind-3.9.0/include'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/valgrind-3.9.0/include'
Making all in VEX
make[2]: Entering directory `/valgrind-3.9.0/VEX'
make all-am
make[3]: Entering directory `/valgrind-3.9.0/VEX'
/toolchain/rsdk-1.5.6-5281-EB-2.6.30-0.9.30.3-110915/bin/rsdk-linux-gcc - DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../VEX/pub -DVGA_mips32=1 -DVGO_linux=1 -DVGP_mips32_linux=1 -DVGPV_mips32_linux_vanilla=1 -Ipriv -O2 -g -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wno-format-zero-length -fno-strict-aliasing -fno-builtin -mips32 -Wbad-function-cast -Wcast-qual -Wcast-align -fstrict-aliasing -Wno-long-long -Wwrite-strings -fno-stack-protector -MT priv/libvex_mips32_linux_a-main_globals.o -MD -MP -MF priv/.deps/libvex_mips32_linux_a-main_globals.Tpo -c -o priv/libvex_mips32_linux_a-main_globals.o `test -f 'priv/main_globals.c' || echo './'`priv/main_globals.c
priv/main_globals.c:1: error: '-mips32' conflicts with the other architecture options, which specify a mips1 processor
make[3]: *** [priv/libvex_mips32_linux_a-main_globals.o] Error 1
make[3]: Leaving directory `/valgrind-3.9.0/VEX'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/valgrind-3.9.0/VEX'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/valgrind-3.9.0'
make: *** [all] Error 2
我不知道-mips32参数是否存在问题,但是如果我将其删除,我会在以后遇到“不支持操作码”的错误。我不确定这个错误是否会引发不合规问题。
答案 0 :(得分:0)
我找到同样的问题,下面是解决方案。将-march = mips32更改为--march = mips32r2。我使用了我的构建脚本 -
if [[ "$PATH" == *"/usr/local/mips-2012.09/bin"* ]]; then
echo codesourcery toolchain path is already in PATH var
else
export PATH="/usr/local/mips-2012.09/bin:$PATH"
echo added codesourcery toolchain path to PATH var
fi
export AR=mips-linux-gnu-ar
export CC='mips-linux-gnu-gcc -EL'
export CXX='mips-linux-gnu-g++ -EL'
export LINK='mips-linux-gnu-g++ -EL'
export RANLIB=mips-linux-gnu-ranlib
export CFLAGS='-march=mips32r2'
export CCFLAGS='-march=mips32r2'
export CXXFLAGS='-march=mips32r2'
快乐编码: - )