Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 202511 - sys-libs/glibc-2.7-r1 fails to build with bsd awk
Summary: sys-libs/glibc-2.7-r1 fails to build with bsd awk
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: http://sourceware.org/ml/libc-alpha/2...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-16 19:52 UTC by Alexis Ballier
Modified: 2007-12-24 19:26 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
proposed patch (glibc27_please_bsd_awk.patch,567 bytes, patch)
2007-12-21 11:00 UTC, Alexis Ballier
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexis Ballier gentoo-dev 2007-12-16 19:52:21 UTC
using crossdev -t amd64 on ~x86-fbsd, glibc 2.7-r1 fails:

                  /var/tmp/cross/x86_64-pc-linux-gnu/portage/cross-x86_64-pc-linux-gnu/glibc-2.7-r1/work/build-amd64-x86_64-pc-linux-gnu-nptl/elf/librtld.os -Wl,--version-script=/var/tmp/cross/x86_64-pc-linux-gnu/portage/cross-x86_64-pc-linux-gnu/glibc-2.7-r1/work/build-amd64-x86_64-pc-linux-gnu-nptl/ld.map            \
                  -Wl,-soname=ld-linux-x86-64.so.2 -T /var/tmp/cross/x86_64-pc-linux-gnu/portage/cross-x86_64-pc-linux-gnu/glibc-2.7-r1/work/build-amd64-x86_64-pc-linux-gnu-nptl/elf/ld.so.lds
rm -f /var/tmp/cross/x86_64-pc-linux-gnu/portage/cross-x86_64-pc-linux-gnu/glibc-2.7-r1/work/build-amd64-x86_64-pc-linux-gnu-nptl/elf/ld.so.lds
readelf -s /var/tmp/cross/x86_64-pc-linux-gnu/portage/cross-x86_64-pc-linux-gnu/glibc-2.7-r1/work/build-amd64-x86_64-pc-linux-gnu-nptl/elf/ld.so \
          | awk '($7 ~ /^UND(|EF)$/ && $1 != "0:" && $4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
awk: illegal primary in regular expression ^UND(|EF)$ at EF)$
 source line number 1
 context is
        ($7 ~ >>>  /^UND(|EF)$/ <<<
gmake[2]: *** [/var/tmp/cross/x86_64-pc-linux-gnu/portage/cross-x86_64-pc-linux-gnu/glibc-2.7-r1/work/build-amd64-x86_64-pc-linux-gnu-nptl/elf/ld.so] Error 2
gmake[2]: Leaving directory `/var/tmp/cross/x86_64-pc-linux-gnu/portage/cross-x86_64-pc-linux-gnu/glibc-2.7-r1/work/glibc-2.7/elf'
gmake[1]: *** [elf/subdir_lib] Error 2
gmake[1]: Leaving directory `/var/tmp/cross/x86_64-pc-linux-gnu/portage/cross-x86_64-pc-linux-gnu/glibc-2.7-r1/work/glibc-2.7'
gmake: *** [all] Error 2
 ^[[31;01m*^[[0m
 ^[[31;01m*^[[0m ERROR: cross-x86_64-pc-linux-gnu/glibc-2.7-r1 failed.
 ^[[31;01m*^[[0m Call stack:
 ^[[31;01m*^[[0m               ebuild.sh, line   46:  Called src_compile
 ^[[31;01m*^[[0m             environment, line 3322:  Called eblit-run 'src_compile'
 ^[[31;01m*^[[0m             environment, line 1079:  Called eblit-glibc-src_compile
 ^[[31;01m*^[[0m       src_compile.eblit, line  168:  Called src_compile
 ^[[31;01m*^[[0m             environment, line 3322:  Called eblit-run 'src_compile'
 ^[[31;01m*^[[0m             environment, line 1079:  Called eblit-glibc-src_compile
 ^[[31;01m*^[[0m       src_compile.eblit, line  179:  Called toolchain-glibc_src_compile

forcing to use gawk (by e.g. replacing bsd's awk by gawk) workarounds it.
Comment 1 Alexis Ballier gentoo-dev 2007-12-21 11:00:38 UTC
Created attachment 139031 [details, diff]
proposed patch

bsd awk doesnt seem to like having to match the empty string. I haven't found any reliable documentation about this corner case, but changing the regexp like that fixes the problem here.
Another solution would be to force it using gawk, but considering the size of the patch that seems silly to add such a requirement.

Please let me know if you want me to send it upstream (and where to send it), but the patch is so trivial that I think it could be sent with other ones.
Comment 2 SpanKY gentoo-dev 2007-12-22 07:44:52 UTC
while i consider the syntax used here pretty useful, i think it's a violation of POSIX ... please refer to:
http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html

9.4.3 ERE Special Characters
The vertical-line is special except when used in a bracket expression (see RE Bracket Expression). A vertical-line appearing first or last in an ERE, or immediately following a vertical-line or a left-parenthesis, or immediately preceding a right-parenthesis, produces undefined results.

my interpretation of this is that "(|DEF)" is invalid

anyone else feel like reading that and confirming ?
Comment 3 SpanKY gentoo-dev 2007-12-24 19:15:46 UTC
thinking about it, these two should be completely interchangeable:
moo(|cow)
moo(cow)?

so i'll patch it to do the latter
Comment 4 SpanKY gentoo-dev 2007-12-24 19:25:40 UTC
added to current glibc-2.7-r1 ebuild

http://sources.gentoo.org/gentoo/src/patchsets/glibc/2.7/1050_all_glibc-posix-awk.patch?rev=1.1