Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 333679 - dev-libs/openssl-1.0.0a-r1 has armv4 optimizations, but gentoo.config does not respect them
Summary: dev-libs/openssl-1.0.0a-r1 has armv4 optimizations, but gentoo.config does no...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-20 19:18 UTC by Sergei Trofimovich (RETIRED)
Modified: 2010-08-23 06:02 UTC (History)
0 users

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


Attachments
gentoo-config.patch - adds armv4+ targets as special (gentoo-config.patch,705 bytes, patch)
2010-08-20 19:19 UTC, Sergei Trofimovich (RETIRED)
Details | Diff
openss-ebuild.patch - just changes gentoo.config name (openss-ebuild.patch,477 bytes, patch)
2010-08-20 19:20 UTC, Sergei Trofimovich (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Trofimovich (RETIRED) gentoo-dev 2010-08-20 19:18:39 UTC
openssl-1.x added optimized support for:
sha1, sha256, sha512, aes, modmul

Current openssl does not enable those.

Patches are to be attached in a second.

My box is armv5tel (marvell sheevapug). Tested successfully with FEATURES=test.

Some stats in advance:

Some stats (I took only AES):
'openssl speed' for linux-generic32:

aes-128 ige       9599.54k    11060.98k    11493.29k    11621.89k    11419.48k
aes-192 ige       8389.06k     9475.13k     9786.24k     9871.84k     9734.51k
aes-256 ige       7443.99k     8285.13k     8524.63k     8589.27k     8482.42k

'openssl speed' for linux-armv4:
aes-128 ige      14030.57k    16466.19k    17184.17k    17424.44k    17318.27k
aes-192 ige      12427.90k    14249.97k    14818.38k    14917.63k    14904.51k
aes-256 ige      11094.91k    12564.38k    12998.64k    13114.39k    13052.40k

46 to 49% speedup
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2010-08-20 19:19:40 UTC
Created attachment 243747 [details, diff]
gentoo-config.patch - adds armv4+ targets as special
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2010-08-20 19:20:11 UTC
Created attachment 243749 [details, diff]
openss-ebuild.patch - just changes gentoo.config name
Comment 3 SpanKY gentoo-dev 2010-08-20 19:57:09 UTC
looks fine, but there would be issues with arm-* targets
Comment 4 SpanKY gentoo-dev 2010-08-23 01:51:10 UTC
thinking about it some more, i think it'll get other targets incorrect as well.  for example, arm6-xxx probably means the ARM6 family which is of the architecture ARMv3.  the ARM naming convention is just way too f-ed up to make this an "opt-out" glob.

perhaps the only safe way to handle this is:
+		armv[4-9]*b*) machine="armv4 -DB_ENDIAN";;
+		armv[4-9]*)   machine="armv4 -DL_ENDIAN";;
+		arm*b*)       machine="generic32 -DB_ENDIAN";;
+		arm*)         machine="generic32 -DL_ENDIAN";;

the openssl config itself does the opposite, but they're comparing against `uname -m`, so they can trust the output a lot more than we can.

if this change works for your circumstances, i'll go ahead and commit it
Comment 5 Sergei Trofimovich (RETIRED) gentoo-dev 2010-08-23 04:29:45 UTC
(In reply to comment #4)
> thinking about it some more, i think it'll get other targets incorrect as well.
>  for example, arm6-xxx probably means the ARM6 family which is of the
> architecture ARMv3.  the ARM naming convention is just way too f-ed up to make
> this an "opt-out" glob.

Ugh, I messed things even worse in initial patch then.

> perhaps the only safe way to handle this is:
> +               armv[4-9]*b*) machine="armv4 -DB_ENDIAN";;
> +               armv[4-9]*)   machine="armv4 -DL_ENDIAN";;
> +               arm*b*)       machine="generic32 -DB_ENDIAN";;
> +               arm*)         machine="generic32 -DL_ENDIAN";;
> 
> the openssl config itself does the opposite, but they're comparing against
> `uname -m`, so they can trust the output a lot more than we can.
> 
> if this change works for your circumstances, i'll go ahead and commit it
> 

Yes, it works:

Operating system: armv5tel-whatever-linux2
Configuring for linux-armv4
 * Use configuration linux-armv4 -DL_ENDIAN
Comment 6 SpanKY gentoo-dev 2010-08-23 06:02:16 UTC
i glanced through the source and noticed that there also seems to be a new s390x target, so i added that on top of bfin/avr and these arm changes.  thanks for testing.