Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 405313 - [PATCH] Qt4 build wrongly detects NEON support on Tegra2
Summary: [PATCH] Qt4 build wrongly detects NEON support on Tegra2
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: ARM Linux
: Normal normal (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2012-02-22 17:59 UTC by Alexey Charkov
Modified: 2012-02-23 13:36 UTC (History)
0 users

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


Attachments
Trivial addition to qt4-build.eclass to pass -no-neon when USE=-neon (qt4-build-eclass.patch,626 bytes, patch)
2012-02-22 18:01 UTC, Alexey Charkov
Details | Diff
Trivial addition to qt4-build.eclass to pass -no-neon when USE=-neon (qt4-build-eclass.patch,689 bytes, patch)
2012-02-23 07:23 UTC, Alexey Charkov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Charkov 2012-02-22 17:59:42 UTC
x11-libs/qt-* configure scripts default to automatic detection of NEON support on ARM, which only checks whether or not the compiler returns an error when NEON instructions are requested. This does not work on Nvidia Tegra2, which is armv7a but without support for NEON. Explicit disabling of NEON instructions is supported via -no-neon configure switch, though.

Suggestion is to amend qt4-build.eclass with support for USE=-neon, patch to follow shortly.

Reproducible: Always
Comment 1 Alexey Charkov 2012-02-22 18:01:30 UTC
Created attachment 302881 [details, diff]
Trivial addition to qt4-build.eclass to pass -no-neon when USE=-neon
Comment 2 Markos Chandras (RETIRED) gentoo-dev 2012-02-22 18:45:05 UTC
The patch looks good but the "myconf" line should be placed further down, right after the "case "$(tc-arch)"" statement
Comment 3 Davide Pesavento (RETIRED) gentoo-dev 2012-02-22 21:12:14 UTC
Can you please elaborate a bit more? What problems does this cause? Build failure? Runtime crash?
Note that qt checks at runtime if cpu-specific optimizations can be used, the configure results are used only to decide whether to compile neon code or not.
Comment 4 Alexey Charkov 2012-02-23 03:38:39 UTC
(In reply to comment #3)
> Can you please elaborate a bit more? What problems does this cause? Build
> failure? Runtime crash?

It's causing runtime crashes in certain Qt-based programs (not all). Unfortunately, it would be difficult for me to reproduce a crash now, as I compile stuff natively on a Toshiba AC100 (which is still not too fast).

> Note that qt checks at runtime if cpu-specific optimizations can be used, the
> configure results are used only to decide whether to compile neon code or not.

NEON instructions require -mfpu=neon, which on armv7a-hardfloat* causes generated code to be calltime-incompatible with the rest of the system (built with -mfpu=vfpv3-d16) if it uses any floating-point functions. So it's not only about optimizations in this case.
Comment 5 Alexey Charkov 2012-02-23 07:23:53 UTC
Created attachment 302945 [details, diff]
Trivial addition to qt4-build.eclass to pass -no-neon when USE=-neon

Moved the myconf line further down as Markos suggested, also included a descriptive comment.
Comment 6 Davide Pesavento (RETIRED) gentoo-dev 2012-02-23 11:33:13 UTC
Seems like this could be reported upstream too.
Anyway, you said you compiled the rest of the system with -mfpu=vfpv3-d16, which should cause the configure check to fail... Could you provide the relevant portion of build.log for qt-gui?
Comment 7 Alexey Charkov 2012-02-23 12:43:08 UTC
Sorry for the fuss. Just checked compilation with and without my patch, and both work as expected.

In fact, revision 1.113 on 2011-12-31 made the configure tests behave correctly by passing correct C{,XX}FLAGS, which now results in the NEON check failing with -mfloat-abi=hard -mfpu=vfpv3-d16. So, my local overrides are no longer necessary, which I haven't noticed :-)

Thanks for your work, guys!