From 45267d5181bb1819dbe6df285a2685d35584c318 Mon Sep 17 00:00:00 2001 From: Roman Stratiienko Date: Thu, 16 Jun 2022 13:32:56 +0300 Subject: [PATCH] Android.mk: Fix c11-related build failures When building with Android.mk we are ending-up with: gcc ..... -std=gnu99 .... -std=c11 .... target.o ^^^^^^^^^^ ^^^^^^^^ | | _______________^_____ _____^___________ AOSP/KATI GENERATED MESON GENERATED Some compilers uses first -std=gnu99 option and ignores second, which results: c99 implicit declaration of function static_assert() This patch filters-out the first '-std=gnu99' from the cflags obtained from AOSP/KATI dummy target output to avoid such kind of errors. Signed-off-by: Roman Stratiienko Reviewed-by: Jesse Natalie Reviewed-by: Mauro Rossi Acked-by: Erik Faye-Lund Part-of: --- android/mesa3d_cross.mk | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/android/mesa3d_cross.mk b/android/mesa3d_cross.mk index b3cc09496a099..92bb2b2810378 100644 --- a/android/mesa3d_cross.mk +++ b/android/mesa3d_cross.mk @@ -203,10 +203,8 @@ define m-c-flags endef define filter-c-flags - $(subst -std=gnu++17,, \ - $(subst -fno-rtti,, \ - $(patsubst -W%,, \ - $1))) + $(filter-out -std=gnu++17 -std=gnu99 -fno-rtti, \ + $(patsubst -W%,, $1)) endef define m-c-abs-includes