Bug 11104 - boost libboost_python3.so.1.62.1 links incorrectly against Python 2 C API
Summary: boost libboost_python3.so.1.62.1 links incorrectly against Python 2 C API
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.3 M4
Assignee: Ross Burton
QA Contact:
URL:
Whiteboard:
: 11152 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-02-24 09:46 UTC by Ismo Puustinen
Modified: 2017-03-30 13:00 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ismo Puustinen 2017-02-24 09:46:41 UTC
Using libboost_python3 from any project fails with an "undefined reference" linking problem, because libboost_python3.so.1.62.0 appears to be built incorrectly against Python 2 includes and uses symbols which are not present in Python 3 C library.

libboost_python.so (Python 2) uses PyClass_Type, which is fine:

nm -D tmp-glibc/work/corei7-64-refkit-linux/boost/1.62.0-r1/sysroot-destdir/usr/lib/libboost_python.so.1.62.0 | grep PyClass_Type
                 U PyClass_Type

However, libboost_python3.so also uses the same symbol, which is not fine:

nm -D tmp-glibc/work/corei7-64-refkit-linux/boost/1.62.0-r1/sysroot-destdir/usr/lib/libboost_python3.so.1.62.0 | grep PyClass_Type
                 U PyClass_Type

Looking at the Python C libraries we can see that the symbol is prsent only in Python 2:

nm -D tmp-glibc/work/corei7-64-refkit-linux/boost/1.62.0-r1/recipe-sysroot/usr/lib/libpython3.5m.so | grep PyClass_Type
nm -D tmp-glibc/work/corei7-64-refkit-linux/boost/1.62.0-r1/recipe-sysroot/usr/lib/libpython2.7.so | grep PyClass_Type
000000000038e420 D PyClass_Type

There's some discussion about the issue here:

http://stackoverflow.com/questions/25188861/libboost-python3-so-1-56-0-undefined-symbol-pyclass-type
Comment 1 Ross Burton 2017-03-24 16:08:26 UTC
I'm sending a patch to port boost from py2 to py3, so if Python is enabled in boost it only builds against Py3.
Comment 2 Ross Burton 2017-03-24 16:15:46 UTC
*** Bug 11152 has been marked as a duplicate of this bug. ***
Comment 3 Ross Burton 2017-03-30 13:00:23 UTC
Fixed in oe-core 0f5418eb0ce12811b16d2e3c28c28140a509f685.