使用 make 从头开始为 Linux 编译 Glibc-2.11.1 时出错
我正在构建 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
我不明白哪里出了问题。我应该怎样纠正它们?
I am building LFS and I am in the part where we need to install Glibc-2.11.1
http://www.linuxfromscratch.org/lfs/view/6.6/chapter05/glibc.html
I have successfully configured it but I cant run the make command. Whenever I run the command it runs for a while then stops.
I think the following lines show that something I did is incorrect:
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
I dont understand where the things went wrong. What I should to correct them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要安装
gawk
。第 19 行的正则表达式是
这是一个已知问题
mawk< /code> 不理解字符类中未转义的“/”
至少到版本 1.3.3-15(Ubuntu 11.04 (Natty) 上提供的版本)。
mawk
会认为括号内的/
终止了正则表达式,并解释为\/[^
,这肯定是由于不匹配而导致的语法错误<代码>]。glibc 的修复很简单:只需在
/
之前添加一个\
即可。但这也可能是一次专门的“检查”以确保<使用代码>gawk。至少在 glibc-2.14 上这仍然没有改变......(解决方案来源:http://www.linuxquestions.org/questions/linux-from-scratch-13/urgent-help-on-glibc-make-error-with-clfs-590753/)< /sup>
You need to install
gawk
.The regex on Line 19 was
It is a known issue that
mawk
does not understand unescaped '/' in character classes at least up to version 1.3.3-15 (the one supplied on Ubuntu 11.04 (Natty)).mawk
will think the/
inside the bracket terminates the regex, and interpret as\/[^
, which is surely a syntax error due to unmatched]
.The fix for glibc is trivial: just add a
\
before the/
. But this may also be a dedicate "check" to ensuregawk
is used. At least this is still not changed on glibc-2.14…(Source of solution: http://www.linuxquestions.org/questions/linux-from-scratch-13/urgent-help-on-glibc-make-error-with-clfs-590753/)