All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2] gnupg2: fix linking with intl
@ 2014-12-11 12:06 Vicente Olivert Riera
  2014-12-11 18:53 ` Thomas Petazzoni
  0 siblings, 1 reply; 7+ messages in thread
From: Vicente Olivert Riera @ 2014-12-11 12:06 UTC (permalink / raw)
  To: buildroot

gnupg2 needs to link with intl if the gettext package is selected.
Otherwise we will see an error like this one:

libgpg-error.a(libgpg_error_la-strsource.o): In function
`gpg_strsource':
strsource.c:(.text+0x4c): undefined reference to `libintl_dgettext'

Fixes:
  http://autobuild.buildroot.net/results/9aa/9aaca74dd3a1f82e12358530db4d5d17eb833f7f/

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
---
Changes v1 -> v2:
- Remove "select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE" 
  from Config.in
- Replace $(BR2_NEEDS_GETTEXT_IF_LOCALE) with $(BR2_PACKAGE_GETTEXT)
- Amend the commit message according to the new changes

 package/gnupg2/gnupg2.mk |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/package/gnupg2/gnupg2.mk b/package/gnupg2/gnupg2.mk
index 2d133aa..69c510e 100644
--- a/package/gnupg2/gnupg2.mk
+++ b/package/gnupg2/gnupg2.mk
@@ -20,6 +20,11 @@ GNUPG2_CONF_OPTS = \
 	--with-pth-prefix=$(STAGING_DIR)/usr
 GNUPG2_CONF_ENV = gl_cv_header_working_stdint_h=yes
 
+ifeq ($(BR2_PACKAGE_GETTEXT),y)
+GNUPG2_DEPENDENCIES += gettext
+GNUPG2_CONF_ENV += LIBS=-lintl
+endif
+
 ifneq ($(BR2_PACKAGE_GNUPG2_GPGV2),y)
 define GNUPG2_REMOVE_GPGV2
 	rm -f $(TARGET_DIR)/usr/bin/gpgv2
-- 
1.7.1

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

* [Buildroot] [PATCH v2] gnupg2: fix linking with intl
  2014-12-11 12:06 [Buildroot] [PATCH v2] gnupg2: fix linking with intl Vicente Olivert Riera
@ 2014-12-11 18:53 ` Thomas Petazzoni
  2014-12-12 15:28   ` Vicente Olivert Riera
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2014-12-11 18:53 UTC (permalink / raw)
  To: buildroot

Dear Vicente Olivert Riera,

On Thu, 11 Dec 2014 12:06:51 +0000, Vicente Olivert Riera wrote:

> +ifeq ($(BR2_PACKAGE_GETTEXT),y)
> +GNUPG2_DEPENDENCIES += gettext
> +GNUPG2_CONF_ENV += LIBS=-lintl

Are you sure we need this LIBS part when glibc is used?

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

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

* [Buildroot] [PATCH v2] gnupg2: fix linking with intl
  2014-12-11 18:53 ` Thomas Petazzoni
@ 2014-12-12 15:28   ` Vicente Olivert Riera
  2014-12-17  8:57     ` Thomas Petazzoni
  0 siblings, 1 reply; 7+ messages in thread
From: Vicente Olivert Riera @ 2014-12-12 15:28 UTC (permalink / raw)
  To: buildroot

On 12/11/2014 06:53 PM, Thomas Petazzoni wrote:
> Dear Vicente Olivert Riera,
> 
> On Thu, 11 Dec 2014 12:06:51 +0000, Vicente Olivert Riera wrote:
> 
>> +ifeq ($(BR2_PACKAGE_GETTEXT),y)
>> +GNUPG2_DEPENDENCIES += gettext
>> +GNUPG2_CONF_ENV += LIBS=-lintl
> 
> Are you sure we need this LIBS part when glibc is used?

Uhm..., something must have changed in the tree and right now I'm not
able to reproduce this failure even using the same config file :/

http://autobuild.buildroot.net/results/9aa/9aaca74dd3a1f82e12358530db4d5d17eb833f7f/config

-- 
Vicente Olivert Riera
Graduate Software Engineer, MIPS Platforms
Imagination Technologies Limited
t: +44 (0)113 2429814
www.imgtec.com

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

