Author: kevans
Date: Thu Apr 30 14:51:31 2020
New Revision: 360496
URL: https://svnweb.freebsd.org/changeset/base/360496

Log:
  MFC r360071-r360072: force -fcommon in kernel/modules where needed
  
  This contains some extra bits over the original commits, as things are
  slightly different in earlier branches.
  
  r360071:
  Allow kernel modules to build with a compiler that defaults to -fno-common
  
  This uses the same approach as r359691.
  
  r360072:
  More fixes to build the kernel with a compiler that defaults to -fno-common
  
  Using the same approach as the last commit for the files used by genassym.sh.

Modified:
  stable/12/sys/conf/files.amd64
  stable/12/sys/conf/files.i386
  stable/12/sys/conf/kern.post.mk
  stable/12/sys/conf/kmod.mk
  stable/12/sys/modules/linux/Makefile
  stable/12/sys/modules/linux64/Makefile
  stable/12/sys/modules/vmm/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/conf/files.amd64
==============================================================================
--- stable/12/sys/conf/files.amd64      Thu Apr 30 14:38:55 2020        
(r360495)
+++ stable/12/sys/conf/files.amd64      Thu Apr 30 14:51:31 2020        
(r360496)
@@ -34,7 +34,7 @@ cloudabi64_vdso_blob.o                optional        
compat_cloudabi64       \
 #
 linux32_genassym.o             optional        compat_linux32          \
        dependency      "$S/amd64/linux32/linux32_genassym.c offset.inc"        
        \
-       compile-with    "${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \
+       compile-with    "${CC} ${CFLAGS:N-flto:N-fno-common} -fcommon -c 
${.IMPSRC}" \
        no-obj no-implicit-rule                                         \
        clean           "linux32_genassym.o"
 #
@@ -58,7 +58,7 @@ linux32_vdso.so               optional        compat_linux32  
                \
 #
 ia32_genassym.o                        standard                                
\
        dependency      "$S/compat/ia32/ia32_genassym.c offset.inc"             
\
-       compile-with    "${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \
+       compile-with    "${CC} ${CFLAGS:N-flto:N-fno-common} -fcommon -c 
${.IMPSRC}" \
        no-obj no-implicit-rule                                         \
        clean           "ia32_genassym.o"
 #

Modified: stable/12/sys/conf/files.i386
==============================================================================
--- stable/12/sys/conf/files.i386       Thu Apr 30 14:38:55 2020        
(r360495)
+++ stable/12/sys/conf/files.i386       Thu Apr 30 14:51:31 2020        
(r360496)
@@ -21,7 +21,7 @@ cloudabi32_vdso_blob.o                optional        
compat_cloudabi32       \
 #
 linux_genassym.o               optional        compat_linux            \
        dependency      "$S/i386/linux/linux_genassym.c offset.inc"             
\
-       compile-with    "${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \
+       compile-with    "${CC} ${CFLAGS:N-flto:N-fno-common} -fcommon -c 
${.IMPSRC}" \
        no-obj no-implicit-rule                                         \
        clean           "linux_genassym.o"
 #

Modified: stable/12/sys/conf/kern.post.mk
==============================================================================
--- stable/12/sys/conf/kern.post.mk     Thu Apr 30 14:38:55 2020        
(r360495)
+++ stable/12/sys/conf/kern.post.mk     Thu Apr 30 14:51:31 2020        
(r360496)
@@ -202,20 +202,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

Modified: stable/12/sys/conf/kmod.mk
==============================================================================
--- stable/12/sys/conf/kmod.mk  Thu Apr 30 14:38:55 2020        (r360495)
+++ stable/12/sys/conf/kmod.mk  Thu Apr 30 14:51:31 2020        (r360496)
@@ -515,13 +515,13 @@ assym.inc: ${SYSDIR}/kern/genassym.sh
        sh ${SYSDIR}/kern/genassym.sh genassym.o > ${.TARGET}
 genassym.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c offset.inc
 genassym.o: ${SRCS:Mopt_*.h}
-       ${CC} -c ${CFLAGS:N-flto:N-fno-common} \
+       ${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon \
            ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c
 offset.inc: ${SYSDIR}/kern/genoffset.sh genoffset.o
        sh ${SYSDIR}/kern/genoffset.sh genoffset.o > ${.TARGET}
 genoffset.o: ${SYSDIR}/kern/genoffset.c
 genoffset.o: ${SRCS:Mopt_*.h}
-       ${CC} -c ${CFLAGS:N-flto:N-fno-common} \
+       ${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon \
            ${SYSDIR}/kern/genoffset.c
 
 CLEANDEPENDFILES+=     ${_ILINKS}

Modified: stable/12/sys/modules/linux/Makefile
==============================================================================
--- stable/12/sys/modules/linux/Makefile        Thu Apr 30 14:38:55 2020        
(r360495)
+++ stable/12/sys/modules/linux/Makefile        Thu Apr 30 14:51:31 2020        
(r360496)
@@ -78,7 +78,7 @@ ${VDSO}.so: linux${SFX}_locore.o
 .endif
 
 linux${SFX}_genassym.o: offset.inc
-       ${CC} -c ${CFLAGS:N-flto:N-fno-common} ${.IMPSRC}
+       ${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC}
 
 .if !defined(KERNBUILDDIR)
 .if defined(KTR)

Modified: stable/12/sys/modules/linux64/Makefile
==============================================================================
--- stable/12/sys/modules/linux64/Makefile      Thu Apr 30 14:38:55 2020        
(r360495)
+++ stable/12/sys/modules/linux64/Makefile      Thu Apr 30 14:51:31 2020        
(r360496)
@@ -53,7 +53,7 @@ linux_support.o: assym.inc linux_assym.h
            ${.IMPSRC} -o ${.TARGET}
 
 linux_genassym.o: offset.inc
-       ${CC} -c ${CFLAGS:N-flto:N-fno-common} ${.IMPSRC}
+       ${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC}
 
 .if !defined(KERNBUILDDIR)
 .if defined(DEBUG)

Modified: stable/12/sys/modules/vmm/Makefile
==============================================================================
--- stable/12/sys/modules/vmm/Makefile  Thu Apr 30 14:38:55 2020        
(r360495)
+++ stable/12/sys/modules/vmm/Makefile  Thu Apr 30 14:51:31 2020        
(r360496)
@@ -75,9 +75,9 @@ svm_support.o:
            ${.IMPSRC} -o ${.TARGET}
 
 vmx_genassym.o: offset.inc
-       ${CC} -c ${CFLAGS:N-flto:N-fno-common} ${.IMPSRC}
+       ${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC}
 
 svm_genassym.o: offset.inc
-       ${CC} -c ${CFLAGS:N-flto:N-fno-common} ${.IMPSRC}
+       ${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC}
 
 .include <bsd.kmod.mk>
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to