Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 431422 - Add use flag for Loongson optimizations in x11-libs/pixman
Summary: Add use flag for Loongson optimizations in x11-libs/pixman
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: MIPS Linux
: Normal enhancement (vote)
Assignee: Matt Turner
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: mips-loongson
  Show dependency tree
 
Reported: 2012-08-14 19:05 UTC by Petr Pisar
Modified: 2013-02-06 23:45 UTC (History)
1 user (show)

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


Attachments
Patch for pixman-0.27.2.ebuild (pixman-0.27.2-loongson.patch,826 bytes, patch)
2012-08-14 19:05 UTC, Petr Pisar
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Pisar 2012-08-14 19:05:39 UTC
Created attachment 321352 [details, diff]
Patch for pixman-0.27.2.ebuild

x11-libs/pixman since 0.26 contains handwritten assembler optimization for Loongson MIPS processor.

I request adding new use flag to control this feature because current behavior is compile-time autodetection which does not work when cross-compiling or when one wants to disable the optimization explicitly.

Please note MMX or other SIMD code is driven in the same way.

Attached patch implements it by adding `loongson' USE flag.
Comment 1 Matt Turner gentoo-dev 2012-08-14 19:43:10 UTC
I guess I should do this, but I plan for the configure options to get more complicated, since Loongson 2e and 2f are mutually incompatible.

> which does not work when cross-compiling

I've cross compiled this before. Why doesn't it work for you?
Comment 2 Petr Pisar 2012-08-14 19:51:43 UTC
I did not cross compile the library. But I've cross compiled a lot of other things for an embedded MIPS and I know the problem is the detection in configure cannot handle it. It usually parses `uname' or compiles and run short code to check run-time capabilities. But this of course provides wrong results because build and target machines can be two completely different platforms.
Comment 3 Matt Turner gentoo-dev 2012-08-14 19:59:30 UTC
(In reply to comment #2)
> I did not cross compile the library. But I've cross compiled a lot of other
> things for an embedded MIPS and I know the problem is the detection in
> configure cannot handle it. It usually parses `uname' or compiles and run
> short code to check run-time capabilities. But this of course provides wrong
> results because build and target machines can be two completely different
> platforms.

It doesn't. Cross compilation works by checking whether gcc can compile code for Loongson, not by running it. Check configure.ac.
Comment 4 Petr Pisar 2012-08-14 20:07:26 UTC
I've just did it and you are right. This way it works. But obviously only with GCC.
Comment 5 Matt Turner gentoo-dev 2013-02-06 23:45:17 UTC
Added a loongson2f flag to 0.29.2.