[Python-Dev] Undefined dlopen When Building Module On Android

Cyd Haselton chaselton at gmail.com
Wed Jan 21 23:43:19 CET 2015


On Mon, Jan 19, 2015 at 5:23 PM, Cyd Haselton <chaselton at gmail.com> wrote:
> On Mon, Jan 19, 2015 at 8:51 AM, Cyd Haselton <chaselton at gmail.com> wrote:
>> Hello,
>> I'm struggling with a build issue on Android; I've posted to the
>> general python list with no result, so I'm re-posting here in hopes
>> that someone can help.  If this is the wrong place feel free to let me
>> know.
>>
>> I'm attempting to build Python 2.7.8 on my Android device; I'm using
>> an environment that simulates a Linux filesystem within the Android
>> terminal using a port of fakechroot.  Within that environment I've
>> ported and/or bootstrapped a number of Linux utilities (curl, git,
>> openssl, gcc)
>>
>> I run ./configure, then make, and the executable and library are
>> built.  The problem occurs when build_ext is run; the newly built
>> python executable builds, then links _struct, and immediately
>> afterwards I get an 'undefined reference to dlopen' error.
>>
>> If I run ./python setup.py --verbose -library-dirs /path/to/lib
>> --libraries='c dl m' -f, the 'undefined reference to dlopen' error is
>> thrown again.
>>
>> If I run ./python setup.py --verbose -library-dirs /path/to/lib
>> --libraries='-lc -ldl -lm' -f the build continues past _struct...even
>> though ld throws the expected 'unable to find -l-lc' and other errors.
>>
>> Let me know if you need me to provide additional information.  Any
>> help would be greatly appreciated.
>>
>> Cyd
>
>
> Additionally I took a strace of the error producing command. The
> following is (hopefully) a relevant portion minus the various 'no such
> file' lines before the correct lib is found (which it always is)
>
> 16513 open("/data/data/jackpal.androidterm/kbox2/bld/python/Python-2.7.8/Lib/distutils/unixccompiler.py",
> O_RDONLY|O_LARGEFILE) = 3           16513
> open("/data/data/jackpal.androidterm/kbox2/bld/python/Python-2.7.8/Lib/distutils/unixccompiler.pyc",
> O_RDONLY|O_LARGEFILE) = 4       16513 vfork()
>  = 16525
> 16513 wait4(16525,  <unfinished ...>
> 16525 open("/data/data/jackpal.androidterm/kbox2/bin/sh",
> O_RDONLY|O_LARGEFILE) = 3
> 16525 execve("/data/data/jackpal.androidterm/kbox2/bin/sh", ["sh",
> "-c", "gcc --sysroot=/usr/gcc-4.9.2/sysroot -print-multiarch >
> build/temp.linux-armv7l-2.7/multiarch 2> /dev/null"], [/* 58 vars */])
> = 0
>
> *snip call to libc intercepted by libfakechroot*
>
> 16525 open("/system/lib/libc.so", O_RDONLY|O_LARGEFILE|0x80000) = 3
> 16525 open("/system/lib/libm.so", O_RDONLY|O_LARGEFILE|0x80000) = 3
> 16525 open("/dev/__properties__",
> O_RDONLY|O_LARGEFILE|O_NOFOLLOW|0x80000) = 3
> 16525 open("build/temp.linux-armv7l-2.7/multiarch",
> O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 3
> 16525 open("/data/data/jackpal.androidterm/kbox2/dev/null",
> O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 3
> 16525 fork()                            = 16526
> 16525 wait4(-1,  <unfinished ...>
> 16526 open("/acct/uid/10186/tasks", O_RDWR|O_CREAT|O_LARGEFILE, 0666)
> = -1 EACCES (Permission denied)
>
> See attached for remainder

Should I be posting this issue elsewhere?
Is more information needed?


More information about the Python-Dev mailing list