Scratch 10.2.0 gcc中的Linux失败

问题描述

伙计们,我尝试从Scratch 10.2.0用Linux构建gcc。 我严格按照说明进行操作,但是make命令引发以下错误

checking whether gcc understands -c and -o together... Global symbol "$lineWnr" requires explicit package name (did you forget to declare "my $lineWnr"?) at /usr/share/texinfo/Texinfo/ParserNonXS.pm line 5205.
Compilation Failed in require at /usr/bin/makeinfo line 997.
make[2]: *** [Makefile:3318: doc/gccinstall.info] Error 255
make[2]: *** Waiting for unfinished jobs....
Global symbol "$lineWnr" requires explicit package name (did you forget to declare "my $lineWnr"?) at /usr/share/texinfo/Texinfo/ParserNonXS.pm line 5205.
Compilation Failed in require at /usr/bin/makeinfo line 997.
make[2]: *** [Makefile:3311: doc/cpp.info] Error 255
yes
checking how to run the C preprocessor... Global symbol "$lineWnr" requires explicit package name (did you forget to declare "my $lineWnr"?) at /usr/share/texinfo/Texinfo/ParserNonXS.pm line 5205.
Compilation Failed in require at /usr/bin/makeinfo line 997.
make[2]: *** [Makefile:3311: doc/gcc.info] Error 255
Global symbol "$lineWnr" requires explicit package name (did you forget to declare "my $lineWnr"?) at /usr/share/texinfo/Texinfo/ParserNonXS.pm line 5205.
Compilation Failed in require at /usr/bin/makeinfo line 997.
gcc -E
make[2]: *** [Makefile:3311: doc/cppinternals.info] Error 255
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... /bin/sh ../../gcc/../move-if-change tmp-optionlist optionlist
echo timestamp > s-options
yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking whether make supports nested variables... yes
checking dependency style of gcc... gcc3
checking whether to enable maintainer-specific portions of Makefiles... no
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... ld
checking if the linker (ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... nm
checking the name lister (nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for ld option to reload object files... -r
checking for x86_64-pc-linux-gnu-objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for x86_64-pc-linux-gnu-ar... ar
checking for x86_64-pc-linux-gnu-strip... no
checking for strip... strip
checking for x86_64-pc-linux-gnu-ranlib... ranlib
checking command to parse nm output from gcc object... ok
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... ld -m elf_x86_64
checking if the linker (ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether basename is declared... yes
checking whether gcc supports -W... rm gcc.pod
make[2]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build/gcc'
make[1]: *** [Makefile:4382: all-gcc] Error 2
make[1]: *** Waiting for unfinished jobs....
yes
checking whether gcc supports -Wall... yes
checking for socket libraries... checking for connect... yes
checking for gethostbyname... yes

checking for exported symbols... yes
checking for -rdynamic... yes
checking for library containing dlopen... -ldl
checking for -fPIC -shared... yes
checking for socketpair... yes
checking for select... yes
checking for fork... yes
configure: updating cache ./config.cache
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating cc1plugin-config.h
config.status: executing depfiles commands
config.status: executing libtool commands
make[1]: Leaving directory '/mnt/lfs/sources/gcc-10.2.0/build'
make: *** [Makefile:945: all] Error 2

也许有人可以帮助我。 如果您需要任何其他信息,请随时询问。

解决方法

您似乎要构建的软件包( ahem configure)已损坏。

这种情况有时会发生,因为几乎不可能检查所有可能的依赖关系是否正确构建。倒霉!

因此,编译器告诉您无法理解文件/usr/share/texinfo/Texinfo/ParserNonXS.pm 您在这里有两个选择:

  • 您发现配置开关需要texinfo并将其禁用(类似于./configure blablabla --disable-texinfo
  • 您可以通过手动编辑文件/usr/share/texinfo/Texinfo/ParserNonXS.pm并在第5205行添加丢失的行my $lineWnr来修复文件$(".some-class").addClass("another-class"); 。这可能是Perl脚本,因此此处需要一些perl知识才能破译文件。

由于您正在执行LFS构建,因此我想您的Texinfo软件包应该与您的GCC软件包所期望的软件包匹配。旧的GCC需要旧的texinfo软件包,而较新的GCC需要新的texinfo软件包。如果没有texinfo,则应首先安​​装它。

,

此:

[...]全局符号“ $ lineWnr”要求在/usr/share/texinfo/Texinfo/ParserNonXS.pm第5205行中有显式的软件包名称(您是否忘记声明“ my $ lineWnr”?)。

...似乎是来自Perl的错误消息。这样,您的texinfo版本就与用于运行它的Perl版本不兼容。这可能是因为texinfo软件包太旧或Perl太新,或者可能是因为texinfo软件包在安装时未正确配置。