Re: compiler info in kernel identification string

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Fri, 16 Nov 2012 00:05:33 +0100
On 2012-11-15 21:43, Andriy Gapon wrote:> on 14/11/2012 01:43 Mateusz Guzik said the following:
>> Hello,
>>
>> avg_at_ 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.
Received on Thu Nov 15 2012 - 22:05:40 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:32 UTC