Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 759277 - media-libs/sbc-1.5: undefined reference to `__builtin_cpu_init'
Summary: media-libs/sbc-1.5: undefined reference to `__builtin_cpu_init'
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Sound Team
URL: https://git.kernel.org/pub/scm/blueto...
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2020-12-09 19:57 UTC by crabbed halo ablution
Modified: 2021-01-21 22:30 UTC (History)
0 users

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


Attachments
Build Log (media-libs:sbc-1.5:20201210-152115.log,18.85 KB, text/x-log)
2020-12-11 17:47 UTC, Roy Bamford
Details

Note You need to log in before you can comment on or make changes to this bug.
Description crabbed halo ablution 2020-12-09 19:57:40 UTC
/var/tmp/portage/media-libs/sbc-1.5/work/sbc-1.5/sbc/sbc_primitives.c: In function ‘sbc_init_primitives_x86’:
/var/tmp/portage/media-libs/sbc-1.5/work/sbc-1.5/sbc/sbc_primitives.c:596:2: warning: implicit declaration of function ‘__builtin_cpu_init’; did you mean ‘__builtin_irint’? [-Wimplicit-function-declaration]
  596 |  __builtin_cpu_init();
      |  ^~~~~~~~~~~~~~~~~~
      |  __builtin_irint
/bin/sh ./libtool  --tag=CC   --mode=link aarch64-unknown-linux-gnu-gcc -fvisibility=hidden -finline-functions -fgcse-after-reload -funswitch-loops -funroll-loops -march=armv8-a+crc -mtune=cortex-a72 -O2 -pipe  -Wl,-O1 -Wl,--as-needed -o src/sbcinfo src/sbcinfo.o  
libtool: link: aarch64-unknown-linux-gnu-gcc -fvisibility=hidden -finline-functions -fgcse-after-reload -funswitch-loops -funroll-loops -march=armv8-a+crc -mtune=cortex-a72 -O2 -pipe -Wl,-O1 -Wl,--as-needed -o src/sbcinfo src/sbcinfo.o 
/bin/sh ./libtool  --tag=CC   --mode=link aarch64-unknown-linux-gnu-gcc -fvisibility=hidden -finline-functions -fgcse-after-reload -funswitch-loops -funroll-loops -march=armv8-a+crc -mtune=cortex-a72 -O2 -pipe  -Wl,-O1 -Wl,--as-needed -o sbc/libsbc-private.la   sbc/sbc.lo sbc/sbc_primitives.lo sbc/sbc_primitives_sse.lo sbc/sbc_primitives_mmx.lo sbc/sbc_primitives_iwmmxt.lo sbc/sbc_primitives_neon.lo sbc/sbc_primitives_armv6.lo  
/bin/sh ./libtool  --tag=CC   --mode=link aarch64-unknown-linux-gnu-gcc -fvisibility=hidden -finline-functions -fgcse-after-reload -funswitch-loops -funroll-loops -march=armv8-a+crc -mtune=cortex-a72 -O2 -pipe -no-undefined -version-info 4:0:3 -Wl,--version-script=/var/tmp/portage/media-libs/sbc-1.5/work/sbc-1.5/sbc/sbc.sym -Wl,-O1 -Wl,--as-needed -o sbc/libsbc.la -rpath /usr/lib64  sbc/sbc.lo sbc/sbc_primitives.lo sbc/sbc_primitives_sse.lo sbc/sbc_primitives_mmx.lo sbc/sbc_primitives_iwmmxt.lo sbc/sbc_primitives_neon.lo sbc/sbc_primitives_armv6.lo  
libtool: link: aarch64-unknown-linux-gnu-gcc -shared  -fPIC -DPIC  sbc/.libs/sbc.o sbc/.libs/sbc_primitives.o sbc/.libs/sbc_primitives_sse.o sbc/.libs/sbc_primitives_mmx.o sbc/.libs/sbc_primitives_iwmmxt.o sbc/.libs/sbc_primitives_neon.o sbc/.libs/sbc_primitives_armv6.o    -march=armv8-a+crc -mtune=cortex-a72 -O2 -Wl,--version-script=/var/tmp/portage/media-libs/sbc-1.5/work/sbc-1.5/sbc/sbc.sym -Wl,-O1 -Wl,--as-needed   -Wl,-soname -Wl,libsbc.so.1 -o sbc/.libs/libsbc.so.1.3.0
libtool: link: aarch64-unknown-linux-gnu-ar cr sbc/.libs/libsbc-private.a sbc/.libs/sbc.o sbc/.libs/sbc_primitives.o sbc/.libs/sbc_primitives_sse.o sbc/.libs/sbc_primitives_mmx.o sbc/.libs/sbc_primitives_iwmmxt.o sbc/.libs/sbc_primitives_neon.o sbc/.libs/sbc_primitives_armv6.o 
libtool: link: aarch64-unknown-linux-gnu-ranlib sbc/.libs/libsbc-private.a
libtool: link: ( cd "sbc/.libs" && rm -f "libsbc-private.la" && ln -s "../libsbc-private.la" "libsbc-private.la" )
libtool: link: (cd "sbc/.libs" && rm -f "libsbc.so.1" && ln -s "libsbc.so.1.3.0" "libsbc.so.1")
/bin/sh ./libtool  --tag=CC   --mode=link aarch64-unknown-linux-gnu-gcc -fvisibility=hidden -finline-functions -fgcse-after-reload -funswitch-loops -funroll-loops -march=armv8-a+crc -mtune=cortex-a72 -O2 -pipe  -Wl,-O1 -Wl,--as-needed -o src/sbcdec src/sbcdec.o sbc/libsbc-private.la 
/bin/sh ./libtool  --tag=CC   --mode=link aarch64-unknown-linux-gnu-gcc -fvisibility=hidden -finline-functions -fgcse-after-reload -funswitch-loops -funroll-loops -march=armv8-a+crc -mtune=cortex-a72 -O2 -pipe  -Wl,-O1 -Wl,--as-needed -o src/sbcenc src/sbcenc.o sbc/libsbc-private.la 
libtool: link: (cd "sbc/.libs" && rm -f "libsbc.so" && ln -s "libsbc.so.1.3.0" "libsbc.so")
libtool: link: ( cd "sbc/.libs" && rm -f "libsbc.la" && ln -s "../libsbc.la" "libsbc.la" )
libtool: link: aarch64-unknown-linux-gnu-gcc -fvisibility=hidden -finline-functions -fgcse-after-reload -funswitch-loops -funroll-loops -march=armv8-a+crc -mtune=cortex-a72 -O2 -pipe -Wl,-O1 -Wl,--as-needed -o src/sbcdec src/sbcdec.o  sbc/.libs/libsbc-private.a
libtool: link: aarch64-unknown-linux-gnu-gcc -fvisibility=hidden -finline-functions -fgcse-after-reload -funswitch-loops -funroll-loops -march=armv8-a+crc -mtune=cortex-a72 -O2 -pipe -Wl,-O1 -Wl,--as-needed -o src/sbcenc src/sbcenc.o  sbc/.libs/libsbc-private.a
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.2.0/../../../../aarch64-unknown-linux-gnu/bin/ld: sbc/.libs/libsbc-private.a(sbc_primitives.o): in function `sbc_init_primitives':
sbc_primitives.c:(.text+0x24c0): undefined reference to `__builtin_cpu_init'
collect2: error: ld returned 1 exit status
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.2.0/../../../../aarch64-unknown-linux-gnu/bin/ld: sbc/.libs/libsbc-private.a(sbc_primitives.o): in function `sbc_init_primitives':
sbc_primitives.c:(.text+0x24c0): undefined reference to `__builtin_cpu_init'
make[1]: *** [Makefile:647: src/sbcdec] Error 1
collect2: error: ld returned 1 exit status
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:653: src/sbcenc] Error 1
make: *** [Makefile:453: all] Error 2
Comment 1 crabbed halo ablution 2020-12-09 20:01:27 UTC
In https://git.kernel.org/pub/scm/bluetooth/sbc.git/commit/sbc/sbc_primitives.c?id=9181e1ba64d98334b914109d431a6d474f86cb31
sbc_init_primitives_x86 is added.
In https://git.kernel.org/pub/scm/bluetooth/sbc.git/commit/sbc/sbc_primitives.c?id=76f4d931d237517c443dd793390ed7d73b12746e
an unsuccesful attempt is made to guard the code.
Clearly all of sbc_init_primitives_x86, as well as the call to it needs to be IFDEF'ed out for non-x86 archs.
Comment 2 Roy Bamford gentoo-dev 2020-12-11 17:46:43 UTC
Pi4 Root moriarty / # emerge --info
Portage 3.0.12 (python 3.8.6-final-0, default/linux/arm64/17.0/desktop, gcc-10.2.0, glibc-2.32-r5, 5.9.0-gentoo aarch64)
=================================================================
System uname: Linux-5.9.0-gentoo-aarch64-with-glibc2.17
KiB Mem:   131640760 total,  90140156 free
KiB Swap:    4194300 total,   4194300 free
Timestamp of repository gentoo: Thu, 10 Dec 2020 12:30:01 +0000
Head commit of repository gentoo: 4e34dcaebf06409d6873d12504011279cc70aa77
Head commit of repository genpi: 6067c9b4ce6c4641fdba8f9acd8882a5e94eafec

