svn commit: r359691 - head/sys/conf

Brooks Davis brooks at FreeBSD.org
Tue Apr 7 15:32:08 UTC 2020


Author: brooks
Date: Tue Apr  7 15:32:08 2020
New Revision: 359691
URL: https://svnweb.freebsd.org/changeset/base/359691

Log:
  Allow the kernel to build with a compiler that sets -fno-common.
  
  The mechanism that generates assym.inc and offset.inc depends on the
  symbols in question being common. For now, simply force the object files
  to be created with -fcommon.
  
  -fno-common will be the default in GCC10/LLVM11.
  
  Submitted by:	arichardson
  Reviewed by:	kevans
  Sponsored by:	DARPA
  Differential Revision:	https://reviews.freebsd.org/D24322

Modified:
  head/sys/conf/kern.post.mk

Modified: head/sys/conf/kern.post.mk
==============================================================================
--- head/sys/conf/kern.post.mk	Tue Apr  7 15:10:04 2020	(r359690)
+++ head/sys/conf/kern.post.mk	Tue Apr  7 15:32:08 2020	(r359691)
@@ -235,20 +235,20 @@ offset.inc: $S/kern/genoffset.sh genoffset.o
 	NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genoffset.sh genoffset.o > ${.TARGET}
 
 genoffset.o: $S/kern/genoffset.c
-	${CC} -c ${CFLAGS:N-flto:N-fno-common} $S/kern/genoffset.c
+	${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon $S/kern/genoffset.c
 
 # genoffset_test.o is not actually used for anything - the point of compiling it
 # is to exercise the CTASSERT that checks that the offsets in the offset.inc
 # _lite struct(s) match those in the original(s). 
 genoffset_test.o: $S/kern/genoffset.c offset.inc
-	${CC} -c ${CFLAGS:N-flto:N-fno-common} -DOFFSET_TEST \
+	${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon -DOFFSET_TEST \
 	    $S/kern/genoffset.c -o ${.TARGET}
 
 assym.inc: $S/kern/genassym.sh genassym.o genoffset_test.o
 	NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genassym.sh genassym.o > ${.TARGET}
 
 genassym.o: $S/$M/$M/genassym.c  offset.inc
-	${CC} -c ${CFLAGS:N-flto:N-fno-common} $S/$M/$M/genassym.c
+	${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon $S/$M/$M/genassym.c
 
 OBJS_DEPEND_GUESS+= opt_global.h
 genoffset.o genassym.o vers.o: opt_global.h


More information about the svn-src-all mailing list