* [Buildroot] [PATCH v2] gnupg2: fix linking with intl
  2014-12-12 15:28   ` Vicente Olivert Riera
@ 2014-12-17  8:57     ` Thomas Petazzoni
  2015-01-05 14:04       ` Vicente Olivert Riera
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2014-12-17  8:57 UTC (permalink / raw)
  To: buildroot

Dear Vicente Olivert Riera,

On Fri, 12 Dec 2014 15:28:24 +0000, Vicente Olivert Riera wrote:
> On 12/11/2014 06:53 PM, Thomas Petazzoni wrote:
> > Dear Vicente Olivert Riera,
> > 
> > On Thu, 11 Dec 2014 12:06:51 +0000, Vicente Olivert Riera wrote:
> > 
> >> +ifeq ($(BR2_PACKAGE_GETTEXT),y)
> >> +GNUPG2_DEPENDENCIES += gettext
> >> +GNUPG2_CONF_ENV += LIBS=-lintl
> > 
> > Are you sure we need this LIBS part when glibc is used?
> 
> Uhm..., something must have changed in the tree and right now I'm not
> able to reproduce this failure even using the same config file :/
> 
> http://autobuild.buildroot.net/results/9aa/9aaca74dd3a1f82e12358530db4d5d17eb833f7f/config

This problem was related to static linking, but the
BR2_PREFER_STATIC_LIB option has been renamed to BR2_STATIC_LIBS (with
a bogus Config.in.legacy handling done by me). So if you took the old
config file, BR2_PREFER_STATIC_LIB was discarded, and you were doing a
shared library build instead of a static library build, which explains
why the problem was not appearing anymore.

Best regards,

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

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

* [Buildroot] [PATCH v2] gnupg2: fix linking with intl
  2014-12-17  8:57     ` Thomas Petazzoni
@ 2015-01-05 14:04       ` Vicente Olivert Riera
  2015-01-05 15:37         ` Thomas Petazzoni
  0 siblings, 1 reply; 7+ messages in thread
From: Vicente Olivert Riera @ 2015-01-05 14:04 UTC (permalink / raw)
  To: buildroot

On 12/17/2014 08:57 AM, Thomas Petazzoni wrote:
> Dear Vicente Olivert Riera,
> 
> On Fri, 12 Dec 2014 15:28:24 +0000, Vicente Olivert Riera wrote:
>> On 12/11/2014 06:53 PM, Thomas Petazzoni wrote:
>>> Dear Vicente Olivert Riera,
>>>
>>> On Thu, 11 Dec 2014 12:06:51 +0000, Vicente Olivert Riera wrote:
>>>
>>>> +ifeq ($(BR2_PACKAGE_GETTEXT),y)
>>>> +GNUPG2_DEPENDENCIES += gettext
>>>> +GNUPG2_CONF_ENV += LIBS=-lintl
>>>
>>> Are you sure we need this LIBS part when glibc is used?
>>
>> Uhm..., something must have changed in the tree and right now I'm not
>> able to reproduce this failure even using the same config file :/
>>
>> http://autobuild.buildroot.net/results/9aa/9aaca74dd3a1f82e12358530db4d5d17eb833f7f/config
> 
> This problem was related to static linking, but the
> BR2_PREFER_STATIC_LIB option has been renamed to BR2_STATIC_LIBS (with
> a bogus Config.in.legacy handling done by me). So if you took the old
> config file, BR2_PREFER_STATIC_LIB was discarded, and you were doing a
> shared library build instead of a static library build, which explains
> why the problem was not appearing anymore.

You were right. So now I was able to reproduce the problem, and taking
into account that it only happens for static builds, I think I could
change the patch to be like this:

ifeq ($(BR2_PACKAGE_GETTEXT),y)
GNUPG2_DEPENDENCIES += gettext
ifneq ($(BR2_SHARED_LIBS),y)
GNUPG2_CONF_ENV += LIBS=-lintl
endif
endif

What do you think?

Regards,
-- 
Vicente Olivert Riera
Graduate Software Engineer, MIPS Platforms
Imagination Technologies Limited
t: +44 (0)113 2429814
www.imgtec.com

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

