Hello

The patch is attached (if attachments are a problem in this list, I'll
send it in plain).

The only API functions I'm using are from this code:

https://github.com/pocl/pocl/blob/master/lib/CL/devices/topology/pocl_topology.c

I'm using it in Android 6 for ARM64, and I'm linking dynamically and
packing in an APK.

I suspect that, if you generate an executable and you run directly on
the Android shell, you won't have any premission issues. The problem
comes when you run it inside an APK, which is located in a restricted
sandbox. I have not tested that assumption.

Marc

>On Mon, 24 Oct 2016 17:51:04 +0200
>Brice Goglin <brice.gog...@inria.fr> wrote:
>
> Hello
> I am interested in seeing the patch, at least. If it isn't too
> intrusive, we could easily apply it.
> I am surprised to hear that openat fails on Android. I don't remember
> having to disable it last time I tried (on Android 4.0 or 4.1 iirc).
> But I was building natively (basically just cross-compiling for armv7
> and static linking), maybe you're doing something different that
> comes with different constraints?
> I'd like to have lstopo available in the play store too (I only had a
> textual version last time I tried :))
> Brice
> 
> 
> 
> Le 24/10/2016 17:42, Marc Marí a écrit :
> > I was porting a library to Android, and this library uses hwloc
> > v1.11 in the background. I managed to make it work.
> >
> > Are you interested in adding Android support for hwloc version 1.11?
> > Should I send a patch?
> >
> > The only change necessary is to disable "openat" (HAVE_OPENAT) when
> > compiling for Android. Android does have support for it, but, due to
> > the permission system, it cannot be used, so hwloc fails.
> >
> > Marc
> >
> > WARNING / LEGAL TEXT: This message is intended only for the use of
> > the individual or entity to which it is addressed and may contain
> > information which is privileged, confidential, proprietary, or
> > exempt from disclosure under applicable law. If you are not the
> > intended recipient or the person responsible for delivering the
> > message to the intended recipient, you are strictly prohibited from
> > disclosing, distributing, copying, or in any way using this
> > message. If you have received this communication in error, please
> > notify the sender and destroy and delete any copies you may have
> > received.
> >
> > http://www.bsc.es/disclaimer
> > _______________________________________________
> > hwloc-users mailing list
> > hwloc-users@lists.open-mpi.org
> > https://rfd.newmexicoconsortium.org/mailman/listinfo/hwloc-users  
> 
> _______________________________________________
> hwloc-users mailing list
> hwloc-users@lists.open-mpi.org
> https://rfd.newmexicoconsortium.org/mailman/listinfo/hwloc-users



WARNING / LEGAL TEXT: This message is intended only for the use of the
individual or entity to which it is addressed and may contain
information which is privileged, confidential, proprietary, or exempt
from disclosure under applicable law. If you are not the intended
recipient or the person responsible for delivering the message to the
intended recipient, you are strictly prohibited from disclosing,
distributing, copying, or in any way using this message. If you have
received this communication in error, please notify the sender and
destroy and delete any copies you may have received.

http://www.bsc.es/disclaimer

>From 82bc20f1a36e070e29f541533b092434bea85077 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Mar=C3=AD?= <marc.maribarc...@bsc.es>
Date: Tue, 25 Oct 2016 09:04:03 +0200
Subject: [PATCH] Add basic Android support

---
 config/hwloc.m4              | 3 ++-
 config/hwloc_check_vendor.m4 | 9 +++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/config/hwloc.m4 b/config/hwloc.m4
index 1bcec17..03569eb 100644
--- a/config/hwloc.m4
+++ b/config/hwloc.m4
@@ -665,7 +665,8 @@ EOF])
       AC_DEFINE([HWLOC_HAVE_CLZL], [1], [Define to 1 if you have the `clzl' function.])
     ])
 
-    AC_CHECK_FUNCS([openat], [hwloc_have_openat=yes])
+    AS_IF([test "$hwloc_c_vendor" != "android"], [AC_CHECK_FUNCS([openat], [hwloc_have_openat=yes])])
+
 
     AC_CHECK_HEADERS([malloc.h])
     AC_CHECK_FUNCS([getpagesize memalign posix_memalign])
diff --git a/config/hwloc_check_vendor.m4 b/config/hwloc_check_vendor.m4
index 0963bc1..0340f4c 100644
--- a/config/hwloc_check_vendor.m4
+++ b/config/hwloc_check_vendor.m4
@@ -86,8 +86,13 @@ AC_DEFUN([_HWLOC_CHECK_COMPILER_VENDOR], [
     hwloc_check_compiler_vendor_result="unknown"
 
     # GNU is probably the most common, so check that one as soon as
-    # possible.  Intel pretends to be GNU, so need to check Intel
-    # before checking for GNU.
+    # possible. Intel and Android pretend to be GNU, so need to
+    # check Intel and Android before checking for GNU.
+
+    # Android
+    AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"],
+          [HWLOC_IFDEF_IFELSE([__ANDROID__],
+               [hwloc_check_compiler_vendor_result="android"])])
 
     # Intel
     AS_IF([test "$hwloc_check_compiler_vendor_result" = "unknown"],
-- 
2.5.5

_______________________________________________
hwloc-users mailing list
hwloc-users@lists.open-mpi.org
https://rfd.newmexicoconsortium.org/mailman/listinfo/hwloc-users

Reply via email to