Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 617322 - media-libs/speex-1.2.0-r1: "#error I suppose you can have a [ARM4/ARM5E/Blackfin] that has float instructions?" when cross-compiling for arm
Summary: media-libs/speex-1.2.0-r1: "#error I suppose you can have a [ARM4/ARM5E/Black...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Sound Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 641504
  Show dependency tree
 
Reported: 2017-05-03 10:37 UTC by Paweł Hajdan, Jr. (RETIRED)
Modified: 2018-03-22 20:48 UTC (History)
4 users (show)

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


Attachments
build.log (build.log,21.67 KB, text/x-log)
2017-05-03 10:37 UTC, Paweł Hajdan, Jr. (RETIRED)
Details
configure.ac patch for 1.2_rc3 (0001-Allow-CFLAGS-to-be-handled-via-make.conf-for-optimiz.patch,985 bytes, patch)
2017-06-17 02:24 UTC, Jory A. Pratt
Details | Diff
Patch to use CPU_FLAGS_ARM and fix logic on armv6+ (0001-media-libs-speex-Use-CPU_FLAGS_ARM-and-fix-logic-on-.patch,2.47 KB, patch)
2017-08-26 10:19 UTC, James Le Cuirot
Details | Diff
Patch to fix fixed point (speex-fixed-point.patch,822 bytes, patch)
2018-03-21 22:28 UTC, James Le Cuirot
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2017-05-03 10:37:25 UTC
Created attachment 471558 [details]
build.log

libtool: compile:  armv7a-hardfloat-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -I/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage
/media-libs/speex-1.2.0-r1/work/speex-1.2.0/libspeex -I.. -I/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/media-libs/spee
x-1.2.0-r1/work/speex-1.2.0/include -I../include/speex -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURC
E -O2 -pipe -fomit-frame-pointer -fvisibility=hidden -Wall -c /usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/media-libs/sp
eex-1.2.0-r1/work/speex-1.2.0/libspeex/filters.c  -fPIC -DPIC -o .libs/filters.o
In file included from /usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/media-libs/speex-1.2.0-r1/work/speex-1.2.0/libspeex/f
ilters.h:38:0,
                 from /usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/media-libs/speex-1.2.0-r1/work/speex-1.2.0/libspeex/f
ilters.c:37:
/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/media-libs/speex-1.2.0-r1/work/speex-1.2.0/libspeex/arch.h:68:2: error: #error I suppose you can have a [ARM4/ARM5E/Blackfin] that has float instructions?
 #error I suppose you can have a [ARM4/ARM5E/Blackfin] that has float instructions?
  ^
In file included from /usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/media-libs/speex-1.2.0-r1/work/speex-1.2.0/libspeex/filters.c:47:0:
/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/media-libs/speex-1.2.0-r1/work/speex-1.2.0/libspeex/filters_arm4.h: In function ‘normalize16’:
/usr/armv7a-hardfloat-linux-gnueabi/tmp/portage/media-libs/speex-1.2.0-r1/work/speex-1.2.0/libspeex/filters_arm4.h:69:15: error: invalid operands to binary >> (have ‘spx_sig_t {aka float}’ and ‘int’)
       max_val >>= 1;
               ^

# armv7a-hardfloat-linux-gnueabi-emerge --info
Portage 2.3.5 (python 3.4.6-final-0, default/linux/arm/13.0/armv7a, gcc-5.4.0, glibc-2.24-r1, 4.9.16-gentoo x86_64)
=================================================================
System uname: Linux-4.9.16-gentoo-x86_64-Intel-R-_Core-TM-_i3-5005U_CPU_@_2.00GHz-with-gentoo-2.3
KiB Mem:     3959228 total,     43468 free
KiB Swap:   20971516 total,  20971388 free
Timestamp of repository gentoo: Wed, 03 May 2017 10:00:01 +0000
sh bash 4.4_p12
ld GNU ld (Gentoo 2.27 p1.0) 2.27
app-shells/bash:          4.4_p12::gentoo
dev-lang/python:          2.7.13::gentoo, 3.4.6::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.25::gentoo
sys-apps/sandbox:         2.10-r4::gentoo
sys-devel/binutils:       2.27::gentoo
sys-devel/gcc:            5.4.0-r3::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/make:           4.2.1-r1::gentoo
sys-kernel/linux-headers: 4.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.24-r1::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

