Add LDFLAGS_WARNINGS_ARE_ERRORS. ihse-cflags-rewrite-branch
authorihse
Thu, 01 Mar 2018 14:31:04 +0100
branchihse-cflags-rewrite-branch
changeset 56217 e550367df595
parent 56216 d8ea550b907a
child 56219 852414e4ae77
Add LDFLAGS_WARNINGS_ARE_ERRORS.
make/autoconf/flags-cflags.m4
make/autoconf/spec.gmk.in
make/common/NativeCompilation.gmk
--- a/make/autoconf/flags-cflags.m4	Thu Mar 01 11:22:31 2018 +0100
+++ b/make/autoconf/flags-cflags.m4	Thu Mar 01 14:31:04 2018 +0100
@@ -179,6 +179,7 @@
 
   AC_SUBST(WARNINGS_AS_ERRORS)
 
+  LDFLAGS_WARNINGS_ARE_ERRORS=""
   case "${TOOLCHAIN_TYPE}" in
     microsoft)
       DISABLE_WARNING_PREFIX="-wd"
@@ -187,6 +188,7 @@
     solstudio)
       DISABLE_WARNING_PREFIX="-erroff="
       CFLAGS_WARNINGS_ARE_ERRORS="-errtags -errwarn=%all"
+      LDFLAGS_WARNINGS_ARE_ERRORS="-Wl,-z,fatal-warnings"
       ;;
     gcc)
       # Prior to gcc 4.4, a -Wno-X where X is unknown for that version of gcc will cause an error
@@ -234,6 +236,7 @@
   AC_SUBST(DISABLE_WARNING_PREFIX)
   AC_SUBST(BUILD_CC_DISABLE_WARNING_PREFIX)
   AC_SUBST(CFLAGS_WARNINGS_ARE_ERRORS)
+  AC_SUBST(LDFLAGS_WARNINGS_ARE_ERRORS)
 ])
 
 AC_DEFUN([FLAGS_SETUP_QUALITY_CHECKS],
--- a/make/autoconf/spec.gmk.in	Thu Mar 01 11:22:31 2018 +0100
+++ b/make/autoconf/spec.gmk.in	Thu Mar 01 14:31:04 2018 +0100
@@ -418,6 +418,7 @@
 
 DISABLE_WARNING_PREFIX := @DISABLE_WARNING_PREFIX@
 CFLAGS_WARNINGS_ARE_ERRORS:=@CFLAGS_WARNINGS_ARE_ERRORS@
+LDFLAGS_WARNINGS_ARE_ERRORS:=@LDFLAGS_WARNINGS_ARE_ERRORS@
 
 # A global flag (true or false) determining if native warnings are considered errors.
 WARNINGS_AS_ERRORS := @WARNINGS_AS_ERRORS@
--- a/make/common/NativeCompilation.gmk	Thu Mar 01 11:22:31 2018 +0100
+++ b/make/common/NativeCompilation.gmk	Thu Mar 01 14:31:04 2018 +0100
@@ -599,6 +599,7 @@
   ifeq ($$($1_WARNINGS_AS_ERRORS_$(TOOLCHAIN_TYPE)), true)
     $1_EXTRA_CFLAGS += $(CFLAGS_WARNINGS_ARE_ERRORS)
     $1_EXTRA_CXXFLAGS += $(CFLAGS_WARNINGS_ARE_ERRORS)
+    $1_EXTRA_LDFLAGS += $(LDFLAGS_WARNINGS_ARE_ERRORS)
   endif
 
   ifeq (NONE, $$($1_OPTIMIZATION))