【问题标题】:error while using make to compile Glibc-2.11.1 for Linux From Scratch使用 make 从头开始​​为 Linux 编译 Glibc-2.11.1 时出错
【发布时间】:2011-09-17 19:45:15
【问题描述】:

我正在构建 LFS,我在需要安装 Glibc-2.11.1 的部分

http://www.linuxfromscratch.org/lfs/view/6.6/chapter05/glibc.html

我已成功配置,但无法运行 make 命令。每当我运行命令时,它都会运行一段时间然后停止。

我认为以下几行表明我所做的事情是不正确的:

mawk: scripts/gen-sorted.awk: line 19: regular expression compile failed (bad class -- [], [^] or [)
/[^
mawk: scripts/gen-sorted.awk: line 19: syntax error at or near ]
mawk: scripts/gen-sorted.awk: line 19: runaway regular expression /, "", subd ...
make[1]: Leaving directory `/mnt/lfs/sources/glibc-2.11.1'
make[1]: Entering directory `/mnt/lfs/sources/glibc-2.11.1'
mawk -f scripts/gen-sorted.awk \
           -v subdirs='csu assert ctype locale intl catgets math setjmp signal stdlib stdio-common libio malloc string wcsmbs time dirent grp pwd posix io termios resource misc socket sysvipc gmon gnulib iconv iconvdata wctype manual shadow gshadow po argp crypt nss localedata timezone rt conform debug libidn dlfcn elf' \
           -v srcpfx='' \
           nptl/sysdeps/pthread/Subdirs sysdeps/unix/inet/Subdirs sysdeps/unix/Subdirs assert/Depend intl/Depend catgets/Depend stdlib/Depend stdio-common/Depend libio/Depend malloc/Depend string/Depend wcsmbs/Depend time/Depend posix/Depend iconvdata/Depend nss/Depend localedata/Depend rt/Depend debug/Depend > /mnt/lfs/sources/glibc-build/sysd-sorted-tmp
mawk: scripts/gen-sorted.awk: line 19: regular expression compile failed (bad class -- [], [^] or [)
/[^
mawk: scripts/gen-sorted.awk: line 19: syntax error at or near ]
mawk: scripts/gen-sorted.awk: line 19: runaway regular expression /, "", subd ...
rm -f /mnt/lfs/sources/glibc-build/stamp.o; > /mnt/lfs/sources/glibc-build/stamp.o
rm -f /mnt/lfs/sources/glibc-build/stamp.os; > /mnt/lfs/sources/glibc-build/stamp.os
rm -f /mnt/lfs/sources/glibc-build/stamp.oS; > /mnt/lfs/sources/glibc-build/stamp.oS
cd /mnt/lfs/sources/glibc-build && /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.4.3/../../../../i686-lfs-linux-gnu/bin/ar cruv libc.a `cat stamp.o`
: /mnt/lfs/sources/glibc-build/libc.a
cd /mnt/lfs/sources/glibc-build && /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.4.3/../../../../i686-lfs-linux-gnu/bin/ar cruv libc_pic.a `cat stamp.os`
: /mnt/lfs/sources/glibc-build/libc_pic.a
cd /mnt/lfs/sources/glibc-build && /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.4.3/../../../../i686-lfs-linux-gnu/bin/ar cruv libc_nonshared.a `cat stamp.oS`
: /mnt/lfs/sources/glibc-build/libc_nonshared.a
make[1]: *** No rule to make target `/mnt/lfs/sources/glibc-build/Versions.all', needed by `/mnt/lfs/sources/glibc-build/abi-versions.h'.  Stop.
make[1]: Leaving directory `/mnt/lfs/sources/glibc-2.11.1'
make: *** [all] Error 2

real    0m11.390s
user    0m2.044s
sys 0m1.724s
lfs@rohanchrome:/mnt/lfs/sources/glibc-build$ make
make -r PARALLELMFLAGS="" CVSOPTS="" -C /mnt/lfs/sources/glibc-2.11.1 objdir=`pwd` all
make[1]: Entering directory `/mnt/lfs/sources/glibc-2.11.1'
mawk -f scripts/gen-sorted.awk \
           -v subdirs='csu assert ctype locale intl catgets math setjmp signal stdlib stdio-common libio malloc string wcsmbs time dirent grp pwd posix io termios resource misc socket sysvipc gmon gnulib iconv iconvdata wctype manual shadow gshadow po argp crypt nss localedata timezone rt conform debug libidn dlfcn elf' \
           -v srcpfx='' \
           nptl/sysdeps/pthread/Subdirs sysdeps/unix/inet/Subdirs sysdeps/unix/Subdirs assert/Depend intl/Depend catgets/Depend stdlib/Depend stdio-common/Depend libio/Depend malloc/Depend string/Depend wcsmbs/Depend time/Depend posix/Depend iconvdata/Depend nss/Depend localedata/Depend rt/Depend debug/Depend > /mnt/lfs/sources/glibc-build/sysd-sorted-tmp
mawk: scripts/gen-sorted.awk: line 19: regular expression compile failed (bad class -- [], [^] or [)
/[^
mawk: scripts/gen-sorted.awk: line 19: syntax error at or near ]
mawk: scripts/gen-sorted.awk: line 19: runaway regular expression /, "", subd ...
make[1]: *** No rule to make target `/mnt/lfs/sources/glibc-build/Versions.all', needed by `/mnt/lfs/sources/glibc-build/abi-versions.h'.  Stop.
make[1]: Leaving directory `/mnt/lfs/sources/glibc-2.11.1'
make: *** [all] Error 2

我不明白哪里出了问题。我应该如何纠正它们?

【问题讨论】:

  • 任何人都知道是什么导致了这个错误以及如何解决它?请帮忙:D
  • 你不能修复scripts/gen-sorted.awk第19行的错误正则表达式吗?您可能想将其作为一个单独的问题发布,并确保它工作正常。您可能还想将您的 glibc 标签换成 'linux-from-scratch'(它有 2 个关注者)(对不起),祝你好运!
  • lfs-support 邮件列表正是为此目的而存在的。详情请看这里:LFS 邮件列表 (linuxfromscratch.org/mail.html)
  • @shellter:谢谢伙计.....是的,我用谷歌搜索了这个错误,它似乎是 gen-sorted.awk 的问题,我修复了它......错误似乎在第 19 行还有另外两行…………
  • 您能否发布您为解决此问题所做的工作作为答案?

标签: linux bash ubuntu glibc linux-from-scratch


【解决方案1】:

您需要安装gawk

sudo apt-get install gawk

第 19 行的正则表达式是

/\/[^/]+$/

mawk does not understand unescaped '/' in character classes 至少到版本 1.3.3-15(Ubuntu 11.04 (Natty) 上提供的版本)是一个已知问题。 mawk 会认为括号内的/ 会终止正则表达式,并解释为\/[^,这肯定是由于] 不匹配导致的语法错误。

glibc 的修复很简单:只需在 / 之前添加一个 \。但这也可能是一个专门的“检查”to ensure gawk is used。至少在 glibc-2.14 上这仍然没有改变……

(解决方案来源:http://www.linuxquestions.org/questions/linux-from-scratch-13/urgent-help-on-glibc-make-error-with-clfs-590753/

【讨论】:

    猜你喜欢
    • 2014-09-30
    • 2012-08-04
    • 1970-01-01
    • 1970-01-01
    • 2013-11-20
    • 1970-01-01
    • 2011-07-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多