Author: emaste
Date: Tue Feb 21 18:59:17 2017
New Revision: 314054
URL: https://svnweb.freebsd.org/changeset/base/314054

Log:
  Exclude -flto when building *genassym.o
  
  The build process generates *assym.h using nm from *genassym.o (which is
  in turn created from *genassym.c).
  
  When compiling with link-time optimization (LTO) using -flto, .o files
  are LLVM bitcode, not ELF objects. This is not usable by genassym.sh,
  so remove -flto from those ${CC} invocations.
  
  Submitted by: George Rimar
  Reviewed by:  dim
  MFC after:    1 month
  Differential Revision:        https://reviews.freebsd.org/D9659

Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/conf/kern.post.mk
  head/sys/conf/kmod.mk
  head/sys/modules/linux/Makefile
  head/sys/modules/linux64/Makefile
  head/sys/modules/svr4/Makefile
  head/sys/modules/vmm/Makefile

Modified: head/sys/conf/files.amd64
==============================================================================
--- head/sys/conf/files.amd64   Tue Feb 21 18:56:06 2017        (r314053)
+++ head/sys/conf/files.amd64   Tue Feb 21 18:59:17 2017        (r314054)
@@ -34,7 +34,7 @@ cloudabi64_vdso_blob.o                optional        compat_
 #
 linux32_genassym.o             optional        compat_linux32          \
        dependency      "$S/amd64/linux32/linux32_genassym.c"           \
-       compile-with    "${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}"    \
+       compile-with    "${CC} ${CFLAGS:N-flto:N-fno-common} -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"                \
-       compile-with    "${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}"    \
+       compile-with    "${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \
        no-obj no-implicit-rule                                         \
        clean           "ia32_genassym.o"
 #

Modified: head/sys/conf/files.i386
==============================================================================
--- head/sys/conf/files.i386    Tue Feb 21 18:56:06 2017        (r314053)
+++ head/sys/conf/files.i386    Tue Feb 21 18:59:17 2017        (r314054)
@@ -21,7 +21,7 @@ cloudabi32_vdso_blob.o                optional        compat_
 #
 linux_genassym.o               optional        compat_linux            \
        dependency      "$S/i386/linux/linux_genassym.c"                \
-       compile-with    "${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}"    \
+       compile-with    "${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \
        no-obj no-implicit-rule                                         \
        clean           "linux_genassym.o"
 #
@@ -45,7 +45,7 @@ linux_vdso.so                 optional        compat_linux    
        \
 #
 svr4_genassym.o                        optional        compat_svr4             
\
        dependency      "$S/i386/svr4/svr4_genassym.c"                  \
-       compile-with    "${CC} ${CFLAGS:N-fno-common} -c ${.IMPSRC}"    \
+       compile-with    "${CC} ${CFLAGS:N-flto:N-fno-common} -c ${.IMPSRC}" \
        no-obj no-implicit-rule                                         \
        clean           "svr4_genassym.o"
 #

Modified: head/sys/conf/kern.post.mk
==============================================================================
--- head/sys/conf/kern.post.mk  Tue Feb 21 18:56:06 2017        (r314053)
+++ head/sys/conf/kern.post.mk  Tue Feb 21 18:59:17 2017        (r314054)
@@ -189,7 +189,7 @@ assym.s: $S/kern/genassym.sh genassym.o
        NM='${NM}' NMFLAGS='${NMFLAGS}' sh $S/kern/genassym.sh genassym.o > 
${.TARGET}
 
 genassym.o: $S/$M/$M/genassym.c
-       ${CC} -c ${CFLAGS:N-fno-common} $S/$M/$M/genassym.c
+       ${CC} -c ${CFLAGS:N-flto:N-fno-common} $S/$M/$M/genassym.c
 
 ${SYSTEM_OBJS} genassym.o vers.o: opt_global.h
 

Modified: head/sys/conf/kmod.mk
==============================================================================
--- head/sys/conf/kmod.mk       Tue Feb 21 18:56:06 2017        (r314053)
+++ head/sys/conf/kmod.mk       Tue Feb 21 18:59:17 2017        (r314054)
@@ -461,7 +461,7 @@ assym.s: ${SYSDIR}/kern/genassym.sh
        sh ${SYSDIR}/kern/genassym.sh genassym.o > ${.TARGET}
 genassym.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c
 genassym.o: ${SRCS:Mopt_*.h}
-       ${CC} -c ${CFLAGS:N-fno-common} \
+       ${CC} -c ${CFLAGS:N-flto:N-fno-common} \
            ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c
 .endif
 

Modified: head/sys/modules/linux/Makefile
==============================================================================
--- head/sys/modules/linux/Makefile     Tue Feb 21 18:56:06 2017        
(r314053)
+++ head/sys/modules/linux/Makefile     Tue Feb 21 18:59:17 2017        
(r314054)
@@ -71,7 +71,7 @@ ${VDSO}.so: linux${SFX}_locore.o
 .endif
 
 linux${SFX}_genassym.o:
-       ${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC}
+       ${CC} -c ${CFLAGS:N-flto:N-fno-common} ${.IMPSRC}
 
 .if !defined(KERNBUILDDIR)
 .if defined(KTR)

Modified: head/sys/modules/linux64/Makefile
==============================================================================
--- head/sys/modules/linux64/Makefile   Tue Feb 21 18:56:06 2017        
(r314053)
+++ head/sys/modules/linux64/Makefile   Tue Feb 21 18:59:17 2017        
(r314054)
@@ -44,7 +44,7 @@ linux_support.o: assym.s linux_assym.h
            ${.IMPSRC} -o ${.TARGET}
 
 linux_genassym.o:
-       ${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC}
+       ${CC} -c ${CFLAGS:N-flto:N-fno-common} ${.IMPSRC}
 
 .if !defined(KERNBUILDDIR)
 .if defined(DEBUG)

Modified: head/sys/modules/svr4/Makefile
==============================================================================
--- head/sys/modules/svr4/Makefile      Tue Feb 21 18:56:06 2017        
(r314053)
+++ head/sys/modules/svr4/Makefile      Tue Feb 21 18:59:17 2017        
(r314054)
@@ -22,7 +22,7 @@ svr4_locore.o: svr4_locore.s svr4_assym.
                ${.IMPSRC} -o ${.TARGET}
 
 svr4_genassym.o: svr4_genassym.c svr4.h
-       ${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC}
+       ${CC} -c ${CFLAGS:N-flto:N-fno-common} ${.IMPSRC}
 
 .if !defined(KERNBUILDDIR) && defined(DEBUG)
 opt_svr4.h:

Modified: head/sys/modules/vmm/Makefile
==============================================================================
--- head/sys/modules/vmm/Makefile       Tue Feb 21 18:56:06 2017        
(r314053)
+++ head/sys/modules/vmm/Makefile       Tue Feb 21 18:59:17 2017        
(r314054)
@@ -71,9 +71,9 @@ svm_support.o:
            ${.IMPSRC} -o ${.TARGET}
 
 vmx_genassym.o:
-       ${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC}
+       ${CC} -c ${CFLAGS:N-flto:N-fno-common} ${.IMPSRC}
 
 svm_genassym.o:
-       ${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC}
+       ${CC} -c ${CFLAGS:N-flto:N-fno-common} ${.IMPSRC}
 
 .include <bsd.kmod.mk>
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to