sh bash 5.0_p18
ld GNU gold (Gentoo 2.35.1 p2 2.35.1) 1.16
distcc 3.3.3 aarch64-unknown-linux-gnu [disabled]
app-shells/bash:          5.0_p18::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3-r1::gentoo
dev-lang/python:          2.7.18-r4::gentoo, 3.7.9::genpi, 3.8.6::gentoo, 3.9.0::gentoo
dev-util/cmake:           3.19.1::gentoo
sys-apps/baselayout:      2.7-r1::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.20::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.1-r1::gentoo
sys-devel/gcc:            10.2.0-r3::gentoo
sys-devel/gcc-config:     2.3.2-r1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.9::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r5::gentoo
Repositories:

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

genpi
    location: /var/db/repos/genpi
    sync-type: git
    sync-uri: https://github.com/NeddySeagoon/genpi64-overlay
    masters: gentoo

ACCEPT_KEYWORDS="arm64 ~arm64"
ACCEPT_LICENSE="@FREE all-rights-reserved bh-luxi bluez-firmware fairuse FraunhoferFDK freedist IUPAC-InChi kaptan linux-firmware linux-fw-redistributable MPEG-4 MSttfEULA no-source-code SSPL-1 xgraph"
CBUILD="aarch64-unknown-linux-gnu"
CFLAGS="-mcpu=cortex-a72+crc -mtune=cortex-a72 -ftree-vectorize -O2 -pipe -fomit-frame-pointer -flto=6"
CHOST="aarch64-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /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 /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-mcpu=cortex-a72+crc -mtune=cortex-a72 -ftree-vectorize -O2 -pipe -fomit-frame-pointer -flto=6"
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"
FCFLAGS="-mcpu=cortex-a72+crc -mtune=cortex-a72 -ftree-vectorize -O2 -pipe -fomit-frame-pointer -flto=6"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg collision-protect 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="-mcpu=cortex-a72+crc -mtune=cortex-a72 -ftree-vectorize -O2 -pipe -fomit-frame-pointer -flto=6"
GENTOO_MIRRORS="http://mirror.mdfnet.se/gentoo                  http://mirrors.163.com/gentoo/                  http://gentoo.mirror.web4u.cz/                  http://64.50.236.52/                  http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/                  http://gentoo.mneisen.org/                  http://gentoo.prz.rzeszow.pl                  http://mirror.mdfnet.se/mirror/gentoo                  http://ftp.gentoo.bg/                  http://distfiles.gentoo.bg/                  http://mirrors.ludost.net/gentoo/                  http://mirror.hamakor.org.il/pub/mirrors/gentoo/                  http://ftp.dei.uc.pt/pub/linux/gentoo/"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_GB"
MAKEOPTS="-j9 -l10"
PKGDIR="/var/cache/packages"
PORTAGE_BINHOST="http://bloodnoc.org/~roy/BINHOSTS/gcc-10.x/armv8a"
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"
USE="X a52 aac acl acpi alsa arm64 berkdb bluetooth branding bzip2 cairo cdda cdr cli context crypt cups dbus default-gold doc dot dri dts dvd dvdnav dvdr eds egl elogind emboss encode exif flac fontconfig fortran gdbm gif gles1 gnome-keyring gpm graphite gstreamer gtk gtk3 gui iconv icu introspection iptables ipv6 jadetex jpeg latex lcms libglvnd libnotify libtirpc lto mad minizip mng modemmanager mp3 mp4 mpeg mysql mysqli ncurses nls nptl nss ogg opengl openmp openssl pam pango pcre pcre16 pdf pie png policykit postproc ppds python qml qt5 raspberry-pi readline script sdl seccomp skia spell split-usr sqlite ssl ssp startup-notification svc svg tcpd threads tiff tk truetype udev udisks unicode upower usb vala virt-network vorbis widgets wxwidgets x264 xattr xcb xml xpm xv xvfb xvid xvmc zlib" ADA_TARGET="gnat_2018" 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_ARM="edsp thumb vfp vfpv3 vfpv4 vfp-d32 crc32 v4 v5 v6 v7 v8 thumb2" 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="evdev libinput" KERNEL="linux" L10N="en en-GB" 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-2 php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python2_7 python3_8" RUBY_TARGETS="ruby25 ruby26 ruby27" USERLAND="GNU" VIDEO_CARDS="fbdev nouveau v3d vc4" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Pi4 Root moriarty / # 

