Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 882333 - net-wireless/bluez-5.65: HID issues with Qualcomm Bluetooth if built with LTO
Summary: net-wireless/bluez-5.65: HID issues with Qualcomm Bluetooth if built with LTO
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Pacho Ramos
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2022-11-21 02:57 UTC by David Korth
Modified: 2023-07-08 10:01 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Korth 2022-11-21 02:57:33 UTC
I recently upgraded from a ThinkPad X230 (i7-3520M, Broadcom BCM20702A0 Bluetooth) to a ThinkPad T14 Gen 3 AMD (Ryzen 7 6850U, Qualcomm NFA725A WiFi + Bluetooth). I was able to pair my phone using Bluetooth and do file transfer and audio relay just fine. Attempting to pair any of three game controllers (Switch Pro, Wii remote, 8bitdo M30) resulted in an error.

Using bluetoothctl, the error message was:

[bluetooth]# pair EC:C4:0D:xx:xx:xx
Attempting to pair with EC:C4:0D:xx:xx:xx
[CHG] Device EC:C4:0D:xx:xx:xx Connected: yes
[CHG] Device EC:C4:0D:xx:xx:xx Bonded: yes
[Pro Controller]# trust EC:C4:0D:xx:xx:xx
[CHG] Device EC:C4:0D:xx:xx:xx Trusted: yes
Changing EC:C4:0D:xx:xx:xx trust succeeded
[CHG] Device EC:C4:0D:xx:xx:xx ServicesResolved: yes
[CHG] Device EC:C4:0D:xx:xx:xx Paired: yes
Pairing successful
[Pro Controller]# connect EC:C4:0D:xx:xx:xx
Attempting to connect to EC:C4:0D:xx:xx:xx
Failed to connect: org.bluez.Error.NotAvailable br-connection-profile-unavailable

Unavailable profile makes absolutely no sense, since these are all HID controllers. (with some quirks, but they still should work.) They all worked previously with the Broadcom card.

During testing, I set up VirtualBox with Windows 10 and used USB pass-through with the Bluetooth adapter to verify that it wasn't a hardware problem. Windows 10 accepted the 8bitdo M30 with no issues. Ubuntu 22.10 also accepted the 8bitdo M30 with no issues.

Finally, I disabled LTO and rebuilt bluez, and that ended up fixing it completely. All three controllers can now be paired and are recognized by programs that support gamepad input.

emerge --info:

Portage 3.0.39 (python 3.11.0-final-0, default/linux/amd64/17.1/hardened, gcc-12, glibc-2.36-r4, 6.0.9-DEK-T14G3A x86_64)
=================================================================
System uname: Linux-6.0.9-DEK-T14G3A-x86_64-AMD_Ryzen_7_PRO_6850U_with_Radeon_Graphics-with-glibc2.36
KiB Mem:    31596460 total,   5353264 free
KiB Swap:   25165816 total,  25164024 free
Timestamp of repository gentoo: Mon, 21 Nov 2022 02:00:01 +0000
Head commit of repository gentoo: 5c35fbe7792ab0d7e5b64dcf22bd2abc614f2445
sh dash 0.5.11.5
ld GNU ld (Gentoo 2.39 p4) 2.39.0
ccache version 4.7.3 [enabled]
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r2::gentoo
dev-java/java-config:      2.3.1::DEK-X230-local-portage-repository
dev-lang/perl:             5.34.1-r4::gentoo
dev-lang/python:           3.10.8_p3::gentoo, 3.11.0_p2::gentoo
dev-lang/rust-bin:         1.65.0::gentoo
dev-util/ccache:           4.7.3::gentoo
dev-util/cmake:            3.24.3::gentoo
dev-util/meson:            0.63.2-r1::gentoo
sys-apps/baselayout:       2.9::gentoo
sys-apps/openrc:           0.45.2-r1::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.13-r2::gentoo, 2.71-r1::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.39-r2::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/clang:           15.0.3::gentoo
sys-devel/gcc:             12.2.1_p20221008::gentoo
sys-devel/gcc-config:      2.8::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/lld:             15.0.3::gentoo
sys-devel/llvm:            15.0.3::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.36-r4::gentoo
Repositories:

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

kde
    location: /var/lib/layman/kde
    masters: gentoo
    priority: 50

qt
    location: /var/lib/layman/qt
    masters: gentoo
    priority: 50

steam-overlay
    location: /var/lib/layman/steam-overlay
    masters: gentoo
    priority: 50

stefantalpalaru
    location: /var/lib/layman/stefantalpalaru
    masters: gentoo
    priority: 50

x11
    location: /var/lib/layman/x11
    masters: gentoo
    priority: 50

