Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 284786 - dev-libs/botan-1.8.7 doesn't pass the right --cpu to configure
Summary: dev-libs/botan-1.8.7 doesn't pass the right --cpu to configure
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Jack Lloyd
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-13 17:00 UTC by Dmitry Karasik
Modified: 2009-12-23 04:21 UTC (History)
1 user (show)

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


Attachments
botan 1.8.7-r1 ebuild (botan-1.8.7-r1.ebuild,2.19 KB, text/plain)
2009-09-15 21:56 UTC, Jack Lloyd
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Karasik 2009-09-13 17:00:15 UTC
It derives the --cpu arg from CHOST which is normally i686 on even the newest x86 platforms.

This disables sha1_sse2 on Pentium4 even though it supports SSE2.
Comment 1 Jack Lloyd 2009-09-15 21:55:53 UTC
There is somewhat of a quandary in fixing this, unfortunately.

The configure.py script can autodetect the processor that it is currently running on (via Python's platform module). However in some cases this has unfavorable behavior (particularly note the special case in the ebuild for sparc, as Gentoo/sparc is a 32-bit userspace so 64-bit builds there are never good; I think PPC may have similar problems but am not sure).

On the other hand, for x86 in particular this may make a big difference, not only for enabling SSE2 code but also in terms of general code scheduling.

Digging through other ebuilds, I found the get-flag ebuild command. It looks like this might have the desired effect - if the user has set -march/-mcpu, use that as the target processor, otherwise use CHOST as before.

I've created an updated version of the 1.8.7 ebuild which attempts this. Only tested on x86-64 but it seems to behave properly. I somewhat expect that there are at least a few cases this will do the wrong thing, though.
Comment 2 Jack Lloyd 2009-09-15 21:56:15 UTC
Created attachment 204260 [details]
botan 1.8.7-r1 ebuild
Comment 3 Dmitry Karasik 2009-09-16 13:22:32 UTC
I have -march=native, so it fails for me with:

 * Building for CPU native
 * Disabling modules: proc_walk,unix_procs,cpu_counter
Unknown or unidentifiable processor "native"
 *
 * ERROR: dev-libs/botan-1.8.7-r1 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_configure
 *             environment, line 2587:  Called die
 * The specific snippet of code:
 *       ./configure.py --prefix="${D}/usr" --libdir=/$(get_libdir) --docdir=/share/doc/ --cc=gcc --os=linux --cpu=${arch} --with-endian="$(tc-endian)" --with-tr1=system $(use_with bzip2) $(use_with gmp gnump) $(use_with ssl openssl) $(use_with zlib) --disable-modules=${disable_modules} || die "configure.py failed"
 *  The die message:
 *   configure.py failed
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/dev-libs/botan-1.8.7-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-libs/botan-1.8.7-r1/temp/environment'.
 *
Comment 4 Jack Lloyd 2009-12-23 04:21:44 UTC
Not going to fix this in 1.8. It would require too many invasive changes to the build system.

Mainline sources (to be released as 1.9.4, probably sometime early next year) adds build options --enable-{sse2,ssse3,altivec} which can be used with portages use_enable to turn on SIMD code based on use flags rather than guessing based on the argument to --cpu.