解压后gcc-10-source_10.2.0-8ubuntu1_all.deb
,我进入目录usr/src/gcc-10
,然后发出命令:
$ debian/rules control
我下载了文件夹中的先决条件,src/
然后创建build/
目录并chdir
进入其中
我发出了配置命令:
$ ../src/configure -v --with-pkgversion='Ubuntu 10.2.0-8ubuntu1' --enable-languages=c,c++ --prefix=/usr/local/gcc-10/ --with-gcc-major-version-only --program-suffix=-10 --enable-shared --enable-linker-build-id --without-included-gettext --enable-threads=posix --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none,hsa --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
然后我开始编译源包
$ LIBRARY_PATH=/usr/lib32 time make -j 8 | tee ../build-gcc-10.2.lo
但过了一会儿我收到了错误信息:
checking for x86_64-linux-gnu-gcc... /home/nail/Documents/data/gcc/gcc-10.2/gcc-10-source_10.2.0-8ubuntu1/usr/src/gcc-10/build/./gcc/xgcc -B/home/nail/Documents/data/gcc/gcc-10.2/gcc-10-source_10.2.0-8ubuntu1/usr/src/gcc-10/build/./gcc/ -B/usr/local/gcc-10/x86_64-linux-gnu/bin/ -B/usr/local/gcc-10/x86_64-linux-gnu/lib/ -isystem /usr/local/gcc-10/x86_64-linux-gnu/include -isystem /usr/local/gcc-10/x86_64-linux-gnu/sys-include -isystem /home/nail/Documents/data/gcc/gcc-10.2/gcc-10-source_10.2.0-8ubuntu1/usr/src/gcc-10/build/sys-include -fchecking=1 -m32
checking whether the C compiler works... no
configure: error: in `/home/nail/Documents/data/gcc/gcc-10.2/gcc-10-source_10.2.0-8ubuntu1/usr/src/gcc-10/build/x86_64-linux-gnu/32/libgomp':
configure: error: C compiler cannot create executables
供您参考,如果我提取没有 Debian 补丁的软件包gcc-10.2.0.tar.xz
并放弃相同的过程,则软件包可以顺利编译而不会出现错误!