Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 794592 - sci-electronics/pulseview-0.4.2 undefined reference to `_Py_Dealloc'
Summary: sci-electronics/pulseview-0.4.2 undefined reference to `_Py_Dealloc'
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords: PATCH
Depends on: 799614
Blocks:
  Show dependency tree
 
Reported: 2021-06-06 15:53 UTC by Esteve Varela Colominas
Modified: 2021-09-16 01:25 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (build.log.gz,7.25 KB, application/gzip)
2021-06-06 15:53 UTC, Esteve Varela Colominas
Details
libsigrokdecode build.log (build.log.gz,4.00 KB, application/gzip)
2021-06-06 16:12 UTC, Esteve Varela Colominas
Details
Fixed libsigrokdecode-0.5.3.ebuild (libsigrokdecode-0.5.3.ebuild,976 bytes, text/plain)
2021-06-06 19:12 UTC, Esteve Varela Colominas
Details
Git am-able patch with GCO signoff (0001-sci-libs-libsigrokdecode-Pick-the-right-python3-embe.patch,3.10 KB, patch)
2021-09-16 01:09 UTC, Esteve Varela Colominas
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Esteve Varela Colominas 2021-06-06 15:53:52 UTC
Created attachment 713979 [details]
build log

When building pulseview, I get a few linking errors:
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../lib64/libsigrokdecode.so: undefined reference to `_Py_Dealloc'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../lib64/libsigrokdecode.so: undefined reference to `PyLong_FromLong'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../lib64/libsigrokdecode.so: undefined reference to `PyModule_Create2'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../lib64/libsigrokdecode.so: undefined reference to `PyObject_SetAttrString'
...etc...

This started happening after the jun 1 python bump in ::gentoo. I had this package properly installed previously

$ emerge -pqv '=sci-electronics/pulseview-0.4.2::gentoo'
[ebuild   R   ] sci-electronics/pulseview-0.4.2  USE="decode -static" PYTHON_SINGLE_TARGET="python3_9 -python3_8"

$ emerge -pqv '=sci-libs/libsigrok-0.5.2-r1::gentoo'
[ebuild   R   ] sci-libs/libsigrok-0.5.2-r1  USE="cxx udev usb -ftdi -java -parport -python -ruby -serial -static-libs -test" PYTHON_TARGETS="python3_9 -python3_8" RUBY_TARGETS="ruby26 -ruby25"

$ emerge --info '=sci-electronics/pulseview-0.4.2::gentoo'
Portage 3.0.18 (python 3.9.2-final-0, default/linux/amd64/17.1/desktop, gcc-11.1.0, glibc-2.33, 5.10.33 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.10.33-x86_64-AMD_Ryzen_5_PRO_2500U_w-_Radeon_Vega_Mobile_Gfx-with-glibc2.33
KiB Mem:    23556828 total,  15052612 free
KiB Swap:    8388604 total,   8388604 free
Timestamp of repository gentoo: Tue, 01 Jun 2021 22:00:01 +0000
Head commit of repository gentoo: e130797d6bd27fc879e816f933568fe8db97709a
Timestamp of repository guru: Tue, 01 Jun 2021 09:50:49 +0000
Head commit of repository guru: 95cc3febe719055d3f7400c99b64be482fa3ff3d

Timestamp of repository lto-overlay: Tue, 01 Jun 2021 08:07:59 +0000
Head commit of repository lto-overlay: 99c9dcf3fd7b44aadbb83b3e95a2b7b30eba2af9

Timestamp of repository pf4public: Tue, 01 Jun 2021 08:08:11 +0000
Head commit of repository pf4public: 461b68900bf671035d0d6abd08db5d43cd60356e

Timestamp of repository src_prepare-overlay: Tue, 01 Jun 2021 19:05:24 +0000
Head commit of repository src_prepare-overlay: f61b371a4acace80f9135f5cf5c84fbc20ffc7c2

Head commit of repository tlp: ced908095a1bafc1af3583efc4a24b39e2ab8c12

sh dash 0.5.11.3-r1
ld GNU ld (Gentoo 2.35.2 p1) 2.35.2
ccache version 4.2.1 [disabled]
app-shells/bash:          5.1_p8::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.32.1::gentoo
dev-lang/python:          3.9.2-r1::lto-overlay
dev-lang/rust:            1.51.0-r2::gentoo
dev-util/ccache:          4.2.1::gentoo
dev-util/cmake:           3.18.5::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1-r1::gentoo
sys-apps/sandbox:         2.23::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.3-r1::gentoo
sys-devel/binutils:       2.35.2::gentoo
sys-devel/gcc:            11.1.0::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: yes

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo

localrepo
    location: /usr/local/portage
    masters: gentoo

lto-overlay
    location: /var/db/repos/lto-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/lto-overlay.git
    masters: gentoo mv

mv
    location: /var/db/repos/mv
    masters: gentoo

pf4public
    location: /var/db/repos/pf4public
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/pf4public.git
    masters: gentoo

src_prepare-overlay
    location: /var/db/repos/src_prepare-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/src_prepare-overlay.git
    masters: gentoo

tlp
    location: /var/db/repos/tlp
    sync-type: git
    sync-uri: https://github.com/dywisor/tlp-portage
    masters: gentoo

Installed sets: @group-externdeps, @group-fonts, @group-i3-desktop
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=znver1 -flto -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=4 -fuse-linker-plugin -pipe -w --param=lto-max-streaming-parallelism=4"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=znver1 -flto -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=4 -fuse-linker-plugin -pipe -w --param=lto-max-streaming-parallelism=4"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--ask --quiet-unmerge-warn --keep-going --usepkg --with-bdeps=y --binpkg-respect-use=y --binpkg-changed-deps=n"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-march=znver1 -flto -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=4 -fuse-linker-plugin -pipe -w --param=lto-max-streaming-parallelism=4"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=znver1 -flto -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=4 -fuse-linker-plugin -pipe -w --param=lto-max-streaming-parallelism=4"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
INSTALL_MASK="/etc/apparmor.d /etc/systemd /lib/systemd /usr/lib/systemd"
LANG="ca_ES.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4 -l5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
RUSTFLAGS="-Ctarget-cpu=znver1 -Copt-level=3"
USE="X acl acpi alsa amd64 berkdb bzip2 cairo cli crypt cups dbus dist-kernel dri elogind emboss encode exif flac fontconfig fontforge fortran gdbm gif gtk gui iconv icu ipv6 jpeg lcms libglvnd libnotify libtirpc lto metric mp4 multilib ncurses nls nptl ogg opengl openmp pam pango pcre pgo png policykit ppds qt5 readline seccomp split-usr ssl startup-notification svg tcpd truetype udev udisks unicode upower usb vim-syntax vorbis wxwidgets x264 xattr xcb xml xv zlib zsh-completion" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="synaptics evdev libinput keyboard mouse" KERNEL="linux" L10N="ca es-ES es en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="amdgpu" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

sci-electronics/pulseview-0.4.2::gentoo was built with the following:
USE="decode -static" ABI_X86="(64)" PYTHON_SINGLE_TARGET="python3_9 -python3_8"
CFLAGS="-march=znver1 -flto -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=4 -fuse-linker-plugin -pipe -w --param=lto-max-streaming-parallelism=4 -Wl,-O1 -Wl,--as-needed"
CXXFLAGS="-march=znver1 -flto -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=4 -fuse-linker-plugin -pipe -w --param=lto-max-streaming-parallelism=4 -Wl,-O1 -Wl,--as-needed"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -march=znver1 -flto -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=4 -fuse-linker-plugin -pipe -w --param=lto-max-streaming-parallelism=4"
Comment 1 Esteve Varela Colominas 2021-06-06 15:59:01 UTC
Forgot one relevant package:

$ emerge -pqv '=sci-libs/libsigrokdecode-0.5.3::gentoo'
[ebuild   R   ] sci-libs/libsigrokdecode-0.5.3  USE="-static-libs" PYTHON_SINGLE_TARGET="python3_9 -python3_8"
Comment 2 Esteve Varela Colominas 2021-06-06 16:12:35 UTC
Created attachment 713985 [details]
libsigrokdecode build.log

Enabling USE=python in libsigrok doesn't seem to solve it, removing all three packages and rebuilding them doesn't solve it, and disabling -flto in all three packages and rebuilding them doesn't solve it either.

Adding libsigrokdecode's build.log for completeness.
Comment 3 Esteve Varela Colominas 2021-06-06 18:05:37 UTC
I've tested building this in a clean (no LTO, -O2) Gentoo Prefix. As long as python3.8 is installed when libsigrokdecode is built, it works, even when python_targets_python3.8 is not set and python_targets_python3.9 is set. Uninstalling python3.8 causes this same error to pop up.

I don't think libsigrokdecode picks the python version properly. See the end of the configure output, where it falls through all the python tests.
Comment 4 Esteve Varela Colominas 2021-06-06 19:12:18 UTC
Created attachment 714042 [details]
Fixed libsigrokdecode-0.5.3.ebuild

I've figured it out. The problem exists in sci-libs/libsigrokdecode, and is twofold:
- The configure script picks the highest available version of python regardless of whatever version is picked by the python eclass
- python3.9 isn't supported by the configure script, so the nearest fallback is the python3 pkg-config module. Since python3.8, to pass the -lpython3 flag, you need to use the python3-embed module instead. Only python3.8-embed is detected by the configure script, but that doesn't exist.

Since the python eclass creates symlinks for the required pkg-config modules, and the configure script provides no method of forcing the used module, the easiest way to fix this is to make sure the "generic" module names are tried first, for example, in src_prepare():
	sed -i -e 's/\[SRD_PKGLIBS\],$/& [python3-embed], [python3],/' configure.ac
	eautoreconf
This should work for python3.8+ and python3.7-.

The python interpreter is picked up by the PYTHON3 environment variable, instead of just python, so setting PYTHON3="${PYTHON}" for the econf call is appropriate.

I've attached a fixed ebuild.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-19 02:51:10 UTC
(In reply to Esteve Varela Colominas from comment #4)
> Created attachment 714042 [details]
> Fixed libsigrokdecode-0.5.3.ebuild
> 
> I've figured it out. The problem exists in sci-libs/libsigrokdecode, and is
> twofold:
> - The configure script picks the highest available version of python
> regardless of whatever version is picked by the python eclass
> - python3.9 isn't supported by the configure script, so the nearest fallback
> is the python3 pkg-config module. Since python3.8, to pass the -lpython3
> flag, you need to use the python3-embed module instead. Only python3.8-embed
> is detected by the configure script, but that doesn't exist.
> 
> Since the python eclass creates symlinks for the required pkg-config
> modules, and the configure script provides no method of forcing the used
> module, the easiest way to fix this is to make sure the "generic" module
> names are tried first, for example, in src_prepare():
> 	sed -i -e 's/\[SRD_PKGLIBS\],$/& [python3-embed], [python3],/' configure.ac
> 	eautoreconf
> This should work for python3.8+ and python3.7-.
> 
> The python interpreter is picked up by the PYTHON3 environment variable,
> instead of just python, so setting PYTHON3="${PYTHON}" for the econf call is
> appropriate.
> 
> I've attached a fixed ebuild.

Would you mind attaching your GCO signoff (Signed-off-by: Real Name <email>) so I can commit this as-is?

(Even better would be a git am-able patch, but not required.)
Comment 6 Esteve Varela Colominas 2021-09-16 01:09:59 UTC
Created attachment 739464 [details, diff]
Git am-able patch with GCO signoff

Attaching patch as requested.
Comment 7 Larry the Git Cow gentoo-dev 2021-09-16 01:25:45 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e4731691bf7d76ad6530951e10fb3954e16c9d8

commit 7e4731691bf7d76ad6530951e10fb3954e16c9d8
Author:     Esteve Varela Colominas <esteve.varela@gmail.com>
AuthorDate: 2021-09-16 01:05:18 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-09-16 01:25:04 +0000

    sci-libs/libsigrokdecode: Pick the right python3-embed version
    
    Closes: https://bugs.gentoo.org/794592
    Closes: https://bugs.gentoo.org/799614
    Signed-off-by: Esteve Varela Colominas <esteve.varela@gmail.com>
    Signed-off-by: Sam James <sam@gentoo.org>

 ...-0.5.3.ebuild => libsigrokdecode-0.5.3-r1.ebuild} | 20 +++++++++-----------
 sci-libs/libsigrokdecode/libsigrokdecode-9999.ebuild | 18 ++++++++----------
 2 files changed, 17 insertions(+), 21 deletions(-)