All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] infra/Makefile.in: Fix format_arg issues after bump gettext-tiny to c6dcdcd
@ 2019-04-04 22:47 Vadim Kochan
  2019-04-04 23:05 ` Vadim Kochan
  0 siblings, 1 reply; 6+ messages in thread
From: Vadim Kochan @ 2019-04-04 22:47 UTC (permalink / raw)
  To: buildroot

After bump gettext-tiny to c6dcdcd there was change which enabled
gettext's macroses by default in:

    https://github.com/sabotage-linux/gettext-tiny/commit/58187329ad9f00eb8c39379e7ee0b608dd14bab8

it leads libglib2 to fail with format_arg issues. So fix it by disabling
these macroses and use rather external functions which requires linking.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
---
I dont feel like this is a good solution actually. I need to clearly understand
why just using gettext's macrosses does not work for libglib2. But anyway I am
sending this patch to show the possible solution.

 package/Makefile.in | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/Makefile.in b/package/Makefile.in
index dc818a2c18..c719d39235 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -159,6 +159,9 @@ TARGET_HARDENED += -D_FORTIFY_SOURCE=2
 endif
 
 TARGET_CPPFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+ifeq ($(BR2_SYSTEM_ENABLE_NLS),)
+TARGET_CPPFLAGS += -DLIBINTL_NO_MACROS=1
+endif
 TARGET_CFLAGS = $(TARGET_CPPFLAGS) $(TARGET_ABI) $(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) $(TARGET_HARDENED)
 TARGET_CXXFLAGS = $(TARGET_CFLAGS)
 TARGET_FCFLAGS = $(TARGET_ABI) $(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING)
@@ -220,6 +223,9 @@ UNZIP := $(shell which unzip || type -p unzip) -q
 APPLY_PATCHES = PATH=$(HOST_DIR)/bin:$$PATH support/scripts/apply-patches.sh $(if $(QUIET),-s)
 
 HOST_CPPFLAGS  = -I$(HOST_DIR)/include
+ifeq ($(BR2_SYSTEM_ENABLE_NLS),)
+HOST_CPPFLAGS += -DLIBINTL_NO_MACROS=1
+endif
 HOST_CFLAGS   ?= -O2
 HOST_CFLAGS   += $(HOST_CPPFLAGS)
 HOST_CXXFLAGS += $(HOST_CFLAGS)
-- 
2.14.1

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

* [Buildroot] [PATCH 1/1] infra/Makefile.in: Fix format_arg issues after bump gettext-tiny to c6dcdcd
  2019-04-04 22:47 [Buildroot] [PATCH 1/1] infra/Makefile.in: Fix format_arg issues after bump gettext-tiny to c6dcdcd Vadim Kochan
@ 2019-04-04 23:05 ` Vadim Kochan
  2019-04-06 20:53   ` Yann E. MORIN
  0 siblings, 1 reply; 6+ messages in thread
From: Vadim Kochan @ 2019-04-04 23:05 UTC (permalink / raw)
  To: buildroot

Hi All,

On Fri, Apr 05, 2019 at 01:47:00AM +0300, Vadim Kochan wrote:
> After bump gettext-tiny to c6dcdcd there was change which enabled
> gettext's macroses by default in:
> 
>     https://github.com/sabotage-linux/gettext-tiny/commit/58187329ad9f00eb8c39379e7ee0b608dd14bab8
> 
> it leads libglib2 to fail with format_arg issues. So fix it by disabling
> these macroses and use rather external functions which requires linking.
> 
> Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
> ---
> I dont feel like this is a good solution actually. I need to clearly understand
> why just using gettext's macrosses does not work for libglib2. But anyway I am
> sending this patch to show the possible solution.
> 
>  package/Makefile.in | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/package/Makefile.in b/package/Makefile.in
> index dc818a2c18..c719d39235 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -159,6 +159,9 @@ TARGET_HARDENED += -D_FORTIFY_SOURCE=2
>  endif
>  
>  TARGET_CPPFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
> +ifeq ($(BR2_SYSTEM_ENABLE_NLS),)
> +TARGET_CPPFLAGS += -DLIBINTL_NO_MACROS=1
> +endif
>  TARGET_CFLAGS = $(TARGET_CPPFLAGS) $(TARGET_ABI) $(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) $(TARGET_HARDENED)
>  TARGET_CXXFLAGS = $(TARGET_CFLAGS)
>  TARGET_FCFLAGS = $(TARGET_ABI) $(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING)
> @@ -220,6 +223,9 @@ UNZIP := $(shell which unzip || type -p unzip) -q
>  APPLY_PATCHES = PATH=$(HOST_DIR)/bin:$$PATH support/scripts/apply-patches.sh $(if $(QUIET),-s)
>  
>  HOST_CPPFLAGS  = -I$(HOST_DIR)/include
> +ifeq ($(BR2_SYSTEM_ENABLE_NLS),)
> +HOST_CPPFLAGS += -DLIBINTL_NO_MACROS=1
> +endif
>  HOST_CFLAGS   ?= -O2
>  HOST_CFLAGS   += $(HOST_CPPFLAGS)
>  HOST_CXXFLAGS += $(HOST_CFLAGS)
> -- 
> 2.14.1
> 

So issue is caused by libglib2 here:

    libglib2-2.56.4/gio/gunixconnection.c +566

with the code:

---------------8<------------------------------
560           g_set_error (error,
561                        G_IO_ERROR,
562                        G_IO_ERROR_FAILED,
563                        ngettext("Expecting 1 control message, got %d",
564                                 "Expecting 1 control message, got %d",
565                                 nscm),
566                        nscm);
567           goto out;
--------------->8------------------------------

so g_set_error takes formatted string which gcc does not like, but in
case of disabled INTL macrosses in gettext-tiny the declared functions
are used with special gcc attibutes which does not cause the issue.

I think that may be package/Makefile.in is not good place for this but
better to add another patch which will disable these macrosses ?

Regards,
Vadim Kochan

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

* [Buildroot] [PATCH 1/1] infra/Makefile.in: Fix format_arg issues after bump gettext-tiny to c6dcdcd
  2019-04-04 23:05 ` Vadim Kochan
