From owner-freebsd-current@FreeBSD.ORG Thu Nov 15 23:05:40 2012 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3C5D1469; Thu, 15 Nov 2012 23:05:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id E5C378FC12; Thu, 15 Nov 2012 23:05:39 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:548c:a8ca:65a3:1c17] (unknown [IPv6:2001:7b8:3a7:0:548c:a8ca:65a3:1c17]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id B33345C59; Fri, 16 Nov 2012 00:05:32 +0100 (CET) Message-ID: <50A5753D.5000001@FreeBSD.org> Date: Fri, 16 Nov 2012 00:05:33 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Andriy Gapon Subject: Re: compiler info in kernel identification string References: <20121113234303.GA15319@dft-labs.eu> <50A5540D.2030707@FreeBSD.org> In-Reply-To: <50A5540D.2030707@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Mateusz Guzik , freebsd-current@FreeBSD.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 23:05:40 -0000 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.