From owner-freebsd-current@FreeBSD.ORG Thu Nov 15 23:35:28 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 6F160372; Thu, 15 Nov 2012 23:35:28 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx1.freebsd.org (Postfix) with ESMTP id 9C10D8FC14; Thu, 15 Nov 2012 23:35:27 +0000 (UTC) Received: by mail-wi0-f178.google.com with SMTP id hm14so1272538wib.13 for ; Thu, 15 Nov 2012 15:35:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=A4g527LvXI6Jt39ivCJUuoyWLVq47cb3scSLP27ONrc=; b=P4lPdkX6SYFWGOCaAb7Ev2QGHzswdc0am9+dmypU/HASpiUaGSQEdw9SabVoUTVb8D cd4rtl4WndFiaVegCdIcfip9uyW2afKbjpLYwhwtKPU5DfXpkopMqEpgbOkD1TtV+0fX f3CtImGMdjxT2NGi7bK37Yana4Mv9PonQAie3Xe+GkOnnZ4Mi0j6OQ21JCBGw1b1bT3C itp+PWkZc9DOllwui3Qjh4JseulUsubW3G50Go/rwvfD8qRWyd6H+CRHXaAFFDUTChFs t5RAhqtj4tM3mQjJ/JadKG1uHLao7gK96cF8mMNQdBseuz+5yZrVJCL3EaS60vDfBIMJ kzEA== Received: by 10.180.19.197 with SMTP id h5mr2375506wie.22.1353022526571; Thu, 15 Nov 2012 15:35:26 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPS id d9sm1812204wiw.0.2012.11.15.15.35.25 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Nov 2012 15:35:25 -0800 (PST) Date: Fri, 16 Nov 2012 00:35:15 +0100 From: Mateusz Guzik To: Dimitry Andric Subject: Re: compiler info in kernel identification string Message-ID: <20121115233515.GB19671@dft-labs.eu> Mail-Followup-To: Mateusz Guzik , Dimitry Andric , Andriy Gapon , freebsd-current@FreeBSD.org References: <20121113234303.GA15319@dft-labs.eu> <50A5540D.2030707@FreeBSD.org> <50A5753D.5000001@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <50A5753D.5000001@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-current@FreeBSD.org, Andriy Gapon 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:35:28 -0000 On Fri, Nov 16, 2012 at 12:05:33AM +0100, Dimitry Andric wrote: > 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}. > Yes, I blindly assumed that both gcc and clang will keep format of --version. For everything else you would get 'unknown-compiler'. > > 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. As stated in original mail, I don't have strong opinions on this. I only care about accessibility of this information. So, here is my patch that adds information at boot time and sysctl kern.compiler: http://people.freebsd.org/~mjg/patches/compiler-info.diff Sample output: Copyright (c) 1992-2012 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 10.0-CURRENT #281 r243095=c24a389-dirty: Fri Nov 16 00:24:46 CET 2012 f@lap:/usr/obj/i386.i386/srv/repos/freebsd/sys/DEVEL i386 Compiled with cc (GCC) 4.2.1 20070831 patched [FreeBSD] <------ HERE WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. CPU: Intel(R) Core(TM)2 Duo CPU P9600 @ 2.66GHz (2635.19-MHz 686-class CPU) [..] As you can see only first line is captured and I go with assumption that --version works, I hope this is ok. -- Mateusz Guzik