Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 297794 - x11-libs/pixman-0.16.0: pixman-arm-neon.c:982: error: constant out of range
Summary: x11-libs/pixman-0.16.0: pixman-arm-neon.c:982: error: constant out of range
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM Linux
: High normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-21 15:59 UTC by Jacob Godserv
Modified: 2010-01-12 20:47 UTC (History)
2 users (show)

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


Attachments
build.log (build.log,51.54 KB, text/plain)
2009-12-21 16:52 UTC, Jacob Godserv
Details
build.log (build.log,58.36 KB, text/plain)
2009-12-27 17:23 UTC, Jacob Godserv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jacob Godserv 2009-12-21 15:59:31 UTC
x11-libs/pixman-0.16.0 fails to build on an armv7a processor with the following:

libtool: compile:  armv7a-softfloat-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -I.. -mfpu=neon -mcpu=cortex-a8 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fomit-frame-pointer -Os -pipe -Wall -fno-strict-aliasing -fvisibility=hidden -MT libpixman_arm_neon_la-pixman-arm-neon.lo -MD -MP -MF .deps/libpixman_arm_neon_la-pixman-arm-neon.Tpo -c pixman-arm-neon.c  -fPIC -DPIC -o .libs/libpixman_arm_neon_la-pixman-arm-neon.o
cc1: warning: switch -mcpu=cortex-a8 conflicts with -march= switch
pixman-arm-neon.c:1: warning: switch -mcpu=cortex-a8 conflicts with -march= switch
pixman-arm-neon.c: In function 'neon_composite_add_8000_8000':
pixman-arm-neon.c:163: warning: unused variable 'temp'
pixman-arm-neon.c:163: warning: unused variable 'dval'
pixman-arm-neon.c:163: warning: unused variable 'sval'
pixman-arm-neon.c: In function 'neon_composite_over_8888_8888':
pixman-arm-neon.c:322: warning: unused variable 'temp'
pixman-arm-neon.c:322: warning: unused variable 'dval'
pixman-arm-neon.c:322: warning: unused variable 'sval'
pixman-arm-neon.c: At top level:
pixman-arm-neon.c:2319: warning: 'neon_composite_over_n_0565' defined but not used
pixman-arm-neon.c:2477: warning: 'neon_composite_over_8888_0565' defined but not used
pixman-arm-neon.c:2729: warning: 'arm_neon_blt' defined but not used
pixman-arm-neon.c: In function 'neon_composite_over_n_8_0565':
pixman-arm-neon.c:840: warning: 'dval' may be used uninitialized in this function
pixman-arm-neon.c:840: note: 'dval' was declared here
pixman-arm-neon.c:839: warning: 'alpha' may be used uninitialized in this function
pixman-arm-neon.c:839: note: 'alpha' was declared here
pixman-arm-neon.c:982: error: constant out of range
pixman-arm-neon.c:982: error: constant out of range
pixman-arm-neon.c:982: error: constant out of range
make[3]: *** [libpixman_arm_neon_la-pixman-arm-neon.lo] Error 1
make[3]: Leaving directory `/var/tmp/portage/x11-libs/pixman-0.16.0/work/pixman-0.16.0/pixman'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/var/tmp/portage/x11-libs/pixman-0.16.0/work/pixman-0.16.0/pixman'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/x11-libs/pixman-0.16.0/work/pixman-0.16.0'
make: *** [all] Error 2

Reproducible: Always

Steps to Reproduce:




Portage 2.1.6.13 (default/linux/arm/10.0/desktop, gcc-4.3.3, glibc-2.9_p20081201-r2, 2.6.30-rc8-omap1-beagle-05719-g151c7a7 armv7l)
=================================================================
System uname: Linux-2.6.30-rc8-omap1-beagle-05719-g151c7a7-armv7l-ARMv7_Processor_rev_2_-v7l-with-glibc2.4
Timestamp of tree: Mon, 21 Dec 2009 00:30:22 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p35
dev-lang/python:     2.5.4-r2
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.63-r1
sys-devel/automake:  1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="arm"
CBUILD="armv7a-softfloat-linux-gnueabi"
CFLAGS="-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fomit-frame-pointer -Os -pipe"
CHOST="armv7a-softfloat-linux-gnueabi"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fomit-frame-pointer -Os -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--buildpkg"
FEATURES="ccache collision-protect distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,-O1"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa arm berkdb bluetooth branding bzip2 cairo cdr cli consolekit cracklib crypt cups cxx dbus dts dvdr eds emboss encode evo fam firefox flac fortran gdbm gif gnome gpm gstreamer gtk hal iconv ipv6 jpeg ldap libnotify mad mikmod mng modules mp3 mp4 mpeg mudflap ncurses nls nptl nptlonly ogg opengl openmp pam pcre pdf perl png ppds pppd python qt3support qt4 quicktime readline reflection sdl session spell spl ssl startup-notification svg sysfs tcpd thunar tiff truetype unicode usb vorbis xml xorg xulrunner xv xvid zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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 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" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse touchscreen" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev"
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jacob Godserv 2009-12-21 16:52:11 UTC
Created attachment 213689 [details]
build.log
Comment 2 Siarhei Siamashka 2009-12-21 17:06:12 UTC
Reference to upstream bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=23576
This problem is fixed in pixman 0.16.2
Comment 3 Jacob Godserv 2009-12-22 22:29:19 UTC
Is this confirmed, then?
Comment 4 Siarhei Siamashka 2009-12-23 23:22:46 UTC
(In reply to comment #3)
> Is this confirmed, then?

Sorry, what do you mean?

I was expecting that you could confirm whether it helps or not in your case. This compilation error is a bug in gcc, which was confirmed and already fixed by upstream. Maybe it even will become available in the next gcc 4.4 point release. In the mean time, pixman 0.16.2 has a workaround for this problem and replaces the problematic intrinsic with equivalent inline assembly.

While I tried myself to test different combinations of toolchains and compilation options, it was not nearly close to full coverage. So I want to know about all the possible sources of breakages.

For this particular bug either moving to version 0.16.2 would be a good idea, or the following patch can be applied to pixman 0.16.0: http://cgit.freedesktop.org/pixman/commit/?h=0.16&id=698b686d58c510e1b8a9183750d00cbd9ed504b2
Comment 5 Siarhei Siamashka 2009-12-27 16:46:11 UTC
I can confirm that pixman 0.16.x is also affected by a bug in binutils (same as reported in bug 297801). But this breakage also may depend on gcc version and optimization options in CFLAGS (causing the build to success in some configurations). The offending "vmov" instruction gets generated by gcc here when compiling ARM NEON intrinsics, and it makes assembler go crazy and add bogus symbols in the symbol table.
Comment 6 Jacob Godserv 2009-12-27 16:48:13 UTC
x11-libs/pixman-0.16.0 and sys-devel/binutils-2.18-r3 work when pixman is compiled with CFLAGS="-Os -pipe" and binutils is built with CFLAGS="-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fomit-frame-pointer -Os -pipe"

About to try pixman with binutil's CFLAGS. I expect a failure.
Comment 7 Jacob Godserv 2009-12-27 16:54:12 UTC
0.16.0 failed to build with CFLAGS="-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fomit-frame-pointer -Os -pipe". About to try pixman-0.16.2 with same CFLAGS.
Comment 8 Jacob Godserv 2009-12-27 16:58:41 UTC
0.16.2 fails, but this time instead of with the output given in this bug it fails with similar output as bug #297801:

/bin/sh ../libtool --tag=CC   --mode=link armv7a-softfloat-linux-gnueabi-gcc  -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fomit-frame-point
er -Os -pipe -Wall -fno-strict-aliasing -fvisibility=hidden  -Wl,-O1 -o region-test region-test.o ../pixman/libpixman-1.la
libtool: link: armv7a-softfloat-linux-gnueabi-gcc -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fomit-frame-pointer -Os -pipe -Wall -fno-stri
ct-aliasing -fvisibility=hidden -Wl,-O1 -o .libs/region-test region-test.o  ../pixman/.libs/libpixman-1.so -lm
../pixman/.libs/libpixman-1.so: undefined reference to `d19'
../pixman/.libs/libpixman-1.so: undefined reference to `d22'
../pixman/.libs/libpixman-1.so: undefined reference to `d18'
../pixman/.libs/libpixman-1.so: undefined reference to `d21'
collect2: ld returned 1 exit status

I'll retry all 0.16.x versions with CFLAGS="-Os -pipe" again, to make sure they all work without NEON.

Does 0.16.2 belong in bug #297801, or is bug #297801 and this bug the same?
Comment 9 Jacob Godserv 2009-12-27 17:08:23 UTC
Both 0.16.0 and 0.16.2 work with CFLAGS="-Os -pipe"

I'm going to try that patch on 0.16.0 next.

Is there any other information needed?
Comment 10 Jacob Godserv 2009-12-27 17:23:09 UTC
Created attachment 214325 [details]
build.log

With the patch, this bug is fixed. However, we then hit bug #297801 directly afterward:

/bin/sh ../libtool --tag=CC   --mode=link armv7a-softfloat-linux-gnueabi-gcc  -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fomit-frame-pointer -Os -pipe -Wall -fno-strict-aliasing -fvisibility=hidden  -Wl,-O1 -o region-test region-test.o ../pixman/libpixman-1.la
libtool: link: armv7a-softfloat-linux-gnueabi-gcc -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fomit-frame-pointer -Os -pipe -Wall -fno-strict-aliasing -fvisibility=hidden -Wl,-O1 -o .libs/region-test region-test.o  ../pixman/.libs/libpixman-1.so -lm
../pixman/.libs/libpixman-1.so: undefined reference to `d19'
../pixman/.libs/libpixman-1.so: undefined reference to `d22'
../pixman/.libs/libpixman-1.so: undefined reference to `d18'
../pixman/.libs/libpixman-1.so: undefined reference to `d21'
collect2: ld returned 1 exit status

The full build.log is attached.

I'd consider this bug fixed with the given patch. Bug #297801 should be a focus (unless, again, they're really the same).
Comment 11 Jacob Godserv 2009-12-27 17:28:54 UTC
0.16.2 is not affected by this bug. It already has the patch applied. It fails similarly to 0.16.0 when the patch is applied to it.
Comment 12 Siarhei Siamashka 2009-12-27 17:37:55 UTC
To sum it up, there are 3 bugs related to pixman so far:

1. "error: constant out of range"

This is a bug in gcc, pixman 0.16.2 has a workaround.

Affected versions of pixman: 0.16.0

Reported here.

2. "undefined reference to `d19'" (or any symbols starting with 'd' prefix and numeric suffix)

