Bug 497 - OpenSSL RSA key generation hangs on x86_64
Summary: OpenSSL RSA key generation hangs on x86_64
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-29 14:23 UTC by Floris Bos
Modified: 2009-07-29 19:51 UTC (History)
1 user (show)

See Also:
Host:
Target: x86_64
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Floris Bos 2009-07-29 14:23:51 UTC
OpenSSL ends up in an endless 100% CPU loop when generating keys on x86_64.

E.g. when running "openssh" for the first time, or executing "openssl genrsa"


It seems that the openssl library buildroot produces includes code for 32-bit systems, and does not work properly on x86_64.

In openssl.mk It tests for BR2_ARCH:

==
OPENSSL_TARGET_ARCH=generic32

[...]

ifeq ($(BR2_ARCH),x86_64)
OPENSSL_TARGET_ARCH=x86_64
endif
==

Not sure why, but this does not seem to work, and OpenSSL always builds as "generic32"

If I use $(ARCH) instead, it does work properly and solves the key generation problem:

==
ifeq ($(ARCH),x86_64)
OPENSSL_TARGET_ARCH=x86_64
endif
==
Comment 1 Thomas Petazzoni 2009-07-29 15:07:30 UTC
You're right.

There are two solutions to fix the issue. The first solution is to use $(ARCH), as you suggested. ARCH is defined by project/Makefile.in. The second solution if to change the test to be

ifeq ($(BR2_ARCH),"x86_64")

note the double quotes around x86_64.

Not sure which one is best, though.
Comment 2 Peter Korsgaard 2009-07-29 19:15:36 UTC
It's because BR2_ARCH is a string value, so it contains " chars as well, E.G. the tests have to be written as:

ifeq ($(BR2_ARCH),"x86_64")
OPENSSL_TARGET_ARCH=x86_64
endif

I'll fix it in git - Thanks.
Comment 3 Peter Korsgaard 2009-07-29 19:51:37 UTC
Fixed in git (2a966bc) using ARCH