Skip to contentSkip to conversation

gtest: fix usage on ARM platforms

PATCH New Carlos Santos 2 participants 4 messages Apr 19, 2017 – Apr 20, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gtest: fix usage on ARM platforms

Ensure that GTest is compiled with -fPIC to allow linking the static libraries with dynamically linked programs. This is not a requirement for most architectures but is mandatory for ARM.

---
 package/gtest/gtest.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/gtest/gtest.mk +7 -0
index 329179d..dc43597 100644
@@ -37,6 +37,13 @@ HOST_GTEST_GMOCK_PYTHONPATH = \
 # the gtest sources.
 GTEST_CONF_OPTS = -DBUILD_SHARED_LIBS=OFF
 
+# Ensure that GTest is compiled with -fPIC to allow linking the static
+# libraries with dynamically linked programs. This is not a requirement
+# for most architectures but is mandatory for ARM.
+ifeq ($(BR2_STATIC_LIBS),)
+GTEST_CONF_OPTS += -DCMAKE_POSITION_INDEPENDENT_CODE=ON
+endif
+
 GTEST_CONF_OPTS += -DBUILD_GTEST=ON
 
 ifeq ($(BR2_PACKAGE_GTEST_GMOCK),y)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 gtest: fix usage on ARM platforms

Hello,

Quoted 5 lines · Carlos Santos

Ensure that GTest is compiled with -fPIC to allow linking the static libraries with dynamically linked programs. This is not a requirement for most architectures but is mandatory for ARM.

Is this fixing an autobuilder issue? If so, the reference to the autobuilder failure should be included in the commit log.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 gtest: fix usage on ARM platforms

Quoted 9 lines

From: "Thomas Petazzoni" <[email protected]>
To: "Carlos Santos" <[email protected]>
Cc: buildroot at buildroot.org
Sent: Wednesday, April 19, 2017 9:33:31 AM
Subject: Re: [Buildroot] [PATCH] gtest: fix usage on ARM platforms

Hello,

On Wed, 19 Apr 2017 08:51:52 -0300, Carlos Santos wrote:

Quoted 8 lines
Quoted 5 lines

Ensure that GTest is compiled with -fPIC to allow linking the static libraries with dynamically linked programs. This is not a requirement for most architectures but is mandatory for ARM.

Is this fixing an autobuilder issue? If so, the reference to the autobuilder failure should be included in the commit log.

It was observed during a local build of one of our products which has an ARM Cortex-A9 processor.

Signature · 4 lines
Carlos Santos (Casantos) - DATACOM, P&D
?The greatest triumph that modern PR can offer is the transcendent 
success of having your words and actions judged by your reputation, 
rather than the other way about.? ? Christopher Hitchens
#3 lore raw

PATCH 1/1 gtest: fix usage on ARM platforms

In reply to Carlos Santos

Hello,

Quoted 8 lines · Carlos Santos

Ensure that GTest is compiled with -fPIC to allow linking the static libraries with dynamically linked programs. This is not a requirement for most architectures but is mandatory for ARM.

---
 package/gtest/gtest.mk | 7 +++++++
 1 file changed, 7 insertions(+)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com