Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 939819 - media-libs/libpng-1.6.44 fails on armv7
Summary: media-libs/libpng-1.6.44 fails on armv7
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-18 16:43 UTC by Xavier Miller
Modified: 2024-09-20 15:39 UTC (History)
5 users (show)

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


Attachments
build log (build.log,28.83 KB, text/x-log)
2024-09-18 16:43 UTC, Xavier Miller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xavier Miller 2024-09-18 16:43:27 UTC
Created attachment 903255 [details]
build log

(is fine with 1.6.43)

libtool: compile:  armv7a-unknown-linux-gnueabihf-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/media-libs/libpng-1.6.44/work/libpng-1.6.44 -O2 -pipe -mfloat-abi=hard -mfpu=vfpv3-d16 -mtls-dialect=gnu -mtune=cortex-a9 -marm -march=armv7-a+mp+sec+neon-fp16 -c /var/tmp/portage/media-libs/libpng-1.6.44/work/libpng-1.6.44/arm/filter_neon_intrinsics.c  -fPIC -DPIC -o arm/.libs/filter_neon_intrinsics.o
In file included from /var/tmp/portage/media-libs/libpng-1.6.44/work/libpng-1.6.44/arm/filter_neon_intrinsics.c:24:
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/14/include/arm_neon.h: In function 'paeth':
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/14/include/arm_neon.h:9245:1: error: inlining failed in call to 'always_inline' 'vbsl_u8': target specific option mismatch
 9245 | vbsl_u8 (uint8x8_t __a, uint8x8_t __b, uint8x8_t __c)
      | ^~~~~~~
/var/tmp/portage/media-libs/libpng-1.6.44/work/libpng-1.6.44/arm/filter_neon_intrinsics.c:282:8: note: called from here
  282 |    e = vbsl_u8(e, a, d);
      |        ^~~~~~~~~~~~~~~~
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/14/include/arm_neon.h:9245:1: error: inlining failed in call to 'always_inline' 'vbsl_u8': target specific option mismatch
 9245 | vbsl_u8 (uint8x8_t __a, uint8x8_t __b, uint8x8_t __c)
      | ^~~~~~~
/var/tmp/portage/media-libs/libpng-1.6.44/work/libpng-1.6.44/arm/filter_neon_intrinsics.c:281:8: note: called from here
  281 |    d = vbsl_u8(d, b, c);
      |        ^~~~~~~~~~~~~~~~
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/14/include/arm_neon.h:7612:1: error: inlining failed in call to 'always_inline' 'vmovn_u16': target specific option mismatch
 7612 | vmovn_u16 (uint16x8_t __a)
      | ^~~~~~~~~
/var/tmp/portage/media-libs/libpng-1.6.44/work/libpng-1.6.44/arm/filter_neon_intrinsics.c:279:8: note: called from here
  279 |    e = vmovn_u16(p1);
      |        ^~~~~~~~~~~~~
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/14/include/arm_neon.h:7612:1: error: inlining failed in call to 'always_inline' 'vmovn_u16': target specific option mismatch
 7612 | vmovn_u16 (uint16x8_t __a)
      | ^~~~~~~~~
/var/tmp/portage/media-libs/libpng-1.6.44/work/libpng-1.6.44/arm/filter_neon_intrinsics.c:278:8: note: called from here
  278 |    d = vmovn_u16(pb);
      |        ^~~~~~~~~~~~~
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/14/include/arm_neon.h:15231:1: error: inlining failed in call to 'always_inline' 'vandq_u16': target specific option mismatch
15231 | vandq_u16 (uint16x8_t __a, uint16x8_t __b)
      | ^~~~~~~~~
/var/tmp/portage/media-libs/libpng-1.6.44/work/libpng-1.6.44/arm/filter_neon_intrinsics.c:276:9: note: called from here
  276 |    p1 = vandq_u16(p1, pa); /* pa <= pb && pa <= pc */
      |         ^~~~~~~~~~~~~~~~~
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/14/include/arm_neon.h:2662:1: error: inlining failed in call to 'always_inline' 'vcleq_u16': target specific option mismatch
 2662 | vcleq_u16 (uint16x8_t __a, uint16x8_t __b)
      | ^~~~~~~~~
