Author: avg
Date: Wed Mar  6 09:16:01 2013
New Revision: 247875
URL: http://svnweb.freebsd.org/changeset/base/247875

Log:
  MFC r246246,246254: print compiler version in the kernel banner

Modified:
  stable/8/sys/conf/newvers.sh
  stable/8/sys/kern/init_main.c
  stable/8/sys/kern/kern_mib.c
  stable/8/sys/sys/systm.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/conf/   (props changed)
  stable/8/sys/kern/   (props changed)
  stable/8/sys/sys/   (props changed)

Modified: stable/8/sys/conf/newvers.sh
==============================================================================
--- stable/8/sys/conf/newvers.sh        Wed Mar  6 09:12:38 2013        
(r247874)
+++ stable/8/sys/conf/newvers.sh        Wed Mar  6 09:16:01 2013        
(r247875)
@@ -86,6 +86,7 @@ fi
 touch version
 v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} t=`date`
 i=`${MAKE:-make} -V KERN_IDENT`
+compiler_v=$($(${MAKE:-make} -V CC) -v 2>&1 | grep 'version')
 
 for dir in /bin /usr/bin /usr/local/bin; do
        if [ -x "${dir}/svnversion" ] ; then
@@ -141,6 +142,7 @@ $COPYRIGHT
 
 char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR;
 char version[sizeof(VERSTR) > 256 ? sizeof(VERSTR) : 256] = VERSTR;
+char compiler_version[] = "${compiler_v}";
 char ostype[] = "${TYPE}";
 char osrelease[sizeof(RELSTR) > 32 ? sizeof(RELSTR) : 32] = RELSTR;
 int osreldate = ${RELDATE};

Modified: stable/8/sys/kern/init_main.c
==============================================================================
--- stable/8/sys/kern/init_main.c       Wed Mar  6 09:12:38 2013        
(r247874)
+++ stable/8/sys/kern/init_main.c       Wed Mar  6 09:16:01 2013        
(r247875)
@@ -302,6 +302,7 @@ print_version(void *data __unused)
        while (len > 0 && version[len - 1] == '\n')
                len--;
        printf("%.*s %s\n", len, version, machine);
+       printf("%s\n", compiler_version);
 }
 
 SYSINIT(announce, SI_SUB_COPYRIGHT, SI_ORDER_FIRST, print_caddr_t,

Modified: stable/8/sys/kern/kern_mib.c
==============================================================================
--- stable/8/sys/kern/kern_mib.c        Wed Mar  6 09:12:38 2013        
(r247874)
+++ stable/8/sys/kern/kern_mib.c        Wed Mar  6 09:16:01 2013        
(r247875)
@@ -99,6 +99,9 @@ SYSCTL_INT(_kern, KERN_OSREV, osrevision
 SYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD|CTLFLAG_MPSAFE,
     version, 0, "Kernel version");
 
+SYSCTL_STRING(_kern, OID_AUTO, compiler_version, CTLFLAG_RD|CTLFLAG_MPSAFE,
+    compiler_version, 0, "Version of compiler used to compile kernel");
+
 SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD|CTLFLAG_MPSAFE,
     ostype, 0, "Operating system type");
 

Modified: stable/8/sys/sys/systm.h
==============================================================================
--- stable/8/sys/sys/systm.h    Wed Mar  6 09:12:38 2013        (r247874)
+++ stable/8/sys/sys/systm.h    Wed Mar  6 09:16:01 2013        (r247875)
@@ -49,6 +49,7 @@ extern int cold;              /* nonzero if we are d
 extern int rebooting;          /* boot() has been called. */
 extern const char *panicstr;   /* panic message */
 extern char version[];         /* system version */
+extern char compiler_version[];        /* compiler version */
 extern char copyright[];       /* system copyright */
 extern int kstack_pages;       /* number of kernel stack pages */
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to