ACCEPT_KEYWORDS="arm ~arm"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -fomit-frame-pointer"
CHOST="armv7a-hardfloat-linux-gnueabi"
CONFIG_PROTECT="/etc /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="-O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe -march=armv7-a"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news nodoc noinfo noman parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=armv7-a"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/usr/armv7a-hardfloat-linux-gnueabi/packages/"
PORTAGE_CONFIGROOT="/usr/armv7a-hardfloat-linux-gnueabi/"
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="/usr/armv7a-hardfloat-linux-gnueabi/tmp/"
USE="X acl arm armv5te armv6 armv6t2 berkdb bzip2 cli cracklib crypt cxx dri fortran gdbm iconv icu ipv6 minizip modules ncurses nls nptl openmp pcre readline seccomp session ssl tcpd unicode zlib" 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="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_ARM="edsp thumb thumb2 v4 v5 v6 v7 vfp" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby21 ruby22" USERLAND="GNU" VIDEO_CARDS="exynos fbdev omap dummy v4l" 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, USE_PYTHON
Comment 1 Jory A. Pratt gentoo-dev 2017-06-17 02:12:53 UTC
speex-1.2_rc2 added neon optimization which is what will ultimately fix this bug. rc3 is released and should be added to the tree
Comment 2 Jory A. Pratt gentoo-dev 2017-06-17 02:24:48 UTC
Created attachment 476720 [details, diff]
configure.ac patch for 1.2_rc3
Comment 3 Conrad Kostecki gentoo-dev 2017-06-20 16:49:08 UTC
(In reply to Jory A. Pratt from comment #2)
> Created attachment 476720 [details, diff] [details, diff]
> configure.ac patch for 1.2_rc3

But version is portage is 1.2.0, shoudn't be this never than 1.2_rc3?
I am also having this problem here.
Comment 4 Jory A. Pratt gentoo-dev 2017-06-20 17:53:18 UTC
(In reply to Conrad Kostecki from comment #3)
> (In reply to Jory A. Pratt from comment #2)
> > Created attachment 476720 [details, diff] [details, diff] [details, diff]
> > configure.ac patch for 1.2_rc3
> 
> But version is portage is 1.2.0, shoudn't be this never than 1.2_rc3?
> I am also having this problem here.

No 1.2.0 is not newer, you will see if you try and compile 1.2_rc1 which is in the tree right now it will compile just fine.
Comment 5 Conrad Kostecki gentoo-dev 2017-06-21 14:19:22 UTC
(In reply to Jory A. Pratt from comment #4)
> (In reply to Conrad Kostecki from comment #3)
> > (In reply to Jory A. Pratt from comment #2)
> > > Created attachment 476720 [details, diff] [details, diff] [details, diff] [details, diff]
> > > configure.ac patch for 1.2_rc3
> > 
> > But version is portage is 1.2.0, shoudn't be this never than 1.2_rc3?
> > I am also having this problem here.
> 
> No 1.2.0 is not newer, you will see if you try and compile 1.2_rc1 which is
> in the tree right now it will compile just fine.

Thanks, it worked for me :)
Comment 6 James Le Cuirot gentoo-dev 2017-08-26 10:19:35 UTC
Created attachment 490648 [details, diff]
Patch to use CPU_FLAGS_ARM and fix logic on armv6+

(In reply to Jory A. Pratt from comment #4)
> (In reply to Conrad Kostecki from comment #3)
> > (In reply to Jory A. Pratt from comment #2)
> > > Created attachment 476720 [details, diff] [details, diff] [details, diff] [details, diff]
> > > configure.ac patch for 1.2_rc3
> > 
> > But version is portage is 1.2.0, shoudn't be this never than 1.2_rc3?
> > I am also having this problem here.
> 
> No 1.2.0 is not newer, you will see if you try and compile 1.2_rc1 which is
> in the tree right now it will compile just fine.

Errr... what? 1.2.0 is newer. You seem to be confused with the speexdsp package that was split out in 1.2.0. This has the new NEON handling.

The problem is that armv5te is forced on the later ARM profiles but --enable-arm5e-asm means use armv5-specific (i.e. fixed point) ASM that is not suitable on newer hardware.

Here is a patch that fixes the logic and uses CPU_FLAGS_ARM instead. The old armv6* flags are a bit confusing and these new flags seem to be the way to go now. I'll merge this in a few days if no one has any objections.
Comment 7 James Le Cuirot gentoo-dev 2017-08-30 21:30:20 UTC
Fixed in 88db124b3f3ed7eaaead23a888fbb01dad93eeab.
Comment 8 Markus Meier gentoo-dev 2018-03-21 19:34:02 UTC
Reopening: This is only a partial fix:

libtool: compile:  armv5tel-softfloat-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -I/mnt/distfiles/tmp/portage/media-libs/speex-1.2.0-r1/work/speex-1.2.0/libspeex -I.. -I/mnt/distfiles/tmp/portage/media-libs/speex-1.2.0-r1/work/speex-1.2.0/include -I../include/speex -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -O2 -march=armv5te -pipe -fvisibility=hidden -Wall -c /mnt/distfiles/tmp/portage/media-libs/speex-1.2.0-r1/work/speex-1.2.0/libspeex/cb_search.c  -fPIC -DPIC -o .libs/cb_search.o
In file included from /mnt/distfiles/tmp/portage/media-libs/speex-1.2.0-r1/work/speex-1.2.0/libspeex/cb_search.h:39:0,
                 from /mnt/distfiles/tmp/portage/media-libs/speex-1.2.0-r1/work/speex-1.2.0/libspeex/cb_search.c:36:
/mnt/distfiles/tmp/portage/media-libs/speex-1.2.0-r1/work/speex-1.2.0/libspeex/arch.h:68:2: error: #error I suppose you can have a [ARM4/ARM5E/Blackfin] that has float instructions?
 #error I suppose you can have a [ARM4/ARM5E/Blackfin] that has float instructions?
  ^~~~~

For armv4/5 the --enable-fixed-point configure argument needs to be passed.
Maybe the cleanest solution would be to use tc-is-softfloat() (and check for != "no").
Comment 9 James Le Cuirot gentoo-dev 2018-03-21 22:28:01 UTC
Created attachment 524760 [details, diff]
Patch to fix fixed point

Sorry about that, I don't have any ARM hardware that old. I don't believe fixed point and softfloat are the same thing. It's a simple fix in any case. I could commit the fix against the stable ebuild but please test the patch first.
Comment 10 Markus Meier gentoo-dev 2018-03-22 06:12:07 UTC
(In reply to James Le Cuirot from comment #9)
> Created attachment 524760 [details, diff] [details, diff]
> Patch to fix fixed point
> 
> Sorry about that, I don't have any ARM hardware that old. I don't believe
> fixed point and softfloat are the same thing. It's a simple fix in any case.
> I could commit the fix against the stable ebuild but please test the patch
> first.

your patch works perfectly, thanks!
Comment 11 Larry the Git Cow gentoo-dev 2018-03-22 20:48:27 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=755506b85255d86236beea42d56da56b6c85277f

commit 755506b85255d86236beea42d56da56b6c85277f
Author:     James Le Cuirot <chewi@gentoo.org>
AuthorDate: 2018-03-22 20:47:53 +0000
Commit:     James Le Cuirot <chewi@gentoo.org>
CommitDate: 2018-03-22 20:47:53 +0000

    media-libs/speex: Fix fixed point arithmetic on old ARM
    
    Closes: https://bugs.gentoo.org/617322
    Package-Manager: Portage-2.3.24, Repoman-2.3.6

 media-libs/speex/speex-1.2.0-r1.ebuild | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)