Build apitrace failed for Android X86_64

José Fonseca jose.r.fonseca at gmail.com
Fri Mar 24 13:54:37 UTC 2017


I don't have much need / experience  of building with Android, so I'm
afraid I can't help.

But it just came to my attention that newer NDKs have better(? or at least
more direct) support for using CMake:

   https://developer.android.com/ndk/guides/cmake.html

Either way, once you manage to get apitrace building for Android again, if
you send me a patch/PR with updated docs/INSTALL.markdown instructions it
would be great.

Jose


On Thu, Mar 23, 2017 at 5:40 AM, Tapani Pälli <tapani.palli at intel.com>
wrote:

>
>
> On 03/22/2017 05:43 AM, Wang, Gary C wrote:
>
>> Hi Tapani,
>>
>> Could you please help to share your khrplatform.h with me for my testing?
>> I used v17 or v12.0.1 MESA's khrplatform.h but still suffered it.
>>
>
> OK, I'll send you at complete patch offline and then let's see if we could
> fix current Android.mk in a shape that would work for everyone.
>
>
> Thanks!
>>
>> Gary
>>
>> -----Original Message-----
>> From: Palli, Tapani
>> Sent: Tuesday, March 21, 2017 8:40 PM
>> To: Wang, Gary C <gary.c.wang at intel.com>; apitrace <
>> apitrace at lists.freedesktop.org>
>> Subject: Re: Build apitrace failed for Android X86_64
>>
>> Hi;
>>
>> On 03/21/2017 12:22 PM, Wang, Gary C wrote:
>>
>>> Dear Tapani,
>>>
>>> I appreciate you guiding!
>>>
>>> I use NDK 14.0.3770861 with following android.toolchain.cmake, curl -s
>>> -O
>>> https://raw.githubusercontent.com/taka-no-me/android-cmake/556cc14296c
>>> 226f753a3778d99d8b60778b7df4f/android.toolchain.cmake
>>>
>>> For Android.mk modified according to your guiding, but I have no idea
>>> still saw error 'error: '__NDK_FPABI__' does not name a type',
>>>
>>
>> Ah ok now I hit the same failure but have a workaround for it. I replaced
>> khrplatform.h header to be the one from Mesa sources (which is older), then
>> apitrace compiles fine, I haven't tried running/using it on the device yet
>> though.
>>
>>
>> diff --git a/Android.mk b/Android.mk
>>> index ccc1859b6081..1e6cde9b8fe4 100644
>>> --- a/Android.mk
>>> +++ b/Android.mk
>>> @@ -17,13 +17,7 @@ $(shell echo "CMake present but NDK not found at
>>> $(abspath $(NDK)), will not com  else # NDK  $(shell echo "CMake and
>>> NDK ($(abspath $(NDK))) found, will compile apitrace" >&2)
>>>
>>> -ifeq ($(TARGET_ARCH),arm)
>>> -TOOLCHAIN := arm-linux-androideabi-4.4.x -endif
>>> -
>>> -ifeq ($(TARGET_ARCH),x86)
>>> -TOOLCHAIN := i686-android-linux-4.4.3 -endif
>>> +TOOLCHAIN := x86_64-4.9
>>>
>>>  LOCAL_PATH := $(call my-dir)
>>>
>>> @@ -67,8 +61,8 @@ apitrace_private_target: android.toolchain.cmake
>>>                 cd $(MY_APITRACE_ROOT) && \
>>>                 cmake \
>>>                 -DCMAKE_TOOLCHAIN_FILE=android.toolchain.cmake \
>>> -               -DANDROID_NDK=../../$(NDK) \
>>> -               -DANDROID_NDK_LAYOUT=LINARO \
>>> +               -DANDROID_NDK=/home/garywang/work/android-ndk-linux \
>>> +               -DANDROID_NDK_LAYOUT=RELEASE \
>>>                 -DANDROID_TOOLCHAIN_NAME=$(TOOLCHAIN) \
>>>                 -DANDROID_API_LEVEL=21 \
>>>                 -DANDROID_NO_UNDEFINED=OFF \
>>>
>>>
>>> cmake -H. -Bbuild -DCMAKE_TOOLCHAIN_FILE=$PWD/android.toolchain.cmake
>>> -DANDROID_NDK=/home/garywang/work/android-ndk-linux
>>> -DANDROID_STL=gnustl_shared -DANDROID_SDK=/home/garywang/work/android-sdk-linux
>>> -DANDROID_API_LEVEL=21 -DANDROID_ABI=x86_64 -DENABLE_STATIC_SNAPPY=true
>>> --debug-output
>>>
>>> Any missing thing I need to check again? Thanks!
>>>
>>> Gary
>>>
>>> -----Original Message-----
>>> From: Palli, Tapani
>>> Sent: Thursday, March 16, 2017 8:10 PM
>>> To: Wang, Gary C <gary.c.wang at intel.com>; apitrace <
>>> apitrace at lists.freedesktop.org>
>>> Subject: Re: Build apitrace failed for Android X86_64
>>>
>>>
>>>
>>> On 03/16/2017 12:48 PM, Rob Clark wrote:
>>>
>>>> +apitrace list.. I've never really built apitrace on android, but
>>>> +others have
>>>>
>>>> On Wed, Mar 15, 2017 at 11:21 PM, Wang, Gary C <gary.c.wang at intel.com>
>>>> wrote:
>>>>
>>>>> Hi Rob,
>>>>>
>>>>>
>>>>>
>>>>> I use the latest Android-NDK to build apitrace, but suffered error.
>>>>> Would you mind to give some advice on it? Thanks!
>>>>>
>>>>>
>>> I've tried this briefly with fresh NDK but did not get as far as you
>>> have. Things I had to do was:
>>>
>>> - modify Android.mk to use ANDROID_NDK_HOME instead of hardcoded NDK
>>> path (ANDROID_NDK_HOME points to $HOME/Android/Sdk/ndk-bundle)
>>> - get android.toolchain.cmake manually instead of curling in the script
>>> - modify Android.mk to use 'x86_64-4.9' TOOLCHAIN
>>>
>>> but even then build fails:
>>>
>>> "Could not find any working toolchain in the NDK. Probably your Android
>>> NDK is broken."
>>>
>>> Do you have some modifications for Android.mk?
>>>
>>> Thanks;
>>>
>>>
>>>
>>>>>
>>>>>>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/EGL/egl.h:288:1:
>>>>> note: in expansion of macro 'EGLAPI'
>>>>>
>>>>> EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync (EGLDisplay dpy, EGLSync
>>>>> sync);
>>>>>
>>>>> ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/KHR/
>>>>> khrplatform.h:106:67:
>>>>> error: '__NDK_FPABI__' does not name a type
>>>>>
>>>>> #   define KHRONOS_APICALL __attribute__((visibility("default")))
>>>>> __NDK_FPABI__
>>>>>
>>>>>                                                                    ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/EGL/
>>>>> eglplatform.h:50:16:
>>>>> note: in expansion of macro 'KHRONOS_APICALL'
>>>>>
>>>>> #define EGLAPI KHRONOS_APICALL
>>>>>
>>>>>                 ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/EGL/egl.h:289:1:
>>>>> note: in expansion of macro 'EGLAPI'
>>>>>
>>>>> EGLAPI EGLint EGLAPIENTRY eglClientWaitSync (EGLDisplay dpy, EGLSync
>>>>> sync, EGLint flags, EGLTime timeout);
>>>>>
>>>>> ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/KHR/
>>>>> khrplatform.h:106:67:
>>>>> error: '__NDK_FPABI__' does not name a type
>>>>>
>>>>> #   define KHRONOS_APICALL __attribute__((visibility("default")))
>>>>> __NDK_FPABI__
>>>>>
>>>>>                                                                    ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/EGL/
>>>>> eglplatform.h:50:16:
>>>>> note: in expansion of macro 'KHRONOS_APICALL'
>>>>>
>>>>> #define EGLAPI KHRONOS_APICALL
>>>>>
>>>>>                 ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/EGL/egl.h:290:1:
>>>>> note: in expansion of macro 'EGLAPI'
>>>>>
>>>>> EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttrib (EGLDisplay dpy,
>>>>> EGLSync sync, EGLint attribute, EGLAttrib *value);
>>>>>
>>>>> ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/KHR/
>>>>> khrplatform.h:106:67:
>>>>> error: '__NDK_FPABI__' does not name a type
>>>>>
>>>>> #   define KHRONOS_APICALL __attribute__((visibility("default")))
>>>>> __NDK_FPABI__
>>>>>
>>>>>                                                                    ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/EGL/
>>>>> eglplatform.h:50:16:
>>>>> note: in expansion of macro 'KHRONOS_APICALL'
>>>>>
>>>>> #define EGLAPI KHRONOS_APICALL
>>>>>
>>>>>                 ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/EGL/egl.h:291:1:
>>>>> note: in expansion of macro 'EGLAPI'
>>>>>
>>>>> EGLAPI EGLImage EGLAPIENTRY eglCreateImage (EGLDisplay dpy,
>>>>> EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const
>>>>> EGLAttrib *attrib_list);
>>>>>
>>>>> ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/KHR/
>>>>> khrplatform.h:106:67:
>>>>> error: '__NDK_FPABI__' does not name a type
>>>>>
>>>>> #   define KHRONOS_APICALL __attribute__((visibility("default")))
>>>>> __NDK_FPABI__
>>>>>
>>>>>                                                                    ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/EGL/
>>>>> eglplatform.h:50:16:
>>>>> note: in expansion of macro 'KHRONOS_APICALL'
>>>>>
>>>>> #define EGLAPI KHRONOS_APICALL
>>>>>
>>>>>                 ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/EGL/egl.h:292:1:
>>>>> note: in expansion of macro 'EGLAPI'
>>>>>
>>>>> EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImage (EGLDisplay dpy,
>>>>> EGLImage image);
>>>>>
>>>>> ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/KHR/
>>>>> khrplatform.h:106:67:
>>>>> error: '__NDK_FPABI__' does not name a type
>>>>>
>>>>> #   define KHRONOS_APICALL __attribute__((visibility("default")))
>>>>> __NDK_FPABI__
>>>>>
>>>>>                                                                    ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/EGL/
>>>>> eglplatform.h:50:16:
>>>>> note: in expansion of macro 'KHRONOS_APICALL'
>>>>>
>>>>> #define EGLAPI KHRONOS_APICALL
>>>>>
>>>>>                 ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/EGL/egl.h:293:1:
>>>>> note: in expansion of macro 'EGLAPI'
>>>>>
>>>>> EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay (EGLenum
>>>>> platform, void *native_display, const EGLAttrib *attrib_list);
>>>>>
>>>>> ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/KHR/
>>>>> khrplatform.h:106:67:
>>>>> error: '__NDK_FPABI__' does not name a type
>>>>>
>>>>> #   define KHRONOS_APICALL __attribute__((visibility("default")))
>>>>> __NDK_FPABI__
>>>>>
>>>>>                                                                    ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/EGL/
>>>>> eglplatform.h:50:16:
>>>>> note: in expansion of macro 'KHRONOS_APICALL'
>>>>>
>>>>> #define EGLAPI KHRONOS_APICALL
>>>>>
>>>>>                 ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/EGL/egl.h:294:1:
>>>>> note: in expansion of macro 'EGLAPI'
>>>>>
>>>>> EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface
>>>>> (EGLDisplay dpy, EGLConfig config, void *native_window, const
>>>>> EGLAttrib *attrib_list);
>>>>>
>>>>> ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/KHR/
>>>>> khrplatform.h:106:67:
>>>>> error: '__NDK_FPABI__' does not name a type
>>>>>
>>>>> #   define KHRONOS_APICALL __attribute__((visibility("default")))
>>>>> __NDK_FPABI__
>>>>>
>>>>>                                                                    ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/EGL/
>>>>> eglplatform.h:50:16:
>>>>> note: in expansion of macro 'KHRONOS_APICALL'
>>>>>
>>>>> #define EGLAPI KHRONOS_APICALL
>>>>>
>>>>>                 ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/EGL/egl.h:295:1:
>>>>> note: in expansion of macro 'EGLAPI'
>>>>>
>>>>> EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface
>>>>> (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const
>>>>> EGLAttrib *attrib_list);
>>>>>
>>>>> ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/KHR/
>>>>> khrplatform.h:106:67:
>>>>> error: '__NDK_FPABI__' does not name a type
>>>>>
>>>>> #   define KHRONOS_APICALL __attribute__((visibility("default")))
>>>>> __NDK_FPABI__
>>>>>
>>>>>                                                                    ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/EGL/
>>>>> eglplatform.h:50:16:
>>>>> note: in expansion of macro 'KHRONOS_APICALL'
>>>>>
>>>>> #define EGLAPI KHRONOS_APICALL
>>>>>
>>>>>                 ^
>>>>>
>>>>> /home/garywang/3t_work/apitrace/thirdparty/khronos/EGL/egl.h:296:1:
>>>>> note: in expansion of macro 'EGLAPI'
>>>>>
>>>>> EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync (EGLDisplay dpy, EGLSync
>>>>> sync, EGLint flags);
>>>>>
>>>>> ^
>>>>>
>>>>> make[2]: *** [dispatch/CMakeFiles/glproc.dir/glproc.cpp.o] Error 1
>>>>>
>>>>> make[2]: Leaving directory `/media/garywang/MyHD3T/mywork
>>>>> /apitrace/build'
>>>>>
>>>>> make[1]: *** [dispatch/CMakeFiles/glproc.dir/all] Error 2
>>>>>
>>>>> make[1]: Leaving directory `/media/garywang/MyHD3T/mywork
>>>>> /apitrace/build'
>>>>>
>>>>> make: *** [all] Error 2
>>>>>
>>>>> make: Leaving directory `/media/garywang/MyHD3T/mywork/apitrace/build'
>>>>>
>>>>>>>>>>
>>>>>
>>>>>
>>>>> Gary
>>>>>
>>>> _______________________________________________
>>>> apitrace mailing list
>>>> apitrace at lists.freedesktop.org
>>>> https://lists.freedesktop.org/mailman/listinfo/apitrace
>>>>
>>>> _______________________________________________
> apitrace mailing list
> apitrace at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/apitrace
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/apitrace/attachments/20170324/cb84b587/attachment-0001.html>


More information about the apitrace mailing list