/var/tmp/portage/media-libs/libpng-1.6.44/work/libpng-1.6.44/arm/filter_neon_intrinsics.c:274:9: note: called from here
  274 |    pb = vcleq_u16(pb, pc); /* pb <= pc */
      |         ^~~~~~~~~~~~~~~~~
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/14/include/arm_neon.h:2662:1: error: inlining failed in call to 'always_inline' 'vcleq_u16': target specific option mismatch
 2662 | vcleq_u16 (uint16x8_t __a, uint16x8_t __b)
      | ^~~~~~~~~
/var/tmp/portage/media-libs/libpng-1.6.44/work/libpng-1.6.44/arm/filter_neon_intrinsics.c:273:9: note: called from here
  273 |    pa = vcleq_u16(pa, pc); /* pa <= pc */
      |         ^~~~~~~~~~~~~~~~~
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/14/include/arm_neon.h:2662:1: error: inlining failed in call to 'always_inline' 'vcleq_u16': target specific option mismatch
 2662 | vcleq_u16 (uint16x8_t __a, uint16x8_t __b)
      | ^~~~~~~~~
/var/tmp/portage/media-libs/libpng-1.6.44/work/libpng-1.6.44/arm/filter_neon_intrinsics.c:272:9: note: called from here
  272 |    p1 = vcleq_u16(pa, pb); /* pa <= pb */
      |         ^~~~~~~~~~~~~~~~~
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/14/include/arm_neon.h:3253:1: error: inlining failed in call to 'always_inline' 'vabdq_u16': target specific option mismatch
 3253 | vabdq_u16 (uint16x8_t __a, uint16x8_t __b)
      | ^~~~~~~~~
/var/tmp/portage/media-libs/libpng-1.6.44/work/libpng-1.6.44/arm/filter_neon_intrinsics.c:270:9: note: called from here
  270 |    pc = vabdq_u16(p1, pc); /* pc */
      |         ^~~~~~~~~~~~~~~~~
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/14/include/arm_neon.h:3288:1: error: inlining failed in call to 'always_inline' 'vabdl_u8': target specific option mismatch
 3288 | vabdl_u8 (uint8x8_t __a, uint8x8_t __b)
      | ^~~~~~~~
/var/tmp/portage/media-libs/libpng-1.6.44/work/libpng-1.6.44/arm/filter_neon_intrinsics.c:269:9: note: called from here
  269 |    pb = vabdl_u8(a, c); /* pb */
      |         ^~~~~~~~~~~~~~
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/14/include/arm_neon.h:3288:1: error: inlining failed in call to 'always_inline' 'vabdl_u8': target specific option mismatch
 3288 | vabdl_u8 (uint8x8_t __a, uint8x8_t __b)
      | ^~~~~~~~
/var/tmp/portage/media-libs/libpng-1.6.44/work/libpng-1.6.44/arm/filter_neon_intrinsics.c:268:9: note: called from here
  268 |    pa = vabdl_u8(b, c); /* pa */
      |         ^~~~~~~~~~~~~~
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/14/include/arm_neon.h:686:1: error: inlining failed in call to 'always_inline' 'vaddl_u8': target specific option mismatch
  686 | vaddl_u8 (uint8x8_t __a, uint8x8_t __b)
      | ^~~~~~~~
/var/tmp/portage/media-libs/libpng-1.6.44/work/libpng-1.6.44/arm/filter_neon_intrinsics.c:267:9: note: called from here
  267 |    pc = vaddl_u8(c, c); /* c * 2 */
      |         ^~~~~~~~~~~~~~
/usr/lib/gcc/armv7a-unknown-linux-gnueabihf/14/include/arm_neon.h:686:1: error: inlining failed in call to 'always_inline' 'vaddl_u8': target specific option mismatch
  686 | vaddl_u8 (uint8x8_t __a, uint8x8_t __b)
      | ^~~~~~~~
/var/tmp/portage/media-libs/libpng-1.6.44/work/libpng-1.6.44/arm/filter_neon_intrinsics.c:266:9: note: called from here
  266 |    p1 = vaddl_u8(a, b); /* a + b */
      |         ^~~~~~~~~~~~~~
make[1]: *** [Makefile:1274: arm/filter_neon_intrinsics.lo] Error 1
make[1]: Leaving directory '/var/tmp/portage/media-libs/libpng-1.6.44/work/libpng-1.6.44-.arm'
make: *** [Makefile:886: all] Error 2
 * ERROR: media-libs/libpng-1.6.44::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=media-libs/libpng-1.6.44::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=media-libs/libpng-1.6.44::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/media-libs/libpng-1.6.44/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-libs/libpng-1.6.44/temp/environment'.
 * Working directory: '/var/tmp/portage/media-libs/libpng-1.6.44/work/libpng-1.6.44-.arm'
 * S: '/var/tmp/portage/media-libs/libpng-1.6.44/work/libpng-1.6.44'