@ 2019-04-06 20:53   ` Yann E. MORIN
  2019-04-06 21:05     ` Yann E. MORIN
  0 siblings, 1 reply; 6+ messages in thread
From: Yann E. MORIN @ 2019-04-06 20:53 UTC (permalink / raw)
  To: buildroot

Vadim, All,

On 2019-04-05 02:05 +0300, Vadim Kochan spake thusly:
> On Fri, Apr 05, 2019 at 01:47:00AM +0300, Vadim Kochan wrote:
> > After bump gettext-tiny to c6dcdcd there was change which enabled
> > gettext's macroses by default in:
> > 
> >     https://github.com/sabotage-linux/gettext-tiny/commit/58187329ad9f00eb8c39379e7ee0b608dd14bab8
> > 
> > it leads libglib2 to fail with format_arg issues. So fix it by disabling
> > these macroses and use rather external functions which requires linking.
> > 
> > Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
> > ---
> > I dont feel like this is a good solution actually. I need to clearly understand
> > why just using gettext's macrosses does not work for libglib2. But anyway I am
> > sending this patch to show the possible solution.
[--SNIP--]
> I think that may be package/Makefile.in is not good place for this but
> better to add another patch which will disable these macrosses ?

Indeed, I don;t think this is th3e correct fix.

Instead, I suggest we use what upstream did apply very recently:
    https://github.com/sabotage-linux/gettext-tiny/commit/73fc3e7ef7e016a3874b632fd0475969d288f309

Oh, wait, that name rings a bell... ;-)

Can you send a bump to gettext-tiny, now? ;-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 1/1] infra/Makefile.in: Fix format_arg issues after bump gettext-tiny to c6dcdcd
  2019-04-06 20:53   ` Yann E. MORIN
@ 2019-04-06 21:05     ` Yann E. MORIN
  2019-04-06 21:24       ` Vadim Kochan
  0 siblings, 1 reply; 6+ messages in thread
From: Yann E. MORIN @ 2019-04-06 21:05 UTC (permalink / raw)
  To: buildroot

Vadim, All,

On 2019-04-06 22:53 +0200, Yann E. MORIN spake thusly:
> On 2019-04-05 02:05 +0300, Vadim Kochan spake thusly:
> > On Fri, Apr 05, 2019 at 01:47:00AM +0300, Vadim Kochan wrote:
> > > After bump gettext-tiny to c6dcdcd there was change which enabled
> > > gettext's macroses by default in:
> > > 
> > >     https://github.com/sabotage-linux/gettext-tiny/commit/58187329ad9f00eb8c39379e7ee0b608dd14bab8
> > > 
> > > it leads libglib2 to fail with format_arg issues. So fix it by disabling
> > > these macroses and use rather external functions which requires linking.
> > > 
> > > Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
> > > ---
> > > I dont feel like this is a good solution actually. I need to clearly understand
> > > why just using gettext's macrosses does not work for libglib2. But anyway I am
> > > sending this patch to show the possible solution.
> [--SNIP--]
> > I think that may be package/Makefile.in is not good place for this but
> > better to add another patch which will disable these macrosses ?
> 
> Indeed, I don;t think this is th3e correct fix.
> 
> Instead, I suggest we use what upstream did apply very recently:
>     https://github.com/sabotage-linux/gettext-tiny/commit/73fc3e7ef7e016a3874b632fd0475969d288f309

Besides my usual typoes, I wsa mislead by the title of that patch. It
does not fix the actual issue we have.

Furthermore, we already have that patch in our tree anyway.

Forget what I said.

Regards,
Yann E. MORIN.

> Oh, wait, that name rings a bell... ;-)
> 
> Can you send a bump to gettext-tiny, now? ;-)
> 
> Regards,
> Yann E. MORIN.
> 
> -- 
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
> | +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
> '------------------------------^-------^------------------^--------------------'
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 1/1] infra/Makefile.in: Fix format_arg issues after bump gettext-tiny to c6dcdcd
  2019-04-06 21:05     ` Yann E. MORIN