* [Buildroot] [PATCH v2] gnupg2: fix linking with intl
  2015-01-05 14:04       ` Vicente Olivert Riera
@ 2015-01-05 15:37         ` Thomas Petazzoni
  2015-01-05 16:12           ` Vicente Olivert Riera
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2015-01-05 15:37 UTC (permalink / raw)
  To: buildroot

Dear Vicente Olivert Riera,

On Mon, 5 Jan 2015 14:04:42 +0000, Vicente Olivert Riera wrote:

> > This problem was related to static linking, but the
> > BR2_PREFER_STATIC_LIB option has been renamed to BR2_STATIC_LIBS (with
> > a bogus Config.in.legacy handling done by me). So if you took the old
> > config file, BR2_PREFER_STATIC_LIB was discarded, and you were doing a
> > shared library build instead of a static library build, which explains
> > why the problem was not appearing anymore.
> 
> You were right. So now I was able to reproduce the problem, and taking
> into account that it only happens for static builds, I think I could
> change the patch to be like this:
> 
> ifeq ($(BR2_PACKAGE_GETTEXT),y)
> GNUPG2_DEPENDENCIES += gettext
> ifneq ($(BR2_SHARED_LIBS),y)
> GNUPG2_CONF_ENV += LIBS=-lintl
> endif
> endif
> 
> What do you think?

I don't remember the entire context. Do you have a minimal defconfig
that exhibits the problem?

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

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

* [Buildroot] [PATCH v2] gnupg2: fix linking with intl
  2015-01-05 15:37         ` Thomas Petazzoni
@ 2015-01-05 16:12           ` Vicente Olivert Riera
  0 siblings, 0 replies; 7+ messages in thread
From: Vicente Olivert Riera @ 2015-01-05 16:12 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On 01/05/2015 03:37 PM, Thomas Petazzoni wrote:
> Dear Vicente Olivert Riera,
> 
> On Mon, 5 Jan 2015 14:04:42 +0000, Vicente Olivert Riera wrote:
> 
>>> This problem was related to static linking, but the
>>> BR2_PREFER_STATIC_LIB option has been renamed to BR2_STATIC_LIBS (with
>>> a bogus Config.in.legacy handling done by me). So if you took the old
>>> config file, BR2_PREFER_STATIC_LIB was discarded, and you were doing a
>>> shared library build instead of a static library build, which explains
>>> why the problem was not appearing anymore.
>>
>> You were right. So now I was able to reproduce the problem, and taking
>> into account that it only happens for static builds, I think I could
>> change the patch to be like this:
>>
>> ifeq ($(BR2_PACKAGE_GETTEXT),y)
>> GNUPG2_DEPENDENCIES += gettext
>> ifneq ($(BR2_SHARED_LIBS),y)
>> GNUPG2_CONF_ENV += LIBS=-lintl
>> endif
>> endif
>>
>> What do you think?
> 
> I don't remember the entire context. Do you have a minimal defconfig
> that exhibits the problem?

Sure. Here you have it:

BR2_mipsel=y
BR2_STATIC_LIBS=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-mipsel-o32-full-2014.11.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_17=y
BR2_TOOLCHAIN_EXTERNAL_LARGEFILE=y
BR2_TOOLCHAIN_EXTERNAL_INET_IPV6=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_TOOLCHAIN_EXTERNAL_INET_RPC=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_TARGET_OPTIMIZATION="-pipe"
BR2_PACKAGE_GETTEXT=y
BR2_PACKAGE_GNUPG2=y

it fails for both BR2_STATIC_LIBS and BR2_SHARED_STATIC_LIBS. That's why
I proposed to use...

ifneq ($(BR2_SHARED_LIBS),y)

...in the patch.

Regards,
-- 
Vicente Olivert Riera
Graduate Software Engineer, MIPS Platforms
Imagination Technologies Limited
t: +44 (0)113 2429814
www.imgtec.com

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

end of thread, other threads:[~2015-01-05 16:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-11 12:06 [Buildroot] [PATCH v2] gnupg2: fix linking with intl Vicente Olivert Riera
2014-12-11 18:53 ` Thomas Petazzoni
2014-12-12 15:28   ` Vicente Olivert Riera
2014-12-17  8:57     ` Thomas Petazzoni
2015-01-05 14:04       ` Vicente Olivert Riera
2015-01-05 15:37         ` Thomas Petazzoni
2015-01-05 16:12           ` Vicente Olivert Riera

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.