Skip to contentSkip to conversation

infra/Makefile.in: Fix format_arg issues after bump gettext-tiny to c6dcdcd

PATCH New Vadim Kochan 2 participants 6 messages Apr 4, 2019 – Apr 7, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 infra/Makefile.in: Fix format_arg issues after bump gettext-tiny to c6dcdcd

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.

---
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(+)
package/Makefile.in +6 -0
index dc818a2c18..c719d39235 100644
@@ -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)
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/1 infra/Makefile.in: Fix format_arg issues after bump gettext-tiny to c6dcdcd

Hi All,

Quoted 44 lines · Vadim Kochan

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.

---
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(+)
package/Makefile.in +6 -0
index dc818a2c18..c719d39235 100644
@@ -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)
Signature · 1 line
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

#2 lore raw

PATCH 1/1 infra/Makefile.in: Fix format_arg issues after bump gettext-tiny to c6dcdcd

Vadim, All,

On 2019-04-05 02:05 +0300, Vadim Kochan spake thusly:

Quoted 6 lines · Vadim Kochan
Quoted 5 lines

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
Quoted 8 lines
Quoted 8 lines

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

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

Quoted 2 lines

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.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/1 infra/Makefile.in: Fix format_arg issues after bump gettext-tiny to c6dcdcd

Vadim, All,

On 2019-04-06 22:53 +0200, Yann E. MORIN spake thusly:

Quoted 15 lines

On 2019-04-05 02:05 +0300, Vadim Kochan spake thusly:

Quoted 6 lines · Vadim Kochan
Quoted 5 lines

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
Quoted 8 lines
Quoted 8 lines

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

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

Quoted 8 lines

[--SNIP--]

Quoted 2 lines

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.

Quoted 18 lines

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

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

Regards,
Yann E. MORIN.

Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  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
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH 1/1 infra/Makefile.in: Fix format_arg issues after bump gettext-tiny to c6dcdcd

Hi Yann, All

Quoted 30 lines · Yann E. MORIN

Vadim, All,

On 2019-04-06 22:53 +0200, Yann E. MORIN spake thusly:

Quoted 15 lines

On 2019-04-05 02:05 +0300, Vadim Kochan spake thusly:

Quoted 6 lines · Vadim Kochan
Quoted 5 lines

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
Quoted 8 lines
Quoted 8 lines

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

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

Quoted 8 lines

[--SNIP--]

Quoted 2 lines

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.

Quoted 13 lines

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

Forget what I said.

Regards,
Yann E. MORIN.

Quoted 6 lines

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

#5 lore raw

PATCH 1/1 infra/Makefile.in: Fix format_arg issues after bump gettext-tiny to c6dcdcd

Vadim, All,

On 2019-04-07 00:24 +0300, Vadim Kochan spake thusly:

Quoted 7 lines · Yann E. MORIN
Quoted 6 lines

On 2019-04-06 22:53 +0200, Yann E. MORIN spake thusly:

Quoted 5 lines

On 2019-04-05 02:05 +0300, Vadim Kochan spake thusly:

Quoted 4 lines · Vadim Kochan
Quoted 3 lines

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.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'