>>> Failed to emerge media-libs/libpng-1.6.44, Log file:
Comment 1 Xavier Miller 2024-09-18 16:44:50 UTC
(armv7 build chroot on AARCH64 host)

# emerge --info '=media-libs/libpng-1.6.44::gentoo'
Portage 3.0.66.1 (python 3.12.6-final-0, default/linux/arm/23.0/armv7a_hf, gcc-14, glibc-2.40-r3, 6.10.10 armv8l)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.10.10-armv8l-ARMv8_Processor_rev_4_-v8l-with-glibc2.40
KiB Mem:     3852116 total,    536424 free
KiB Swap:   16777396 total,  16729524 free
Timestamp of repository gentoo: Wed, 18 Sep 2024 14:49:08 +0000
Timestamp of repository guru: Tue, 17 Sep 2024 12:06:21 +0000
sh bash 5.2_p32-r1
ld GNU ld (Gentoo 2.43 p2) 2.43.1
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p32-r1::gentoo
dev-build/autoconf:        2.72-r1::gentoo
dev-build/automake:        1.17-r1::gentoo
dev-build/cmake:           3.30.3::gentoo
dev-build/libtool:         2.4.7-r4::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.5.1::gentoo
dev-java/java-config:      2.3.4::gentoo
dev-lang/perl:             5.40.0::gentoo
dev-lang/python:           3.12.6::gentoo
sys-apps/baselayout:       2.15::gentoo
sys-apps/openrc:           0.55::gentoo
sys-apps/sandbox:          2.39::gentoo
sys-devel/binutils:        2.43-r1::gentoo
sys-devel/binutils-config: 5.5.2::gentoo
sys-devel/gcc:             14.2.1_p20240817::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-kernel/linux-headers:  6.10::gentoo (virtual/os-headers)
sys-libs/glibc:            2.40-r3::gentoo
Repositories:

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

audio-overlay
    location: /var/portage/repos/audio-overlay
    masters: gentoo
    volatile: True

guru
    location: /var/portage/repos/guru
    masters: gentoo
    volatile: True

inode64-overlay
    location: /var/portage/repos/inode64-overlay
    masters: gentoo
    volatile: True

local
    location: /usr/local/portage
    masters: gentoo
    volatile: True

crossdev
    location: /data/nas/xavier/portage/helios4/var/db/repos/crossdev
    masters: gentoo
    priority: 10
    volatile: True

ACCEPT_KEYWORDS="arm ~arm"
ACCEPT_LICENSE="@FREE as-is freedist"
CBUILD="armv7a-unknown-linux-gnueabihf"
CFLAGS="-O2 -pipe -mfloat-abi=hard -mfpu=vfpv3-d16 -mtls-dialect=gnu -mtune=cortex-a9 -marm -march=armv7-a+mp+sec+neon-fp16"
CHOST="armv7a-unknown-linux-gnueabihf"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/lib/zigbee2mqtt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d"
CXXFLAGS="-O2 -pipe -mfloat-abi=hard -mfpu=vfpv3-d16 -mtls-dialect=gnu -mtune=cortex-a9 -marm -march=armv7-a+mp+sec+neon-fp16"
DISTDIR="/var/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y --quiet-build=n --buildpkg"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE 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 -march=armv7-a"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg buildpkg-live candy config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps 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"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--hash-style=gnu -Wl,--as-needed"
LEX="flex"
LINGUAS="fr fr-BE fr-FR nl nl-BE nl-NL en en-GB en-US"
MAKEOPTS="-j5 -l7"
PKGDIR="/var/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"
USE="arm armv7 bzip2 crypt exif gif headless-awt iconv jpeg lzma mysql ncurses nls openmp openssl pam pcre pdf png pnm readline seccomp sqlite ssl svg system-bootstrap system-llvm test-rust tiff truetype unicode xattr zlib zstd" ADA_TARGET="gcc_12" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio 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 neon thumb vfp vfpv3 vfp-d32 v4 v5 v6 v7 thumb2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput" KERNEL="linux" L10N="fr fr-BE fr-FR nl nl-BE nl-NL en en-GB en-US" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LLVM_SLOT="18" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12" RUBY_TARGETS="ruby31 ruby32" SANE_BACKENDS="hp" VIDEO_CARDS="exynos fbdev omap dummy" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LANG, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SHELL, SIZE, STRINGS, STRIP, YACC, YFLAGS

