【问题标题】:Error while compiling gcc4.8.5 for freebsd 11 : error: unknown type name 'choke'为freebsd 11编译gcc4.8.5时出错:错误:未知类型名称'choke'
【发布时间】:2019-02-26 09:01:38
【问题描述】:

在新的 Ubuntu 14.04 机器上重现错误的步骤。

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

现在,要运行的命令

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=''

我可以做些什么来避免这些错误?

【问题讨论】:

  • 也许您使用了对您无效的现有“config.cache”?在启动 configure 之前删除所有现有的“config.cache”文件
  • binutils-2.25.1中没有config.cache 有config.guess config.log config-ml.in config.rpath config.status config.sub
  • 你运行 configure 以便生成一个 config.cache,或者我怀疑你之前有另一个 configure 没有生成适合您的情况的 makefile。问题是 grep error 掩盖了日志的其他消息,因此无法查看发生了什么
  • 我不明白你在说什么。你说我应该怎么做?顺便说一句,这是一个新系统,之前只运行命令是 $sudo apt-get update。就是这样。带有这些命令的新加载的 ubuntu 系统在其上运行。
  • 再一次,做cat config.log | grep -in error 你屏蔽了除了包含“错误”的行之外的所有内容,你只给我们第 77 行然后从 82 行。给出日志的所有前 82 行可以让我们帮助你。

标签: c++ linux ubuntu gcc


【解决方案1】:

我可以做些什么来避免这些错误?

你不能,而且这些错误并不有效,而只是来自 configure 确定你在哪个配置中的方式。

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

#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 &lt; 0 为真。在这种情况下,错误是由choke me 引起的,但它可能来自任何其他无效形式。编译时没有错误表示版本是0.17.0,有错误表示版本不是0.17.0,仅此而已。

所以最后一切都好

【讨论】:

  • 关于cloog的报告:pastebin.com/GuYtcihz我找不到conftest.h,所以...我不认为我可以编辑那个文件
  • @JarvisPennyworth 这些'错误'是不是失败,有办法检测你的配置,不要修改文件,不要尝试删除这些'错误'跨度>
  • 它使整个 gcc 编译失败...pastebin.com/XZHsAUkr
  • @JarvisPennyworth 我没有看到错误/失败查看链接pastebin.com/XZHsAUkr
猜你喜欢
  • 1970-01-01
  • 2014-04-17
  • 2014-12-12
  • 2015-02-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-10-20
  • 2017-04-04
相关资源
最近更新 更多