<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>202511</bug_id>
          
          <creation_ts>2007-12-16 19:52 0000</creation_ts>
          <short_desc>sys-libs/glibc-2.7-r1 fails to build with bsd awk</short_desc>
          <delta_ts>2007-12-24 19:26:14 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          <bug_file_loc>http://sourceware.org/ml/libc-alpha/2007-12/msg00020.html</bug_file_loc>
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>aballier@gentoo.org</reporter>
          <assigned_to>toolchain@gentoo.org</assigned_to>
          <cc>bsd@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>aballier@gentoo.org</who>
            <bug_when>2007-12-16 19:52:21 0000</bug_when>
            <thetext>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 &apos;($7 ~ /^UND(|EF)$/ &amp;&amp; $1 != &quot;0:&quot; &amp;&amp; $4 != &quot;REGISTER&quot;) { print; p=1 } END { exit p != 0 }&apos;
awk: illegal primary in regular expression ^UND(|EF)$ at EF)$
 source line number 1
 context is
        ($7 ~ &gt;&gt;&gt;  /^UND(|EF)$/ &lt;&lt;&lt;
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&apos;
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&apos;
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 &apos;src_compile&apos;
 ^[[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 &apos;src_compile&apos;
 ^[[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&apos;s awk by gawk) workarounds it.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>aballier@gentoo.org</who>
            <bug_when>2007-12-21 11:00:38 0000</bug_when>
            <thetext>Created an attachment (id=139031)
proposed patch

bsd awk doesnt seem to like having to match the empty string. I haven&apos;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.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2007-12-22 07:44:52 0000</bug_when>
            <thetext>while i consider the syntax used here pretty useful, i think it&apos;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 &quot;(|DEF)&quot; is invalid

anyone else feel like reading that and confirming ?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2007-12-24 19:15:46 0000</bug_when>
            <thetext>thinking about it, these two should be completely interchangeable:
moo(|cow)
moo(cow)?

so i&apos;ll patch it to do the latter</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2007-12-24 19:25:40 0000</bug_when>
            <thetext>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</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>139031</attachid>
            <date>2007-12-21 11:00 0000</date>
            <desc>proposed patch</desc>
            <filename>glibc27_please_bsd_awk.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIGdsaWJjLTIuNy9lbGYvTWFrZWZpbGUub2xkCTIwMDctMTItMjAgMjM6Mzc6MTYgKzAwMDAK
KysrIGdsaWJjLTIuNy9lbGYvTWFrZWZpbGUJMjAwNy0xMi0yMCAyMzozNzozMyArMDAwMApAQCAt
MzE1LDcgKzMxNSw3IEBACiAJCSAgLVdsLC1zb25hbWU9JChydGxkLWluc3RhbGxlZC1uYW1lKSAt
VCAkQC5sZHMKIAlybSAtZiAkQC5sZHMKIAlyZWFkZWxmIC1zICRAIFwKLQkgIHwgYXdrICcoJCQ3
IH4gL15VTkQofEVGKSQkLyAmJiAkJDEgIT0gIjA6IiAmJiAkJDQgIT0gIlJFR0lTVEVSIikgeyBw
cmludDsgcD0xIH0gRU5EIHsgZXhpdCBwICE9IDAgfScKKwkgIHwgYXdrICcoJCQ3IH4gL14oVU5E
fFVOREVGKSQkLyAmJiAkJDEgIT0gIjA6IiAmJiAkJDQgIT0gIlJFR0lTVEVSIikgeyBwcmludDsg
cD0xIH0gRU5EIHsgZXhpdCBwICE9IDAgfScKIAogIyBpbnRlcnAuYyBleGlzdHMganVzdCB0byBn
ZXQgdGhpcyBzdHJpbmcgaW50byB0aGUgbGlicmFyaWVzLgogQ0ZMQUdTLWludGVycC5jID0gLUQn
UlVOVElNRV9MSU5LRVI9IiQoc2xpYmRpcikvJChydGxkLWluc3RhbGxlZC1uYW1lKSInIFwK
</data>        

          </attachment>
    </bug>

</bugzilla>