Skip to contentSkip to conversation

openssl: Fix build on ARM with GCC 4.6.x

PATCH New Ismael Luceno 4 participants 10 messages Feb 29, 2012 – Mar 6, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 openssl: Fix build on ARM with GCC 4.6.x

---
 package/openssl/openssl.mk |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
package/openssl/openssl.mk +7 -0
index cb29fe4..fda935a 100644
@@ -9,7 +9,14 @@ OPENSSL_SITE = http://www.openssl.org/source
 OPENSSL_INSTALL_STAGING = YES
 OPENSSL_DEPENDENCIES = zlib
 OPENSSL_TARGET_ARCH = generic32
+
+ifeq ($(BR2_GCC_VERSION_4_6_X)-$(ARCH),y-arm)
+# workaround for gcc issue
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48308
+OPENSSL_CFLAGS = $(subst -Os,-O2,$(TARGET_CFLAGS))
+else
 OPENSSL_CFLAGS = $(TARGET_CFLAGS)
+endif
 
 ifeq ($(BR2_PACKAGE_OPENSSL_OCF),y)
 OPENSSL_CFLAGS += -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS
Signature · 1 line
1.7.9.1
#1 lore raw

PATCH 2/2 openssl: Add -march and -mcpu flags

---
 package/openssl/openssl.mk |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
package/openssl/openssl.mk +2 -0
index fda935a..c228458 100644
@@ -18,6 +18,8 @@ else
 OPENSSL_CFLAGS = $(TARGET_CFLAGS)
 endif
 
+OPENSSL_CFLAGS += -march=$(BR2_GCC_TARGET_ARCH) -mcpu=$(BR2_GCC_TARGET_TUNE)
+
 ifeq ($(BR2_PACKAGE_OPENSSL_OCF),y)
 OPENSSL_CFLAGS += -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS
 
Signature · 1 line
1.7.9.1
#2 lore raw

PATCH 1/2 openssl: Fix build on ARM with GCC 4.6.x

In reply to Ismael Luceno

Hi Ismael,

Quoted 12 lines · Ismael Luceno
---
 package/openssl/openssl.mk |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
package/openssl/openssl.mk +0 -0
index cb29fe4..fda935a 100644
@@ -9,7 +9,14 @@ OPENSSL_SITE = http://www.openssl.org/source
 OPENSSL_INSTALL_STAGING = YES

package/openssl/openssl.mk OPENSSL_SITE = http://www.openssl.org/source · line 19

Quoted 10 lines
package/openssl/openssl.mk +7 -0
 OPENSSL_DEPENDENCIES = zlib
 OPENSSL_TARGET_ARCH = generic32
+
+ifeq ($(BR2_GCC_VERSION_4_6_X)-$(ARCH),y-arm)
+# workaround for gcc issue
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48308
+OPENSSL_CFLAGS = $(subst -Os,-O2,$(TARGET_CFLAGS))
+else
 OPENSSL_CFLAGS = $(TARGET_CFLAGS)
+endif

Will this work for external and ct-ng toolchains?

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#3 lore raw

PATCH 1/2 openssl: Fix build on ARM with GCC 4.6.x

Le Thu, 1 Mar 2012 07:37:27 +0200,
Baruch Siach <[email protected]> a ?crit :

Quoted 1 line

Will this work for external and ct-ng toolchains?

No. For the external and ct-ng toolchains, we have no way of testing the gcc version through BR2_* variables, we could only do it by running the cross gcc itself and checking its version number.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

PATCH 1/2 openssl: Fix build on ARM with GCC 4.6.x

In reply to Baruch Siach
Quoted 28 lines · On Thu, 1 Mar 2012 07:37:27 +0200 Baruch Siach <[email protected]> wrote:

Hi Ismael,

Quoted 12 lines · Ismael Luceno
---
 package/openssl/openssl.mk |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
package/openssl/openssl.mk +0 -0
index cb29fe4..fda935a 100644
@@ -9,7 +9,14 @@ OPENSSL_SITE = http://www.openssl.org/source
 OPENSSL_INSTALL_STAGING = YES

package/openssl/openssl.mk OPENSSL_SITE = http://www.openssl.org/source · line 19

Quoted 10 lines
package/openssl/openssl.mk +7 -0
 OPENSSL_DEPENDENCIES = zlib
 OPENSSL_TARGET_ARCH = generic32
+
+ifeq ($(BR2_GCC_VERSION_4_6_X)-$(ARCH),y-arm)
+# workaround for gcc issue
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48308
+OPENSSL_CFLAGS = $(subst -Os,-O2,$(TARGET_CFLAGS))
+else
 OPENSSL_CFLAGS = $(TARGET_CFLAGS)
+endif

Will this work for external and ct-ng toolchains?

Quoted 2 lines

baruch

