mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-13 17:39:57 +00:00
sip3: Fix segmentation fault
The first version of this patch introduced a problem with python3-pyqt5. Python emitted the following error message when one attempted to import PyQt5.Qt: ImportError: dynamic module does not define module export function (PyInit_Qt) This came about due to segfault in sip when executed in do_configure of python3-pyqt5. This resulted in a zero-length sipQtcmodule.c file being produced. This compiled successfully which meant no build failure was observed. The segfault was caused by a mistake in backporting the patch from SIP 6. The generateCompositeCpp() function uses the generate_include_sip_h() helper function in later versions which doesn't exist in SIP 4. We must replace the first parameter passed to isPY_SSIZE_T_CLEAN() from mod to pt->module to account for this. The change is not necessary for generateInternalAPIHeader() To simplify the patch we can remove the generated lexer and parser files and run flex and bison in do_configure instead. Signed-off-by: Rob Woolley <rob.woolley@windriver.com> Tested-by: Toby Flynn <campingandskiing@gmail.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
This commit is contained in:
committed by
Armin Kuster
parent
cfcc9f9945
commit
9fd5ae9132
+22
-17411
File diff suppressed because it is too large
Load Diff
@@ -15,7 +15,7 @@ inherit python3-dir python3native
|
||||
|
||||
S = "${WORKDIR}/sip-${PV}"
|
||||
|
||||
DEPENDS = "python3"
|
||||
DEPENDS = "python3 flex-native bison-native"
|
||||
|
||||
PACKAGES += "python3-sip3"
|
||||
|
||||
@@ -25,6 +25,11 @@ CONFIGURE_SYSROOT = "${STAGING_DIR_HOST}"
|
||||
CONFIGURE_SYSROOT:class-native = "${STAGING_DIR_NATIVE}"
|
||||
|
||||
do_configure:prepend() {
|
||||
# Re-generate the lexical analyzer and parser
|
||||
# Required for the py_ssize_t_clean patch
|
||||
flex --outfile=sipgen/lexer.c sipgen/metasrc/lexer.l
|
||||
bison --yacc -Wcounterexamples --defines=sipgen/parser.h --output=sipgen/parser.c sipgen/metasrc/parser.y
|
||||
|
||||
echo "py_platform = linux" > sip.cfg
|
||||
echo "py_inc_dir = ${STAGING_INCDIR}/python%(py_major).%(py_minor)${PYTHON_ABI}" >> sip.cfg
|
||||
echo "sip_bin_dir = ${D}/${bindir}" >> sip.cfg
|
||||
|
||||
Reference in New Issue
Block a user