[issue35997] ImportError: dlopen failed: cannot locate symbol "PyBool_Type"

2019-12-10 Thread Xavier de Gaye


Change by Xavier de Gaye :


--
nosy:  -xdegaye

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35997] ImportError: dlopen failed: cannot locate symbol "PyBool_Type"

2019-02-15 Thread muhzi


muhzi  added the comment:

Ah! I used the option -Bsymbolic while linking the extension to make it work 
and it did, but I figure it is not ideal. I will be checking that patch!

--
components: +Extension Modules -Regular Expressions

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35997] ImportError: dlopen failed: cannot locate symbol "PyBool_Type"

2019-02-15 Thread Xavier de Gaye


Xavier de Gaye  added the comment:

It is not yet possible to cross-compile python extensions. The reason is that 
_init_posix() in  Lib/sysconfig.py still reads the sysconfigdata module of the 
native compiler instead of the sysconfigdata of the cross-built one. See the 
patch in issue #28833.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35997] ImportError: dlopen failed: cannot locate symbol "PyBool_Type"

2019-02-14 Thread muhzi


Change by muhzi :


Added file: https://bugs.python.org/file48140/xcompile-py3.sh

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35997] ImportError: dlopen failed: cannot locate symbol "PyBool_Type"

2019-02-14 Thread muhzi


Change by muhzi :


Removed file: https://bugs.python.org/file48139/xcompile-py3.sh

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35997] ImportError: dlopen failed: cannot locate symbol "PyBool_Type"

2019-02-14 Thread muhzi


muhzi  added the comment:

OK, I uploaded it. I give the path for NDK then it determines those values for 
the target architecture, in my case I use it for x86_64.

--
Added file: https://bugs.python.org/file48139/xcompile-py3.sh

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35997] ImportError: dlopen failed: cannot locate symbol "PyBool_Type"

2019-02-14 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Thank you, but I think there is missing info with your script.

Do you have a shell script to share? What are the values of:

ANDROID_TARGET
ANDROID_API
CC++
BIN_UTILS_PREFIX
etc...

For example, if I want to use a docker image on my Fedora, how can I compile 
Python for Android from my Fedora or Debian x86?

Thank you

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35997] ImportError: dlopen failed: cannot locate symbol "PyBool_Type"

2019-02-14 Thread muhzi


muhzi  added the comment:

Yes, the symbols are there.
And here is how I cross compiled Python:

export CC="${ANDROID_TARGET}${ANDROID_API}-clang"
export CXX="$CC++"

# environment variables for binary utils..
export AR="$BIN_UTILS_PREFIX-ar"
export LD="$BIN_UTILS_PREFIX-ld"
export AS="$BIN_UTILS_PREFIX-as"
export STRIP="$BIN_UTILS_PREFIX-strip"
export RANLIB="$BIN_UTILS_PREFIX-ranlib"
export READELF="$BIN_UTILS_PREFIX-readelf"

# compiler and linker flags
export CFLAGS="-fPIE -fPIC"
export LDFLAGS="-fuse-ld=lld -Wl,--rpath=../lib"

export CONFIG_SITE="config.site"

CONFIG_BUILD="$(uname -m)-linux-gnu"
CONFIG_ARGS="--enable-shared --disable-ipv6"
CONFIG_PREFIX="$PYTHON_PATH/output/$ARCH-android"

$PYTHON_PATH/configure --host=$ANDROID_TARGET --build=$CONFIG_BUILD 
--prefix=$CONFIG_PREFIX $CONFIG_ARGS
make -C $PYTHON_PATH
make -C $PYTHON_PATH install

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35997] ImportError: dlopen failed: cannot locate symbol "PyBool_Type"

2019-02-14 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

if you have compiled python with --enable-shared you will get a 
lib/libpython3.Xdm.so file and you can use nm -D lib/libpython3.Xdm.so | grep 
PyBool_Type

nm --debug-syms lib/libpython3.8dm.so | grep PyBool 
  00077696 T 
PyBool_FromLong
00328d20 D PyBool_Type

I think it's a problem with your compilation.

Could you explain how do you cross-compile for android?

Thank you

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35997] ImportError: dlopen failed: cannot locate symbol "PyBool_Type"

2019-02-14 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Can you see the symbols when you use nm or readelf?

--
nosy: +matrixise

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35997] ImportError: dlopen failed: cannot locate symbol "PyBool_Type"

2019-02-14 Thread muhzi


New submission from muhzi :

I cross compiled python for android x86_64, and the interpreter works fine, no 
problems. But when I compiled some other extension and try to import it. I get 
an import error as such the imported shared library fails to locate the symbol 
"PyBool_Type".

ImportError: dlopen failed: cannot locate symbol "PyBool_Type" referenced by 


The extension was compiled with -I && -L flags pointing to the Python 
installation include and lib folders.

--
components: Cross-Build, Regular Expressions
messages: 335560
nosy: Alex.Willmer, ezio.melotti, mrabarnett, muhzi, xdegaye
priority: normal
severity: normal
status: open
title: ImportError: dlopen failed: cannot locate symbol "PyBool_Type"
type: behavior
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com