This is a bug in binutils 2.18 (fixed in 2.19), it can't be workarounded for pixman in a relaible way and binutils upgrade is required.

Affected versions of pixman: 0.16.0, 0.16.2, 0.17.2

Reported as bug 297801

3. "Error: selected processor does not support `pld [PF_SRC,PF_X,lsl#src_bpp_shift]'"

Finally this is a bug in pixman itself, causing build failure when compiling for armv4. The fix is in upstream git.

Affected versions of pixman: 0.16.0, 0.17.2

Reported as bug 298391
Comment 13 Jacob Godserv 2009-12-27 17:42:18 UTC
Summarizing my tests for archival purposes; the above summary is probably more useful:

*) 0.16.0 with "-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fomit-frame-pointer -Os -pipe" without patch results in "error: constant out of range"
*) 0.16.0 with "-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fomit-frame-pointer -Os -pipe" with patch results in "../pixman/.libs/libpixman-1.so: undefined reference to"
*) 0.16.0 with "-Os -pipe" without patch succeeds.

*) 0.16.2 with "-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fomit-frame-pointer -Os -pipe" (patch is not applicable) results in "../pixman/.libs/libpixman-1.so: undefined reference to"
*) 0.16.2 with "-Os -pipe" (patch is not applicable) succeeds.
Comment 14 Raúl Porcel (RETIRED) gentoo-dev 2010-01-12 20:47:21 UTC
pixman-0.16.2 marked stable