Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiling the python binding with python3 fails #17

Open
xambroz opened this issue Mar 23, 2018 · 1 comment
Open

compiling the python binding with python3 fails #17

xambroz opened this issue Mar 23, 2018 · 1 comment

Comments

@xambroz
Copy link

xambroz commented Mar 23, 2018

Hello,
compiling the python binding for python3 fails.

========== To reproduce =============

git clone https://github.com/DinoTools/libemu
cd libemu
./configure --enable-python-bindings
make
cd bindings/python/
python3 setup.py build

========== Actual result ===============

~/rpmbuild/BUILD/libemu-ab48695b7113db692982a1839e3d6eb9e73e90a9
+ pushd bindings/python3
~/rpmbuild/BUILD/libemu-ab48695b7113db692982a1839e3d6eb9e73e90a9/bindings/python3 ~/rpmbuild/BUILD/libemu-ab48695b7113db692982a1839e3d6eb9e73e90a9
+ CFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables'
+ /usr/bin/python3 setup.py build '--executable=/usr/bin/python3 -s'
running build
running build_ext
building 'libemu' extension
creating build
creating build/temp.linux-x86_64-3.6
gcc -pthread -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fPIC -I../../include -I/usr/include/python3.6m -c libemu_module.c -o build/temp.linux-x86_64-3.6/libemu_module.o
libemu_module.c: In function ‘libemu_Emulator_dealloc’:
libemu_module.c:74:8: error: ‘libemu_EmulatorObject {aka struct <anonymous>}’ has no member named ‘ob_type’; did you mean ‘ob_base’?
  self->ob_type->tp_free((PyObject*) self);
        ^~~~~~~
        ob_base
libemu_module.c: At top level:
libemu_module.c:106:1: warning: missing braces around initializer [-Wmissing-braces]
 {
 ^
libemu_module.c:109:5: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
     "libemu.Emulator",             /*tp_name*/
     ^~~~~~~~~~~~~~~~~
libemu_module.c:109:5: note: (near initialization for ‘libemu_EmulatorType.tp_basicsize’)
libemu_module.c:112:5: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
     (destructor) libemu_Emulator_dealloc, /*tp_dealloc*/
     ^
libemu_module.c:112:5: note: (near initialization for ‘libemu_EmulatorType.tp_print’)
In file included from /usr/include/python3.6m/pytime.h:6:0,
                 from /usr/include/python3.6m/Python.h:65,
                 from libemu_module.c:29:
/usr/include/python3.6m/object.h:658:29: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
 #define Py_TPFLAGS_DEFAULT  ( \
                             ^
libemu_module.c:127:5: note: in expansion of macro ‘Py_TPFLAGS_DEFAULT’
     Py_TPFLAGS_DEFAULT, /*tp_flags*/
     ^~~~~~~~~~~~~~~~~~
/usr/include/python3.6m/object.h:658:29: note: (near initialization for ‘libemu_EmulatorType.tp_doc’)
 #define Py_TPFLAGS_DEFAULT  ( \
                             ^
libemu_module.c:127:5: note: in expansion of macro ‘Py_TPFLAGS_DEFAULT’
     Py_TPFLAGS_DEFAULT, /*tp_flags*/
     ^~~~~~~~~~~~~~~~~~
libemu_module.c:128:5: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
     "libemu x86 emulator wrapper object",           /* tp_doc */
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libemu_module.c:128:5: note: (near initialization for ‘libemu_EmulatorType.tp_traverse’)
libemu_module.c:135:5: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
     libemu_EmulatorMethods,             /* tp_methods */
     ^~~~~~~~~~~~~~~~~~~~~~
libemu_module.c:135:5: note: (near initialization for ‘libemu_EmulatorType.tp_members’)
libemu_module.c:145:5: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
     libemu_Emulator_new,                 /* tp_new */
     ^~~~~~~~~~~~~~~~~~~
libemu_module.c:145:5: note: (near initialization for ‘libemu_EmulatorType.tp_free’)
libemu_module.c:106:1: warning: missing braces around initializer [-Wmissing-braces]
 {
 ^
libemu_module.c: In function ‘initlibemu’:
libemu_module.c:157:3: warning: ‘return’ with no value, in function returning non-void
   return;
   ^~~~~~
libemu_module.c:152:16: note: declared here
 PyMODINIT_FUNC initlibemu()
                ^~~~~~~~~~
libemu_module.c:159:11: warning: implicit declaration of function ‘Py_InitModule3’; did you mean ‘Py_Initialize’? [-Wimplicit-function-declaration]
  module = Py_InitModule3("libemu", LibemuMethods,
           ^~~~~~~~~~~~~~
           Py_Initialize
libemu_module.c:159:9: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  module = Py_InitModule3("libemu", LibemuMethods,
         ^
error: command 'gcc' failed with exit status 1
@BH1SCW
Copy link

BH1SCW commented Aug 14, 2024

is there any solution yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants