0

我从 intel 网站下载了 MPSS 软件堆栈版本 3.5.2 的源代码。我正在尝试从源代码编译 xeon phi 移植的 GCC(从 GCC 4.7.0 移植)并将其安装在本地子目录中。但是,我收到以下错误-

k1om-mpss-linux-gcc -dumpspecs > tmp-specs
/bin/sh: k1om-mpss-linux-gcc: command not found

我的配置如下-

# The below directory contains the cross compiled libs
# like assembler and linker
export PATH=$HOME/xeon-phi-gcc/bin
# The configure command
../xeon-phi-gcc/configure \
  --build=x86_64-linux \
  --host=x86_64-mpsssdk-linux \
  --target=k1om-mpss-linux \
  --prefix=$HOME/cross-gcc \
  --enable-languages=c,c++ \
  --with-sysroot=/opt/mpss/3.5.1/sysroots/k1om-mpss-linux \
  --disable-multilib
# Compiling
make

为什么 Makefile 调用k1om-mpss-linux-gcc?这不应该是 make 完成后交叉编译的 gcc 二进制文件吗?我该如何解决这个问题或我错过了什么?

编辑 1:我将配置参数更改为--build=x86_64-mpsssdk-linux --host=x86_64-mpsssdk-linux. 我现在收到以下错误-

In file included from gtype-desc.c:30:0:
../../gcc-4.7.0+mpss3.5.2/gcc/tree.h:3179:11: warning: identifier ‘thread_local’ conflicts with C++ keyword [-Wc++-compat]
  unsigned thread_local : 1;
           ^
gtype-desc.c:8696:18: error: subscripted value is neither array nor pointer nor vector
     sizeof (x_rtl[0]),
                  ^
gtype-desc.c:8815:36: error: subscripted value is neither array nor pointer nor vector
     sizeof (default_target_libfuncs[0]),
                                    ^
gtype-desc.c:8899:31: error: subscripted value is neither array nor pointer nor vector
     sizeof (default_target_rtl[0]),
                               ^
gtype-desc.c:8920:31: error: subscripted value is neither array nor pointer nor vector
     sizeof (default_target_rtl[0]),
                               ^
gtype-desc.c:8927:31: error: subscripted value is neither array nor pointer nor vector
     sizeof (default_target_rtl[0]),
                               ^
gtype-desc.c:8934:31: error: subscripted value is neither array nor pointer nor vector
     sizeof (default_target_rtl[0]),
                               ^

gtype-desc.c是机器生成的文件。

编辑2:我现在收到错误-

/tmp/cc4aDvmI.s: Assembler messages:
/tmp/cc4aDvmI.s:94: Error: no such instruction: `kmov %esi,%k2'
/tmp/cc4aDvmI.s:147: Error: no such instruction: `kmov %edi,%k2'
/tmp/cc4aDvmI.s:255: Error: no such instruction: `kmov %r8d,%k2'
/tmp/cc4aDvmI.s:258: Error: no such instruction: `vpackstorelq %zmm0,(%rsp){%k2}'

我怎样才能解决这个问题 ?这些似乎是向量指令,但我认为 gcc 交叉编译器不支持向量指令。

4

1 回答 1

1

你的--build,--host--targetmachine 都是不同的(这被称为加拿大编译,它与交叉编译略有不同,其中--build--host是相同的)。这意味着需要额外的编译器来构建目标库。

来自 GCC 文档(6.1):

如果 build 和 host 不同,您必须已经构建并安装了一个用于构建目标库的交叉编译器(如果您配置了 --target=foo-bar,这个编译器将被称为 foo-bar-gcc) .

所以,就像你--target的那样k1om-mpss-linux,你需要那个版本的编译器来构建 GCC。

结果将是在机器上编译的 GCC --build,它将在机器上运行,--host并且将生成可以在--target机器上运行的代码。

于 2015-09-01T04:19:49.667 回答