compiler info in kernel identification string

David Wolfskill david at
Tue Nov 13 23:57:56 UTC 2012

On Wed, Nov 14, 2012 at 12:43:03AM +0100, Mateusz Guzik wrote:
> Hello,
> avg@ suggested to include compiler version in the kernel so that it's
> present in uname (and one can easly tell what was used to compile it).
> Here is my attempt:
> Basically adds compiler name and version/revision after revision of
> system sources.
> Sample output from dirty git sources:
> gcc:
> FreeBSD 10.0-CURRENT #7 r242962=264d569-dirty(gcc-4.2.1-20070831): Wed
> Nov 14 00:11:51 CET 2012
> clang:
> FreeBSD 10.0-CURRENT #8 r242962=264d569-dirty(clang-r162107): Wed Nov 14
> 00:12:26 CET 2012
> ... 
> I have no strong opinions on format, I just want this information easly
> accessible.
> Comments?
> ....

I like the idea, but I have long found the idea of putting this type of
logic (including VCS-awareness) in itself something that is
prone to turn what should be a rather simple script into a ... mess.

What I have been using for several months has been a modified
that uses an externally-defined function (from a file that is sourced)
to handle whatever VCS-specific things I think are appropriate.  (Thus,
folks who want to use one VCS don't need to have test for
VCSen they don't use; they could also provide a sample file that
provides the function.  An installation could use a symlink to point to
the function definition of choice....  We could even have a "kitchen
sink" default, that goes through all the hoops & gyrations the current
code does, if folks want that.)

Extending that to define a function for compiler-awareness should be
straightforward -- and (IMO) avoid cluttering even more.

Caveat: I'm not a committer.  I do exercise a bit more than
many folks, though.  :-}

David H. Wolfskill				david at
Taliban: Evil men with guns afraid of truth from a 14-year old girl.

See for my public key.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <>

More information about the freebsd-current mailing list