Date: Fri, 16 Nov 2012 00:05:33 +0100 From: Dimitry Andric <dim@FreeBSD.org> To: Andriy Gapon <avg@FreeBSD.org> Cc: Mateusz Guzik <mjguzik@gmail.com>, freebsd-current@FreeBSD.org Subject: Re: compiler info in kernel identification string Message-ID: <50A5753D.5000001@FreeBSD.org> In-Reply-To: <50A5540D.2030707@FreeBSD.org> References: <20121113234303.GA15319@dft-labs.eu> <50A5540D.2030707@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2012-11-15 21:43, Andriy Gapon wrote:> on 14/11/2012 01:43 Mateusz Guzik said the following: >> 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: >> http://people.freebsd.org/~mjg/patches/newvers-compiler.diff > > When are you committing this? Please don't commit it yet, we're not done reviewing. :) For starters, this hardcodes the compiler names "gcc" and "clang", and this will include incorrect information into the kernel version string, if you use another setting for ${CC}. Then, if you fix the script use ${CC}, and set it to gcc versions from ports (for example), the parsing breaks down, as I expected: $ echo $CC /usr/local/bin/gcc47 $ compiler="gcc-"`$CC --version | head -n1 | awk '{ print $3 "-" $4}'` $ echo $compiler gcc-Ports-Collection) So please fix this first. Either handle all possible variants of version output, or just put the version string verbatim into the identification. I would opt for the latter. Last but not least, I am not sure this information belongs in uname at all. Maybe it would be better to put it somewhere else, in a sysctl, or show it in dmesg.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50A5753D.5000001>