DEK-X230-local-portage-repository
    location: /usr/local/portage
    masters: gentoo
    priority: 99

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
AR="gcc-ar"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-flto -fno-fat-lto-objects -O2 -pipe -march=native -mfpmath=sse -fcf-protection -fstack-protector-strong -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -ftree-vectorize"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.8/conf /usr/share/themes/oxygen-gtk/gtk-2.0"
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="-flto -fno-fat-lto-objects -O2 -pipe -march=native -mfpmath=sse -fcf-protection -fstack-protector-strong -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -ftree-vectorize"
DISTDIR="/var/cache/distfiles"
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 XDG_STATE_HOME"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live ccache cgroup compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
INSTALL_MASK="/usr/share/locale -/usr/share/locale/de* -/usr/share/locale/en* -/usr/share/locale/es* -/usr/share/locale/fr* -/usr/share/locale/he* -/usr/share/locale/ja* -/usr/share/locale/pt* -/usr/share/locale/ru* -/usr/share/locale/kf5_all_languages -/usr/share/locale/locale.alias /usr/share/man -/usr/share/man/man* -/usr/share/man/cat* -/usr/share/man/de* -/usr/share/man/en* -/usr/share/man/es* -/usr/share/man/fr* -/usr/share/man/he* -/usr/share/man/ja* -/usr/share/man/pt* -/usr/share/man/ru*"
LANG="en_US.utf8"
LDFLAGS="-flto -fno-fat-lto-objects -fuse-linker-plugin -Wl,-O2 -Wl,--sort-common -Wl,--hash-style=gnu -Wl,--as-needed -Wl,--build-id=sha1 -Wl,-z,pack-relative-relocs -O2 -pipe -march=native -mfpmath=sse -fcf-protection -fstack-protector-strong -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -ftree-vectorize"
MAKEOPTS="-j9"
NM="gcc-nm"
PKGDIR="/var/cache/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--progress"
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"
RANLIB="gcc-ranlib"
SHELL="/bin/bash"
USE="X a52 aac aacs acl acpi activities aio alsa amd64 apng aptx avif bash-completion bdplus blake2 bluetooth bluray branding brotli btrfs bzip2 cairo calendar caps cdda cdr cdrom cet cli color-management colord connection-sharing crypt cryptsetup cups cxx d3d9 dbus declarative device-mapper discover dri dri2 dri3 drm dts dvb dvd dvdr echo-cancel egl elogind emboss emoji encode evdev exif f2fs fat fax fbcon fdk ffmpeg filecaps firmware flac fortran freetype gbm gdbm gif git glamor gles2 gmp gold google googledrive gpg gpm gstreamer gui hardened harfbuzz hdri heif http2 ibus iconv icu imagemagick io-uring ipv6 jbig jit jpeg jpegxl jumbo-build kde kipi kwallet lcms ldac libass libdrm libevent libglvnd libinput libkms libnotify libplacebo libtirpc libv4l lm-sensors lm_sensors lto lvm lz4 lzma lzo mad magic minizip mktemp mng modemmanager mp3 mp4 mpeg mtp multilib ncurses networkmanager nftables nls nptl ntfs nvme ocr ofx ogg opencl opengl openmp opus orc osmesa pam pango pcre pcre16 pdf pgo phonon pie pim pipewire pkcs7 plasma png policykit postproc ppds pulseaudio qml qrcode qt3support qt5 quotes rar rav1e readline resolvconf s3tc samba scanner schroedinger screencast sdl seccomp semantic-desktop smp source-highlight spell split-usr ssh ssl ssp stack-realign startup-notification steamfonts svc svg system-icu test-rust theora threads thumbnail thumbnails thunderbolt tiff touchpad trayicon truetype udev udisks unicode upower usb usbredir v4l vaapi valgrind vdpau verify-sig vnc vorbis vpx vtv vulkan wayland webengine webp widgets wifi wmf wxwidgets x264 x265 xa xattr xcb xcomposite xinerama xml xpm xscreensaver xtpax xv xvid xxhash xz zeroconf zink zip zlib zstd zvbi" ABI_X86="64" ADA_TARGET="gnat_2021" ALSA_CARDS="hda-intel" 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="mmx mmxext sse sse2 sse3 ssse3 sse4_1 sse4_2 avx aes f16c popcnt fma3 avx2 pclmul sse4a sha" 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" GRUB_PLATFORMS="pc efi-64" INPUT_DEVICES="evdev libinput wacom" KERNEL="linux" L10N="de en en-GB en-US es es-419 fr he ja pt pt-BR pt-PT ru" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="X86 BPF WebAssembly AMDGPU" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" QEMU_SOFTMMU_TARGETS="x86_64 i386" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi radeon" 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:  ADDR2LINE, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 David Korth 2022-11-21 03:27:44 UTC
On further testing, it appears to be related to some Graphite optimizations if building with LTO. I have the following options enabled:

-floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block

If I remove these options, then the LTO build works perfectly fine. If I have all four options present, the LTO build fails. If I have *one* of these options, it works fine. (Tested with all four.)
Comment 2 Pacho Ramos gentoo-dev 2022-12-19 16:14:25 UTC
Are you still hitting this with 5.66? If still valid I would report it to upstream

Thanks
Comment 3 Pacho Ramos gentoo-dev 2023-07-08 10:01:36 UTC
please retry with 5.68