^_(helios4) clown / #
Comment 2 Xavier Miller 2024-09-18 16:45:17 UTC
I filed an issue at libpng: https://github.com/pnggroup/libpng/issues/598
Comment 3 John Bowler 2024-09-19 04:12:33 UTC
See the warning from configure in the build log file. It's been there since 2013-06-08.

Do not pass --enable-arm-neon to configure; it produces intractable problems because it can be guaranteed not to work on many ARM systems.  Simple fix, remove it and the "neon" USE flag.

You do need the --enable-intel-sse flag in 1.6; Cosmin wouldn't take the fix for this in 1.6 (it's in the pull queue for libpng 1.8).  You don't need and should not use anything other than --disable-<CPU>-<ISA> on any architecture other than Intel/AMD.

I certainly don't understand what the mix of FPU options the OP is using means but they certainly mean the compiler isn't including support for NEON instructions, as the error messages show.

WORKROUND: package.use

>=media-libs/libpng-1.6.43 -neon

(I didn't check that but it should be correct.)
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-19 04:18:37 UTC
I'll have a look, thanks.
Comment 5 John Bowler 2024-09-19 16:57:34 UTC
I took a look at what my own crossdev armv7a gcc compiler is doing and, in fact, it seems to default to having vfpv3 on, even with -mfpu=neon, even if -mfpu=vfpv3 is omitted; both __ARM_PCS_VFP and __VFP_FP__ are defined.  In any case gcc supports -fpu=neon-vfpv3.

I also recall being informed before 2013 when ARM Ltd added VFP (prior to that there had only been NEON) that mixing NEON and VFP instructions was a bad idea because they used the same registers.  Obviously the compiler can handle this since it controls the registers but mixing in assembler code is a potential problem.  This is why I wanted to eliminate the configuration-time switch to force NEON instructions even if not supported by the compiler at the time.

Now it's moot because the assembler file is poisoning AArch64 builds:

https://github.com/pnggroup/libpng/issues/505

Something had to be done about that; see the discussion in #505 if you want to understand more about the decision process.
Comment 6 Larry the Git Cow gentoo-dev 2024-09-20 06:20:24 UTC
The bug has been closed via the following commit(s):

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

commit f6d785e9cd9c36a555f73c6083c193c3879d6cce
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-09-20 06:18:28 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-09-20 06:18:28 +0000

    media-libs/libpng: drop cpu_flags_arm_neon
    
    With >=1.6.44, it fails to build in some cases, but it wasn't recommended
    anyway. configure warns about the use of --enable-arm-neon. Just rely
    on what *FLAGS specify.
    
    Thanks to John Bowler for the analysis.
    
    Closes: https://bugs.gentoo.org/939819
    Signed-off-by: Sam James <sam@gentoo.org>

 media-libs/libpng/libpng-1.6.44.ebuild | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-20 06:21:03 UTC
Thanks. Note that I've assumed that it (configure) respects *FLAGS correctly so if you want to avoid NEON even if your compiler with no *FLAGS supports it, you can. Hopefully that's a good assumption.
Comment 8 John Bowler 2024-09-20 15:39:26 UTC
(In reply to Sam James from comment #7)
> Thanks. Note that I've assumed that it (configure) respects *FLAGS correctly
> so if you want to avoid NEON even if your compiler with no *FLAGS supports
> it, you can. Hopefully that's a good assumption.

This is the situation on AArch64 - gcc does not seem to have any -mfpu= options and it always defines __ARM_NEON.  However pretty much anything can be disabled in libpng using CPPFLAGS (not CFLAGS, although that does work in this case).

*Without* any --enable-arm-neon to configure it's:

CPPFLAGS=-DPNG_ARM_NEON_OPT=0

If that is given or, for that matter, if --enable-arm-neon is given to configure, it gets recorded at the end of /usr/include/pnglibconf.h along with all the other very extensive configuration.

Someone could put that into make.conf if they want a one-line change or, of course, in package.env, env.

What I want to do in libpng 1.8 is have "--enable-target-specific-code" with, perhaps, "enable" the default and doing nothing but "disable" working on any architecture that supports such optimizations.