All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] gtest: fix usage on ARM platforms
@ 2017-04-19 11:51 Carlos Santos
  2017-04-19 12:33 ` Thomas Petazzoni
  2017-04-20 20:32 ` Thomas Petazzoni
  0 siblings, 2 replies; 4+ messages in thread
From: Carlos Santos @ 2017-04-19 11:51 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 package/gtest/gtest.mk | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/package/gtest/gtest.mk b/package/gtest/gtest.mk
index 329179d..dc43597 100644
--- a/package/gtest/gtest.mk
+++ b/package/gtest/gtest.mk
@@ -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)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] gtest: fix usage on ARM platforms
  2017-04-19 11:51 [Buildroot] [PATCH] gtest: fix usage on ARM platforms Carlos Santos
@ 2017-04-19 12:33 ` Thomas Petazzoni
  2017-04-19 13:20   ` Carlos Santos
  2017-04-20 20:32 ` Thomas Petazzoni
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2017-04-19 12:33 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 19 Apr 2017 08:51:52 -0300, Carlos Santos wrote:
> 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.
> 
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>

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

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] gtest: fix usage on ARM platforms
  2017-04-19 12:33 ` Thomas Petazzoni
@ 2017-04-19 13:20   ` Carlos Santos
  0 siblings, 0 replies; 4+ messages in thread
From: Carlos Santos @ 2017-04-19 13:20 UTC (permalink / raw)
  To: buildroot

> From: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>
> To: "Carlos Santos" <casantos@datacom.ind.br>
> 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:
>> 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.
>> 
>> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> 
> 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.

-- 
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] gtest: fix usage on ARM platforms
  2017-04-19 11:51 [Buildroot] [PATCH] gtest: fix usage on ARM platforms Carlos Santos
  2017-04-19 12:33 ` Thomas Petazzoni
@ 2017-04-20 20:32 ` Thomas Petazzoni
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2017-04-20 20:32 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 19 Apr 2017 08:51:52 -0300, Carlos Santos wrote:
> 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.
> 
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> ---
>  package/gtest/gtest.mk | 7 +++++++
>  1 file changed, 7 insertions(+)

Applied to master, thanks.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-04-20 20:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-19 11:51 [Buildroot] [PATCH] gtest: fix usage on ARM platforms Carlos Santos
2017-04-19 12:33 ` Thomas Petazzoni
2017-04-19 13:20   ` Carlos Santos
2017-04-20 20:32 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.