Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jan 2016 11:27:26 -0800
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        arch@FreeBSD.org
Subject:   build: FAST_DEPEND default (kernel first, then world)
Message-ID:  <56A91A1E.4060304@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--KhfkIiPlw1xAunSpK83XREa2G5lOqUEHn
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi,

WITH_FAST_DEPEND makes 'make depend' mostly a NOP and pushes the
dependency generation to the compilation phase which saves around 35%
time in the kernel build.  Various bugs have been found with the
implementation and all but 1 are now fixed.  The last is not including
the dependency files via .depend (really .MAKE.DEPENDFILE) which make
considers special when finding missing targets (it would be nice if make
had something like a .dinclude to flag any file with this magic).  I
have a fix in testing that I plan to commit today.

I would like to enable FAST_DEPEND by default in the kernel build.

I have been asked to also remove the old mkdep version of 'make depend'.
 I am unsure on this as I think it may be useful for some people for the
sake of debugging.  However it does entail running the preprocessor and
given you can compile the entire kernel in minutes usually it may not be
worth keeping this as opposed to just compiling to generate them.
Keeping a behavior of generating the depend files pre-compile or
without-compile is my only real question here.  I could likely work this
without-compile behavior into the FAST_DEPEND method to avoid needing
mkdep entirely.

The old code is horrendous, slow, and easily wrong and hard to maintain.

Some of the code that would be removed:

sys/conf/kern.post.mk
> .depend: .PRECIOUS ${SRCS}
> .if ${MK_FAST_DEPEND} =3D=3D "no"
>         rm -f ${.TARGET}.tmp
> # C files
>         ${MAKE} -V CFILES_NORMAL -V SYSTEM_CFILES -V GEN_CFILES | \
>             CC=3D"${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${CFLAG=
S}
>         ${MAKE} -V CFILES_CDDL | \
>             CC=3D"${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ZFS_C=
FLAGS} \
>             ${FBT_CFLAGS} ${DTRACE_CFLAGS}
>         ${MAKE} -V CFILES_LINUXKPI | \
>             CC=3D"${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp \
>                 ${CFLAGS} ${LINUXKPI_INCLUDES}
>         ${MAKE} -V CFILES_OFED -V CFILES_MLX5 | \
>             CC=3D"${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp \
>                 ${CFLAGS} ${OFEDINCLUDES}
> # Assembly files
>         ${MAKE} -V SFILES_NORMAL | \
>             CC=3D"${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ASM_C=
FLAGS}
>         ${MAKE} -V SFILES_CDDL | \
>             CC=3D"${_MKDEPCC}" xargs mkdep -a -f ${.TARGET}.tmp ${ZFS_A=
SM_CFLAGS}
>         mv ${.TARGET}.tmp ${.TARGET}
> .else
>         { \
>           echo '.for __dependfile in $${DEPENDFILES_OBJS}'; \
>           echo '.sinclude "$${__dependfile}"'; \
>           echo '.endfor'; \
>         } > ${.TARGET}
> .endif

(the for loop is a pending fix for the .depend issue)

sys/conf/kern.pre.mk
> .if ${MK_FAST_DEPEND} =3D=3D "no" && (make(depend) || make(kernel-depen=
d))       =20
>=20
> # This hack lets us use the ipfilter code without spamming a new
> # include path into contrib'ed source files.
> INCLUDES+=3D -I$S/contrib/ipfilter
>=20
> # ... and the same for ath
> INCLUDES+=3D -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath=
_hal
>=20
> # ... and the same for the NgATM stuff
> INCLUDES+=3D -I$S/contrib/ngatm
>=20
> # ... and the same for vchiq
> INCLUDES+=3D -I$S/contrib/vchiq
>=20
> # ... and the same for twa
> INCLUDES+=3D -I$S/dev/twa
>=20
> # ... and the same for cxgb and cxgbe
> INCLUDES+=3D -I$S/dev/cxgb -I$S/dev/cxgbe
>=20
> .endif


As for world, it is far larger and impacts ports.  So I am still taking
it slow there.  I do want to enable it by default and make the same
decisions there in the future.


--=20
Regards,
Bryan Drewery


--KhfkIiPlw1xAunSpK83XREa2G5lOqUEHn
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBAgAGBQJWqRoeAAoJEDXXcbtuRpfP+fcH/3meIRYw8XDg90LHLR7/kobr
u0P+PBH1r4Ux9kR8PebwGu1k8sB3q9YZWyQBL8Izy8FwGqO+v+toGYwX1R9EiSA2
7cgy/Q1uzs5vxnXSVl2gkmWIHBFEExWFy84rJPC6gSLS1nLAf2KSEmpKo7WvZKx5
Q6hif3yeh7UFPqAh5lZ1Fp8w+CK3bUm2EsfbjV5O53oyX0GNuewJ0WTXE7G9wOfO
XijzZXdVms+yBCNpHKh7WCjuEDKdi8QzVnaOO2SP1zUSM7rBMRvZPbMG/9JDcIg2
2bGZ/dDpEYIdH5nBpx/ixR3njF/2Q1E7JbHxy3iYxDhjJPEqvBfdvpCsHf63MlQ=
=cSh6
-----END PGP SIGNATURE-----

--KhfkIiPlw1xAunSpK83XREa2G5lOqUEHn--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?56A91A1E.4060304>