Summary: | media-libs/libpng-1.6.44 fails on armv7 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Xavier Miller <xavier.miller> |
Component: | Current packages | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | arm, codec, jbowler, sam, xavier.miller |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | ARM | ||
OS: | Linux | ||
See Also: |
https://github.com/pnggroup/libpng/issues/598 https://github.com/pnggroup/libpng/issues/505 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | build log |
Description
Xavier Miller
2024-09-18 16:43:27 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 / # I filed an issue at libpng: https://github.com/pnggroup/libpng/issues/598 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.)
I'll have a look, thanks. 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. 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(-) 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. (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. |