为freebsd 11编译gcc4.8.5时出错:错误:未知类型名称'choke'

时间:2019-02-26 09:01:38

标签: c++ linux ubuntu gcc

在新的Ubuntu 14.04计算机上重现该错误的步骤。

  1. 从先前安装的freebsd机器的/ usr中获取include和lib文件夹。
  2. 在ubuntu计算机的主目录中设置文件夹。

现在,要运行的命令

sudo apt-get update
sudo apt-get install gcc g++ freebsd-buildutils gobjc++-mingw-w64-x86-64 gobjc++-mingw-w64-i686 gobjc++ flex bison libisl-dev libelf-dev binutils-dev libc6-dev linux-libc-dev build-essential
sudo apt-get install zip unzip
sudo apt-get install cloog-isl libcloog-isl-dev ppl-dev libspice-client-glib-2.0-dev
sudo apt-get install gawk mawk patch
sudo mkdir /opt/cross-freebsd && sudo chown -R $USER /opt/cross-freebsd
sudo mkdir build-tmp && cd build-tmp
pushd .
cd ~
cp -a include/. /opt/cross-freebsd/x86_64-pc-freebsd10/
cp -a lib/. /opt/cross-freebsd/x86_64-pc-freebsd10/lib/
ls /opt/cross-freebsd/x86_64-pc-freebsd10/
popd
pushd .
cd /opt/cross-freebsd/x86_64-pc-freebsd10/lib
ln -s libm.so.5 libm.so
ln -s libc.so.7 libc.so
popd
wget http://ftp.gnu.org/gnu/binutils/binutils-2.25.1.tar.gz
tar xf binutils-2.25.1.tar.gz 
cd binutils-2.25.1/
./configure --enable-libssp --enable-gold --enable-ld \
  --target=x86_64-pc-freebsd10 --prefix=/opt/cross-freebsd
fmake -j4
fmake install
cat config.log | grep -in error

预期:没有错误

结果:

77:Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.4' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
82:gcc: error: unrecognized command line option '-V'
83:gcc: fatal error: no input files
87:gcc: error: unrecognized command line option '-qversion'
88:gcc: fatal error: no input files
137:Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.4' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
142:g++: error: unrecognized command line option '-V'
143:g++: fatal error: no input files
147:g++: error: unrecognized command line option '-qversion'
148:g++: fatal error: no input files
238:conftest.c:15:5: error: unknown type name 'choke'
740:stage2_werror_flag=''

如何避免这些错误?

1 个答案:

答案 0 :(得分:0)

  

如何避免这些错误?

您不能,并且这些错误不是有效的,而只是来自 configure 确定您所使用的配置的方式。

例如,检查CLooG的版本是否为0.17.0,它将编译包含以下内容的文件:

#include "cloog/version.h"
int
main ()
{
#if CLOOG_VERSION_MAJOR != 0     || CLOOG_VERSION_MINOR != 17     || CLOOG_VERSION_REVISION < 0
     choke me
    #endif
   ;
   return 0;
 }

在编译时出现错误表示CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 17 || CLOOG_VERSION_REVISION < 0为真。在那种情况下,错误是由于choke me引起的,但可能是由于其他任何无效形式引起的。编译时没有错误,表明版本是0.17.0,编译时没有错误,表明版本不是0.17.0,就是全部。

所以最后一切都好

相关问题