Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 May 2017 15:39:25 +0200
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Vladimir Zakharov <zakharov.vv@gmail.com>
Cc:        freebsd-current <freebsd-current@freebsd.org>, Ed Maste <emaste@freebsd.org>, Kyle Evans <kevans91@ksu.edu>
Subject:   Re: make buildworld broken at r317821 (libsysdecode)
Message-ID:  <C994B75F-3A74-4102-9888-DFBF8B5A228C@FreeBSD.org>
In-Reply-To: <20170505093141.ulbr7j65gxvzyz6i@vzakharov>
References:  <20170505093141.ulbr7j65gxvzyz6i@vzakharov>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_ABB39161-4836-4987-AA8E-E0A6E26FF92C
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii

On 5 May 2017, at 11:31, Vladimir Zakharov <zakharov.vv@gmail.com> wrote:
> 
> Cannot build world due to error in compiling lib/libsysdecode.
...
> --- all_subdir_lib/libsysdecode ---
> ioctl.c:30:10: fatal error: 'cam/cam_compat.h:#define' file not found
> #include <cam/cam_compat.h:#define>
>         ^~~~~~~~~~~~~~~~~~~~~~~~~~
...
> $ cat /etc/src.conf
...
> WITH_BSD_GREP=

This appears to be caused by bsdgrep. :-/ The build for lib/libsysdecode
uses a shell script, mkioctls, to generate a ioctl.c file at build time.
This script contains the following fragment:

ioctl_includes=$(
        cd $includedir
        find -H -s * -name '*.h' | \
        egrep -v '(.*disk.*|net/pfvar|net/if_pfsync)\.h' | \
                xargs egrep -l \
'^#[    ]*define[       ]+[A-Za-z_][A-Za-z0-9_]*[       ]+_IO[^a-z0-9_]' |
                awk '{printf("#include <%s>\\n", $1)}'
)

The idea is that all headers are searched for defines of ioctl macros,
which start with _IO.  The -l option to egrep is used to print only the
matching filenames, not the matched content itself.

However, this option seems to be broken in bsdgrep, as it *does* display
the matched content:

$ gnugrep -l printf /usr/include/stdio.h
/usr/include/stdio.h

$ bsdgrep -l printf /usr/include/stdio.h
#define __SSTR  0x0200          /* this is an sprintf/snprintf string */
/usr/include/stdio.h

I did a quick check, and this option seems to have been accidentally
broken by r317703 [1] ("bsdgrep: fix -w flag matching with an empty
pattern").

Ed, Kyle, any idea where the problem might be?

-Dimitry

[1] https://svnweb.freebsd.org/base?view=revision&revision=317703


--Apple-Mail=_ABB39161-4836-4987-AA8E-E0A6E26FF92C
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.30

iEYEARECAAYFAlkMgJoACgkQsF6jCi4glqNu8ACg/a0QYIURmpY723bJxwEkS9xM
KJ8An0wvccC+Ef45e+ZhG/fwFyLSbJwM
=Vtxa
-----END PGP SIGNATURE-----

--Apple-Mail=_ABB39161-4836-4987-AA8E-E0A6E26FF92C--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C994B75F-3A74-4102-9888-DFBF8B5A228C>