Issue355

Title undefined symbol: PyFPE_jbuf
Priority feature Status chatting
Superseder Nosy List kayhayen, lefranco, thimo
Assigned To kayhayen Keywords

Created on 2017-02-21.14:38:51 by thimo, last changed by lefranco.

Messages
msg2301 (view) Author: lefranco Date: 2018-01-16.15:36:00
Just a quick remark : I think I am blocked by this bug.

I am developping a "real time" application (python 3.5) on ubuntu
(--with-fpectl) compiling it with nuitka and shiping the executable on a fedora
computer (not --with-fpectl).

=> And I get the "undefined symbol: PyFPE_jbuf" error.

I wish I could avoid the hassle to compile nuitka on my machine after adding the
two famous lines :
#pragma once
#include "pyfpe.h"

=> How about delivering the fix in the official sources so that I just have to
upload my nuitka ? Thanks ! ;-)

Kindly,
msg2138 (view) Author: thimo Date: 2017-03-30.09:14:37
Well, here is a solution to prevent the definition of all PyFPE macros by patching
the file prelude.hpp:

 // This is needed or else we can't create modules name "proc" or "func". For
 // Python3, the name collision can't happen, so we can limit it to Python2.
 #if PYTHON_VERSION < 300
 #define initproc python_initproc
 #define initfunc python_initfunc
 #define initstate system_initstate
 #endif
+
+// Set "#pragma once" and preload "pyfpe.h", so that WANT_SIGFPE_HANDLER
+// is undefined when "pyfpe.h" is loaded to prevent the definition of
+// FPE macros. These are not ABI compatible with Python builts that were
+// compiled without "--with-fpectl".
+// #undef WANT_SIGFPE_HANDLER
+#pragma once
+#include "pyfpe.h"

 // Include the Python C/API header files
 #include "Python.h"
 #include "methodobject.h"
 #include "frameobject.h"
 #include "pydebug.h"
 #include "marshal.h"
msg2128 (view) Author: thimo Date: 2017-02-21.14:38:50
Hello Kay,

There is an issue with module extensions that were compiled against Python (built with 
the flag --with-fpectl) and then used under Python versions built without --with-fpectl. 
This results in the error "undefined symbol: PyFPE_jbuf", since these Python builds are 
not ABI compatible.

But module extensions compiled without --with-fpectl are ABI compatible with both Python 
builds. See:

https://www.python.org/dev/peps/pep-0513/#fpectl-builds-vs-no-fpectl-builds
https://github.com/numpy/numpy/issues/8415#issuecomment-269103493

So, is there a way for Nuitka to prevent using all that PyFPE stuff and not defining such 
symbols, even if used with a --with-fpectl enabled Python version?
History
Date User Action Args
2018-01-16 15:36:01lefrancosetnosy: + lefranco
messages: + msg2301
2017-03-30 09:14:38thimosetstatus: unread -> chatting
assignedto: kayhayen
messages: + msg2138
nosy: + kayhayen
2017-02-21 14:38:51thimocreate