LFS-6.7:glibc-2.12.1编译失败解决方法

原文:http://www.linuxquestions.org/questions/linux-from-scratch-13/gcc-error-in-chapter-5-a-632919/

 

/[^
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.5.1'
make[1]: Entering directory `/mnt/lfs/sources/glibc-2.5.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 po argp crypt nss localedata timezone rt conform debug 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 && /tools/bin/ar cruv libc.a `cat stamp.o`
: /mnt/lfs/sources/glibc-build/libc.a
cd /mnt/lfs/sources/glibc-build && /tools/bin/ar cruv libc_pic.a `cat stamp.os`
: /mnt/lfs/sources/glibc-build/libc_pic.a
cd /mnt/lfs/sources/glibc-build && /tools/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.5.1'
make: *** [all] Error 2
lfs@ameya-desktop:/mnt/lfs/sources/glibc-build$

 

解决方法:

I don't know if you have found an answer yet or not, but here is what worked for me:
I modified line 19 of the scripts/gen-sorted.awk from sub(///[^/]+$/, "", subdir); to sub(///[^//]+$/, "", subdir); it seems that the forward-slash within the square brackets needs to be escaped. This issue will crop up 2 more times in the script, around lines 60 and 64. After those modifications, the make command worked fine.

I'm building LFS 6.3 on an eMac (PPC) running Ubuntu 7.04 kernel 2.6.20-16-powerpc

 

说明:

实际上是scripts/gen-sorted.awk脚本写的不严谨导致的,更新版本的gawk或者mawk上对语法检查更严格导致出错。

 

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值