As long as you set BR2_GCC_VERSION_4_6_X manually...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120301/c8b6a728/attachment.asc>

#5 lore raw

PATCH 1/2 openssl: Fix build on ARM with GCC 4.6.x

Hi Ismael,

Quoted 28 lines · Ismael Luceno
Quoted 26 lines · On Thu, 1 Mar 2012 07:37:27 +0200 Baruch Siach <[email protected]> wrote:
Quoted 12 lines · Ismael Luceno
---
 package/openssl/openssl.mk |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
package/openssl/openssl.mk +0 -0
index cb29fe4..fda935a 100644
@@ -9,7 +9,14 @@ OPENSSL_SITE = http://www.openssl.org/source
 OPENSSL_INSTALL_STAGING = YES

package/openssl/openssl.mk OPENSSL_SITE = http://www.openssl.org/source · line 19

Quoted 10 lines
package/openssl/openssl.mk +7 -0
 OPENSSL_DEPENDENCIES = zlib
 OPENSSL_TARGET_ARCH = generic32
+
+ifeq ($(BR2_GCC_VERSION_4_6_X)-$(ARCH),y-arm)
+# workaround for gcc issue
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48308
+OPENSSL_CFLAGS = $(subst -Os,-O2,$(TARGET_CFLAGS))
+else
 OPENSSL_CFLAGS = $(TARGET_CFLAGS)
+endif

Will this work for external and ct-ng toolchains?

Quoted 3 lines
Quoted 1 line

baruch

As long as you set BR2_GCC_VERSION_4_6_X manually...

But BR2_GCC_VERSION_4_6_X is only available when selecting internal toolchains. See toolchain/toolchain-buildroot/Config.in.

Doesn't the patch from r183512 fix this bug?

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#6 lore raw

PATCH 1/2 openssl: Fix build on ARM with GCC 4.6.x

On Thu, 1 Mar 2012 20:10:32 +0200
Baruch Siach <[email protected]> wrote:
<...>

Quoted 2 lines

But BR2_GCC_VERSION_4_6_X is only available when selecting internal toolchains. See toolchain/toolchain-buildroot/Config.in.

Would setting it (on the command line) produce any side-effect?

Quoted 1 line

Doesn't the patch from r183512 fix this bug?

What is "r183512" supposed to mean?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120303/0f46aab0/attachment.asc>

#7 lore raw

PATCH 1/2 openssl: Fix build on ARM with GCC 4.6.x

Hi Ismael,

Quoted 5 lines · Ismael Luceno
Quoted 1 line · On Thu, 1 Mar 2012 20:10:32 +0200 Baruch Siach <[email protected]> wrote:

Doesn't the patch from r183512 fix this bug?

What is "r183512" supposed to mean?

This the Subversion commit mentioned in comment #20 of Bugzilla bug #48308 that you linked to (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48308).
Comment #21 seems to indicate that this fix hasn't been backported to gcc 4.6.x. Maybe a better solutions would be to add this patch Buildroot's internal gcc.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#8 lore raw

PATCH 1/2 openssl: Fix build on ARM with GCC 4.6.x

Quoted 9 lines · On Mon, 5 Mar 2012 07:19:37 +0200 Baruch Siach <[email protected]> wrote:
Quoted 5 lines · Ismael Luceno
Quoted 1 line · On Thu, 1 Mar 2012 20:10:32 +0200 Baruch Siach <[email protected]> wrote:

Doesn't the patch from r183512 fix this bug?

What is "r183512" supposed to mean?

This the Subversion commit mentioned in comment #20 of Bugzilla bug #48308 that you linked to

<...>

Oh, I thought you were talking about buildroot.

Quoted 2 lines

(http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48308). Comment #21 seems to indicate that this fix hasn't been backported to gcc 4.6.x.

Probably not hitting anytime soon.

Quoted 2 lines

Maybe a better solutions would be to add this patch Buildroot's internal gcc.

Indeed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120305/16c2119c/attachment.asc>

#9 lore raw

PATCH 1/2 openssl: Fix build on ARM with GCC 4.6.x

In reply to Baruch Siach
Quoted 19 lines · Baruch Siach

Hi Ismael,

Quoted 5 lines · Ismael Luceno
Quoted 1 line · On Thu, 1 Mar 2012 20:10:32 +0200 Baruch Siach <[email protected]> wrote:

Doesn't the patch from r183512 fix this bug?

What is "r183512" supposed to mean?

This the Subversion commit mentioned in comment #20 of Bugzilla bug #48308
that you linked to
(http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48308).
Comment #21 seems to indicate that this fix hasn't been backported to gcc
4.6.x. Maybe a better solutions would be to add this patch Buildroot's
internal gcc.

Quoted 1 line

baruch

+1 on fixing gcc, there's no business in touching openssl and possibly breaking it on some other scenario because of this. Regards.