[Mesa-dev] [PATCH 2/3 v2] Android.common.mk: define HAVE_TIMESPEC_GET

John Stultz john.stultz at linaro.org
Thu Jul 26 18:28:45 UTC 2018

From: Sumit Semwal <sumit.semwal at linaro.org>

This is a forward port of a patch from the AOSP/master tree:

Since https://android-review.googlesource.com/c/718518 added
timespec_get() to bionic, mesa3d doesn't build due to redefinition
of timespec_get().

Avoid redefinition by defining HAVE_TIMESPEC_GET flag.

Test: build and boot tested db820c to UI.

Cc: Rob Herring <rob.herring at linaro.org>
Cc: Alistair Strachan <astrachan at google.com>
Cc: Marissa Wall <marissaw at google.com>
Cc: Sumit Semwal <sumit.semwal at linaro.org>
Cc: Emil Velikov <emil.l.velikov at gmail.com>
Cc: Rob Clark <robdclark at gmail.com>
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
Signed-off-by: Sumit Semwal <sumit.semwal at linaro.org>
Signed-off-by: John Stultz <john.stultz at linaro.org>
v2: Conditionalize it for PLATFORM_VERSION Q and higher
 Android.common.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Android.common.mk b/Android.common.mk
index 397dc03..3585470 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -89,6 +89,12 @@ LOCAL_CPPFLAGS += \
+# c11 timespec_get is part of bionic as well
+# https://android-review.googlesource.com/c/718518
+ifneq ($(shell [ "$(MESA_ANDROID_MAJOR_VERSION)" \< "Q" ]; echo $$?),0)
 ifeq ($(strip $(MESA_ENABLE_ASM)),true)
 ifeq ($(TARGET_ARCH),x86)

More information about the mesa-dev mailing list