@ 2019-04-06 21:24       ` Vadim Kochan
  2019-04-07  7:01         ` Yann E. MORIN
  0 siblings, 1 reply; 6+ messages in thread
From: Vadim Kochan @ 2019-04-06 21:24 UTC (permalink / raw)
  To: buildroot

Hi Yann, All

On Sat, Apr 06, 2019 at 11:05:16PM +0200, Yann E. MORIN wrote:
> Vadim, All,
> 
> On 2019-04-06 22:53 +0200, Yann E. MORIN spake thusly:
> > On 2019-04-05 02:05 +0300, Vadim Kochan spake thusly:
> > > On Fri, Apr 05, 2019 at 01:47:00AM +0300, Vadim Kochan wrote:
> > > > After bump gettext-tiny to c6dcdcd there was change which enabled
> > > > gettext's macroses by default in:
> > > > 
> > > >     https://github.com/sabotage-linux/gettext-tiny/commit/58187329ad9f00eb8c39379e7ee0b608dd14bab8
> > > > 
> > > > it leads libglib2 to fail with format_arg issues. So fix it by disabling
> > > > these macroses and use rather external functions which requires linking.
> > > > 
> > > > Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
> > > > ---
> > > > I dont feel like this is a good solution actually. I need to clearly understand
> > > > why just using gettext's macrosses does not work for libglib2. But anyway I am
> > > > sending this patch to show the possible solution.
> > [--SNIP--]
> > > I think that may be package/Makefile.in is not good place for this but
> > > better to add another patch which will disable these macrosses ?
> > 
> > Indeed, I don;t think this is th3e correct fix.
> > 
> > Instead, I suggest we use what upstream did apply very recently:
> >     https://github.com/sabotage-linux/gettext-tiny/commit/73fc3e7ef7e016a3874b632fd0475969d288f309
> 
> Besides my usual typoes, I wsa mislead by the title of that patch. It
> does not fix the actual issue we have.
> 
> Furthermore, we already have that patch in our tree anyway.
> 
> Forget what I said.
> 
> Regards,
> Yann E. MORIN.
> 
> > Oh, wait, that name rings a bell... ;-)
> > 
> > Can you send a bump to gettext-tiny, now? ;-)
> > 
> > Regards,
> > Yann E. MORIN.

Yes, today the sabotage maintainers applied my modified version of the
patch which is in buildroot tree, and yes this is a different issue.

But I am not sure if the package/Makefile.in is the righ place to fix
this new issue, may be better to add another patch into package/gettext-tiny
to disable these macrosses with simple '#if 0', because Makefile.in
should be more generic instead to keep package-specific fixes.

Regards,
Vadim Kochan

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

* [Buildroot] [PATCH 1/1] infra/Makefile.in: Fix format_arg issues after bump gettext-tiny to c6dcdcd
  2019-04-06 21:24       ` Vadim Kochan
@ 2019-04-07  7:01         ` Yann E. MORIN
  0 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2019-04-07  7:01 UTC (permalink / raw)
  To: buildroot

Vadim, All,

On 2019-04-07 00:24 +0300, Vadim Kochan spake thusly:
> On Sat, Apr 06, 2019 at 11:05:16PM +0200, Yann E. MORIN wrote:
> > On 2019-04-06 22:53 +0200, Yann E. MORIN spake thusly:
> > > On 2019-04-05 02:05 +0300, Vadim Kochan spake thusly:
> > > > On Fri, Apr 05, 2019 at 01:47:00AM +0300, Vadim Kochan wrote:
> > > > > After bump gettext-tiny to c6dcdcd there was change which enabled
> > > > > gettext's macroses by default in:
> > > > >     https://github.com/sabotage-linux/gettext-tiny/commit/58187329ad9f00eb8c39379e7ee0b608dd14bab8

Why not cary a revert of that commit, then?

Of course, a proper fix from upstream would be even better, but heck, at
least we could get back to a better situation for us...

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

end of thread, other threads:[~2019-04-07  7:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-04 22:47 [Buildroot] [PATCH 1/1] infra/Makefile.in: Fix format_arg issues after bump gettext-tiny to c6dcdcd Vadim Kochan
2019-04-04 23:05 ` Vadim Kochan
2019-04-06 20:53   ` Yann E. MORIN
2019-04-06 21:05     ` Yann E. MORIN
2019-04-06 21:24       ` Vadim Kochan
2019-04-07  7:01         ` Yann E. MORIN

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.