Author: kevans
Date: Fri Apr 10 14:01:07 2020
New Revision: 359774
URL: https://svnweb.freebsd.org/changeset/base/359774

Log:
  userland build: replace -fno-common with ${CFCOMMONFLAG}
  
  This change allows any downstream or otherwise consumer to easily override
  the new -fno-common default on a temporary basis without having to hack into
  src.sys.mk, and also makes it a bit easier to search for these specific
  cases where -fno-common must be overridden with -fcommon or else the build
  will fail.
  
  The gdb build, the only program requiring -fcommon on head/, is switched
  over as an example usage. It will need it on all branches, so this does not
  harm future mergability.
  
  MFC after:    3 days

Modified:
  head/gnu/usr.bin/gdb/Makefile.inc
  head/share/mk/src.sys.mk

Modified: head/gnu/usr.bin/gdb/Makefile.inc
==============================================================================
--- head/gnu/usr.bin/gdb/Makefile.inc   Fri Apr 10 09:37:20 2020        
(r359773)
+++ head/gnu/usr.bin/gdb/Makefile.inc   Fri Apr 10 14:01:07 2020        
(r359774)
@@ -50,7 +50,7 @@ CFLAGS+= -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit
 # Some bits here currently rely on some of the linker-merging magic that 
happens
 # with -fcommon.  While this is the default right now, explicitly set -fcommon
 # so that it continues to build when the default flips.
-CFLAGS+= -fcommon
+CFCOMMONFLAG= -fcommon
 
 GENSRCS+= nm.h tm.h
 

Modified: head/share/mk/src.sys.mk
==============================================================================
--- head/share/mk/src.sys.mk    Fri Apr 10 09:37:20 2020        (r359773)
+++ head/share/mk/src.sys.mk    Fri Apr 10 14:01:07 2020        (r359774)
@@ -37,7 +37,8 @@ __postrcconf_${var}:= ${MK_${var}:U-}${WITHOUT_${var}:
 # The following should be removed no earlier than LLVM11 being imported into 
the
 # tree, to ensure we don't regress the build.  LLVM11 and GCC10 will switch the
 # default over to -fno-common, making this redundant.
-CFLAGS+=       -fno-common
+CFCOMMONFLAG?= -fno-common
+CFLAGS+=       ${CFCOMMONFLAG}
 
 # tempting, but bsd.compiler.mk causes problems this early
 # probably need to remove dependence on bsd.own.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