Makefile: Check -Wno-stringop-truncation is supported

Message ID 20180530071610.24915-1-joel@jms.id.au
State New
Headers show
Series
  • Makefile: Check -Wno-stringop-truncation is supported
Related show

Commit Message

Joel Stanley May 30, 2018, 7:16 a.m.
The cross compiler on my system throws a fit as it does not understand
this option:

 cc1: error: unrecognized command line option '-Wno-stringop-truncation' [-Werror]

Fixes: 918b7233d3bb ("Add -Wno-stringop-truncation for GCC8")
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 Makefile.main | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/Makefile.main b/Makefile.main
index a155e1e66601..8d50f0e05d5a 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -31,7 +31,7 @@  CWARNS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
 	  -Wwrite-strings -Wcast-align \
 	  -Winit-self \
 	  -Wframe-larger-than=1024 \
-	  -Wno-stringop-truncation \
+	  $(call try-cflag,$(CC),--Wno-stringop-truncation) \
 	  -Werror
 
 # Host tools and options