簡體   English   中英

如何從源代碼編譯至強phi修補的gcc?

[英]How to compile Xeon phi patched gcc from source?

我從英特爾網站下載了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:我將config參數更改為--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交叉編譯器不支持矢量指令。

您的--build ,-- --host--target機器都不同(這被稱為加拿大編譯,這與交叉編譯( --build--host相同)略有不同)。 這意味着需要額外的編譯器來構建目標庫。

從GCC文檔(6.1):

如果構建和宿主不同,則必須已經構建並安裝了將用於構建目標庫的交叉編譯器(如果使用--target = foo-bar配置,則該編譯器將稱為foo-bar-gcc) 。

因此,由於您的--targetk1om-mpss-linux ,因此需要該版本的編譯器才能構建GCC。

結果將是在--build機器上編譯的GCC,該機器將在--host機器上運行,並生成可在--target機器上運行的代碼。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM