简体   繁体   English

将Gcc / G ++编译为NIOS 2 Assembly

[英]Gcc/G++ compilation into NIOS 2 Assembly

I am trying to have gcc/g++ convert C or C++ code into assembly using the -S and -march commands but I am unable to find an exact answer as to whether it supports NIOS 2. --target shows a list of architectures but no obvious NIOS 2. THe GNU compiler website DOES contain a list of NIOS 2 commands. 我正在尝试让gcc / g ++使用-S和-march命令将C或C ++代码转换为汇编代码,但是我无法找到关于它是否支持NIOS 2的确切答案。--target显示了体系结构列表,但没有显而易见的NIOS2。GNU编译器网站确实包含NIOS 2命令的列表。 https://gcc.gnu.org/onlinedocs/gcc/Nios-II-Options.html Does anyone know the -march architecture required for the compiler or whether support was dropped in a previous version? https://gcc.gnu.org/onlinedocs/gcc/Nios-II-Options.html是否有人知道编译器所需的-march架构,或者是否在先前版本中放弃了支持? Currently using gcc 7.3 当前使用gcc 7.3

-v Dump 13:58 -v转储13:58

Using built-in specs.
COLLECT_GCC=gcc
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-27ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04) 
COLLECT_GCC_OPTIONS='-o' 'test' '-S' '-O3' '-march=nios2' '-v'
 /usr/lib/gcc/x86_64-linux-gnu/7/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE loop.cpp -quiet -dumpbase loop.cpp -march=nios2 -auxbase-strip test -O3 -version -o test -fstack-protector-strong -Wformat -Wformat-security
GNU C++14 (Ubuntu 7.3.0-27ubuntu1~18.04) version 7.3.0 (x86_64-linux-gnu)
    compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/7"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/7/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/7
 /usr/include/x86_64-linux-gnu/c++/7
 /usr/include/c++/7/backward
 /usr/lib/gcc/x86_64-linux-gnu/7/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
cc1plus: error: bad value (‘nios2’) for ‘-march=’ switch
cc1plus: note: valid arguments to ‘-march=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 bonnell atom silvermont slm knl x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 btver1 btver2
GNU C++14 (Ubuntu 7.3.0-27ubuntu1~18.04) version 7.3.0 (x86_64-linux-gnu)
    compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072

Your compiler only includes support for the x86 targets (x86-64, i386 and its variantsm and the x32 x86-64 subset). 您的编译器仅包含对x86目标(x86-64,i386及其变体​​和x32 ​​x86-64子集)的支持。 The multilib and multiarch bits refer to something else, not multiple targets. multilibmultiarch位表示其他内容,而不是多个目标。

I don't think there are pre-built cross-compilers targeting NIOS or NIOS 2 as part of Ubuntu (not even universe), so you probably have to build a cross-toolchain yourself, starting with a cross-binutils. 我认为没有将针对NIOS或NIOS 2的预编译交叉编译器作为Ubuntu的一部分(甚至不是Universe),因此您可能必须从交叉binutils开始自己构建一个交叉工具链。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM