[2/3] android: anv: add dependency on libnativewindow for O and later

Submitted by Mauro Rossi on Feb. 4, 2018, 9:57 p.m.

Details

Message ID 20180204215711.8889-3-issor.oruam@gmail.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Mauro Rossi Feb. 4, 2018, 9:57 p.m.
Similar to 90dd6e5 ("Android: egl: add dependency on libnativewindow")

Fixes the following building errors:

In file included from external/mesa/src/intel/vulkan/gen7_cmd_buffer.c:30:
In file included from external/mesa/src/intel/vulkan/anv_private.h:72:
external/mesa/include/vulkan/vk_android_native_buffer.h:22:10: fatal error: 'system/window.h' file not found
         ^~~~~~~~~~~~~~~~~
1 error generated.
...
In file included from external/mesa/src/intel/vulkan/anv_gem.c:32:
In file included from external/mesa/src/intel/vulkan/anv_private.h:72:
external/mesa/include/vulkan/vk_android_native_buffer.h:22:10: fatal error: 'system/window.h' file not found
         ^~~~~~~~~~~~~~~~~
1 error generated.

Cc: "18.0" <mesa-stable@lists.freedesktop.org>
---
 src/intel/Android.vulkan.mk | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/intel/Android.vulkan.mk b/src/intel/Android.vulkan.mk
index 5c8c947136..3a6870097b 100644
--- a/src/intel/Android.vulkan.mk
+++ b/src/intel/Android.vulkan.mk
@@ -102,6 +102,10 @@  LOCAL_WHOLE_STATIC_LIBRARIES := libmesa_anv_entrypoints libmesa_genxml
 
 LOCAL_SHARED_LIBRARIES := libdrm
 
+ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5 6 7),)
+LOCAL_SHARED_LIBRARIES += libnativewindow
+endif
+
 include $(MESA_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
 
@@ -122,6 +126,10 @@  LOCAL_WHOLE_STATIC_LIBRARIES := libmesa_anv_entrypoints libmesa_genxml
 
 LOCAL_SHARED_LIBRARIES := libdrm
 
+ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5 6 7),)
+LOCAL_SHARED_LIBRARIES += libnativewindow
+endif
+
 include $(MESA_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
 
@@ -142,6 +150,10 @@  LOCAL_WHOLE_STATIC_LIBRARIES := libmesa_anv_entrypoints libmesa_genxml
 
 LOCAL_SHARED_LIBRARIES := libdrm
 
+ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5 6 7),)
+LOCAL_SHARED_LIBRARIES += libnativewindow
+endif
+
 include $(MESA_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
 
@@ -162,6 +174,10 @@  LOCAL_WHOLE_STATIC_LIBRARIES := libmesa_anv_entrypoints libmesa_genxml
 
 LOCAL_SHARED_LIBRARIES := libdrm
 
+ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5 6 7),)
+LOCAL_SHARED_LIBRARIES += libnativewindow
+endif
+
 include $(MESA_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
 
@@ -182,6 +198,10 @@  LOCAL_WHOLE_STATIC_LIBRARIES := libmesa_anv_entrypoints libmesa_genxml
 
 LOCAL_SHARED_LIBRARIES := libdrm
 
+ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5 6 7),)
+LOCAL_SHARED_LIBRARIES += libnativewindow
+endif
+
 include $(MESA_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
 
@@ -238,6 +258,10 @@  $(intermediates)/vulkan/anv_extensions.h:
 
 LOCAL_SHARED_LIBRARIES := libdrm
 
+ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5 6 7),)
+LOCAL_SHARED_LIBRARIES += libnativewindow
+endif
+
 include $(MESA_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
 
@@ -285,5 +309,9 @@  LOCAL_WHOLE_STATIC_LIBRARIES := \
 
 LOCAL_SHARED_LIBRARIES := libdrm libz libsync liblog
 
+ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5 6 7),)
+LOCAL_SHARED_LIBRARIES += libnativewindow
+endif
+
 include $(MESA_COMMON_MK)
 include $(BUILD_SHARED_LIBRARY)

Comments

Hi;

On 02/04/2018 11:57 PM, Mauro Rossi wrote:
> Similar to 90dd6e5 ("Android: egl: add dependency on libnativewindow")
> 
> Fixes the following building errors:
> 
> In file included from external/mesa/src/intel/vulkan/gen7_cmd_buffer.c:30:
> In file included from external/mesa/src/intel/vulkan/anv_private.h:72:
> external/mesa/include/vulkan/vk_android_native_buffer.h:22:10: fatal error: 'system/window.h' file not found
>           ^~~~~~~~~~~~~~~~~
> 1 error generated.
> ...
> In file included from external/mesa/src/intel/vulkan/anv_gem.c:32:
> In file included from external/mesa/src/intel/vulkan/anv_private.h:72:
> external/mesa/include/vulkan/vk_android_native_buffer.h:22:10: fatal error: 'system/window.h' file not found
>           ^~~~~~~~~~~~~~~~~
> 1 error generated.
> 
> Cc: "18.0" <mesa-stable@lists.freedesktop.org>
> ---
>   src/intel/Android.vulkan.mk | 28 ++++++++++++++++++++++++++++
>   1 file changed, 28 insertions(+)
> 
> diff --git a/src/intel/Android.vulkan.mk b/src/intel/Android.vulkan.mk
> index 5c8c947136..3a6870097b 100644
> --- a/src/intel/Android.vulkan.mk
> +++ b/src/intel/Android.vulkan.mk
> @@ -102,6 +102,10 @@ LOCAL_WHOLE_STATIC_LIBRARIES := libmesa_anv_entrypoints libmesa_genxml
>   
>   LOCAL_SHARED_LIBRARIES := libdrm
>   
> +ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5 6 7),)
> +LOCAL_SHARED_LIBRARIES += libnativewindow
> +endif
> +

How about introducing ANV_LIBRARIES (near to ANV_INCLUDES) and setting 
libdrm and libnativewindow there, then for each libanv just have the 
$(ANV_LIBRARIES)?

IMO this would make it cleaner to add new libs like we do here. In 
Android-IA we've just had the libnativewindow include path (since that 
is enough) but this is more cleaner way.


>   include $(MESA_COMMON_MK)
>   include $(BUILD_STATIC_LIBRARY)
>   
> @@ -122,6 +126,10 @@ LOCAL_WHOLE_STATIC_LIBRARIES := libmesa_anv_entrypoints libmesa_genxml
>   
>   LOCAL_SHARED_LIBRARIES := libdrm
>   
> +ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5 6 7),)
> +LOCAL_SHARED_LIBRARIES += libnativewindow
> +endif
> +
>   include $(MESA_COMMON_MK)
>   include $(BUILD_STATIC_LIBRARY)
>   
> @@ -142,6 +150,10 @@ LOCAL_WHOLE_STATIC_LIBRARIES := libmesa_anv_entrypoints libmesa_genxml
>   
>   LOCAL_SHARED_LIBRARIES := libdrm
>   
> +ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5 6 7),)
> +LOCAL_SHARED_LIBRARIES += libnativewindow
> +endif
> +
>   include $(MESA_COMMON_MK)
>   include $(BUILD_STATIC_LIBRARY)
>   
> @@ -162,6 +174,10 @@ LOCAL_WHOLE_STATIC_LIBRARIES := libmesa_anv_entrypoints libmesa_genxml
>   
>   LOCAL_SHARED_LIBRARIES := libdrm
>   
> +ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5 6 7),)
> +LOCAL_SHARED_LIBRARIES += libnativewindow
> +endif
> +
>   include $(MESA_COMMON_MK)
>   include $(BUILD_STATIC_LIBRARY)
>   
> @@ -182,6 +198,10 @@ LOCAL_WHOLE_STATIC_LIBRARIES := libmesa_anv_entrypoints libmesa_genxml
>   
>   LOCAL_SHARED_LIBRARIES := libdrm
>   
> +ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5 6 7),)
> +LOCAL_SHARED_LIBRARIES += libnativewindow
> +endif
> +
>   include $(MESA_COMMON_MK)
>   include $(BUILD_STATIC_LIBRARY)
>   
> @@ -238,6 +258,10 @@ $(intermediates)/vulkan/anv_extensions.h:
>   
>   LOCAL_SHARED_LIBRARIES := libdrm
>   
> +ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5 6 7),)
> +LOCAL_SHARED_LIBRARIES += libnativewindow
> +endif
> +
>   include $(MESA_COMMON_MK)
>   include $(BUILD_STATIC_LIBRARY)
>   
> @@ -285,5 +309,9 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \
>   
>   LOCAL_SHARED_LIBRARIES := libdrm libz libsync liblog
>   
> +ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5 6 7),)
> +LOCAL_SHARED_LIBRARIES += libnativewindow
> +endif
> +
>   include $(MESA_COMMON_MK)
>   include $(BUILD_SHARED_LIBRARY)
>
On 5 February 2018 at 08:09, Tapani Pälli <tapani.palli@intel.com> wrote:
> Hi;
>
>
> On 02/04/2018 11:57 PM, Mauro Rossi wrote:
>>
>> Similar to 90dd6e5 ("Android: egl: add dependency on libnativewindow")
>>
>> Fixes the following building errors:
>>
>> In file included from external/mesa/src/intel/vulkan/gen7_cmd_buffer.c:30:
>> In file included from external/mesa/src/intel/vulkan/anv_private.h:72:
>> external/mesa/include/vulkan/vk_android_native_buffer.h:22:10: fatal
>> error: 'system/window.h' file not found
>>           ^~~~~~~~~~~~~~~~~
>> 1 error generated.
>> ...
>> In file included from external/mesa/src/intel/vulkan/anv_gem.c:32:
>> In file included from external/mesa/src/intel/vulkan/anv_private.h:72:
>> external/mesa/include/vulkan/vk_android_native_buffer.h:22:10: fatal
>> error: 'system/window.h' file not found
>>           ^~~~~~~~~~~~~~~~~
>> 1 error generated.
>>
>> Cc: "18.0" <mesa-stable@lists.freedesktop.org>
>> ---
>>   src/intel/Android.vulkan.mk | 28 ++++++++++++++++++++++++++++
>>   1 file changed, 28 insertions(+)
>>
>> diff --git a/src/intel/Android.vulkan.mk b/src/intel/Android.vulkan.mk
>> index 5c8c947136..3a6870097b 100644
>> --- a/src/intel/Android.vulkan.mk
>> +++ b/src/intel/Android.vulkan.mk
>> @@ -102,6 +102,10 @@ LOCAL_WHOLE_STATIC_LIBRARIES :=
>> libmesa_anv_entrypoints libmesa_genxml
>>     LOCAL_SHARED_LIBRARIES := libdrm
>>   +ifeq ($(filter $(MESA_ANDROID_MAJOR_VERSION), 4 5 6 7),)
>> +LOCAL_SHARED_LIBRARIES += libnativewindow
>> +endif
>> +
>
>
> How about introducing ANV_LIBRARIES (near to ANV_INCLUDES) and setting
> libdrm and libnativewindow there, then for each libanv just have the
> $(ANV_LIBRARIES)?
>
> IMO this would make it cleaner to add new libs like we do here. In
> Android-IA we've just had the libnativewindow include path (since that is
> enough) but this is more cleaner way.
>
IIRC some (most?) versions of the Android build system do not
understand header-only dependencies.
Thus by using the shared/static library, we effectively ask to
overlink the final binary,

That aside (since we cannot do much about it), with Tapani's
suggestions the series is
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>

Mauro you have been providing good patches for a while. You can get
commit access to push them to the master branch.
Please check the instructions [1] and an example [2]. As a Tl;Dr;
 - create gpg and ssh keys
 - open a bug report + attach the public bits of ^^ [please add me to
the CC list]

Thanks
Emil

[1] https://www.freedesktop.org/wiki/AccountRequests/
[2] https://bugs.freedesktop.org/show_bug.cgi?id=103683