Build log attached
Comment 3 Roy Bamford gentoo-dev 2020-12-11 17:47:18 UTC
Created attachment 677953 [details]
Build Log
Comment 4 crabbed halo ablution 2020-12-11 18:55:11 UTC
I've added a PR with a naive patch at https://github.com/gentoo/gentoo/pull/18610
Anyone know an email address I can submit the patch to?
Comment 5 Alexandru N. Barloiu 2021-01-19 04:51:14 UTC
(In reply to crabbed halo ablution from comment #4)
> I've added a PR with a naive patch at
> https://github.com/gentoo/gentoo/pull/18610
> Anyone know an email address I can submit the patch to?

Just one tiny comment. You don't actually need to modify the ebuild to specify the patch. You can just place it in /etc/portage/patches/media-libs/sbc-1.5/custom.patch and it's enough. Also it compiles fine with this patch.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-01-19 04:54:30 UTC
(In reply to Alexandru N. Barloiu from comment #5)
> (In reply to crabbed halo ablution from comment #4)
> > I've added a PR with a naive patch at
> > https://github.com/gentoo/gentoo/pull/18610
> > Anyone know an email address I can submit the patch to?
> 
> Just one tiny comment. You don't actually need to modify the ebuild to
> specify the patch. You can just place it in
> /etc/portage/patches/media-libs/sbc-1.5/custom.patch and it's enough. Also
> it compiles fine with this patch.

To fix it for everyone, you do.
Comment 7 Larry the Git Cow gentoo-dev 2021-01-21 22:30:40 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=842646ff88d3aad89dac6bc80a5aeb4a0cf9b64c

commit 842646ff88d3aad89dac6bc80a5aeb4a0cf9b64c
Author:     Peter Alfredsen <crabbedhaloablution@icloud.com>
AuthorDate: 2020-12-11 18:51:40 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-01-21 22:28:22 +0000

    media-libs/sbc: Fix 1.5 build on non-x86 platforms.
    
    Closes: https://bugs.gentoo.org/759277
    Package-Manager: Portage-3.0.12, Repoman-3.0.2
    Signed-off-by: Peter Alfredsen <crabbedhaloablution@icloud.com>
    Closes: https://github.com/gentoo/gentoo/pull/18610
    Signed-off-by: Sam James <sam@gentoo.org>

 media-libs/sbc/files/sbc-1.5-ifdef-builtin.patch | 30 ++++++++++++++++++++++++
 media-libs/sbc/sbc-1.5.ebuild                    |  2 ++
 2 files changed, 32 insertions(+)