Skip to contentSkip to conversation

core: override the user's locale while setting HOSTARCH

PATCH New Romain Naour 3 participants 3 messages Jan 20, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 core: override the user's locale while setting HOSTARCH

At least with French user's locale HOSTARCH is empty since 'Target' is not present in gcc output.

gcc -v 2>&1
Utilisation des specs internes.
COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/lto-wrapper Cible : x86_64-redhat-linux

Override the user's local with LC_ALL=C.

Cc "Yann E. MORIN" <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 2e09611..17c181b 100644
@@ -297,7 +297,7 @@ export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE
 # So, we extract the first part of the tuple the host gcc was
 # configured to generate code for; we assume this is our userland.
 #
-export HOSTARCH := $(shell $(HOSTCC_NOCCACHE) -v 2>&1 | \
+export HOSTARCH := $(shell LC_ALL=C $(HOSTCC_NOCCACHE) -v 2>&1 | \
 	sed -e '/^Target: \([^-]*\).*/!d' \
 	    -e 's//\1/' \
 	    -e 's/i.86/x86/' \
Signature · 1 line
2.4.3
#1 lore raw

PATCH 1/1 core: override the user's locale while setting HOSTARCH

Romain, All,

On 2016-01-20 22:53 +0100, Romain Naour spake thusly:

Quoted 9 lines

At least with French user's locale HOSTARCH is empty since 'Target' is not present in gcc output.

gcc -v 2>&1
Utilisation des specs internes.
COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/lto-wrapper Cible : x86_64-redhat-linux

Quoted 5 lines

Override the user's local with LC_ALL=C.

Cc "Yann E. MORIN" <[email protected]>
Cc Thomas Petazzoni <[email protected]>

Regards,
Yann E. MORIN.

Quoted 20 lines
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 2e09611..17c181b 100644
@@ -297,7 +297,7 @@ export HOSTCC_NOCCACHE HOSTCXX_NOCCACHE
 # So, we extract the first part of the tuple the host gcc was
 # configured to generate code for; we assume this is our userland.
 #
-export HOSTARCH := $(shell $(HOSTCC_NOCCACHE) -v 2>&1 | \
+export HOSTARCH := $(shell LC_ALL=C $(HOSTCC_NOCCACHE) -v 2>&1 | \
 	sed -e '/^Target: \([^-]*\).*/!d' \
 	    -e 's//\1/' \
 	    -e 's/i.86/x86/' \
Signature · 1 line
2.4.3
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 core: override the user's locale while setting HOSTARCH

In reply to Romain Naour

Dear Romain Naour,

Quoted 9 lines · Romain Naour

At least with French user's locale HOSTARCH is empty since 'Target' is not present in gcc output.

gcc -v 2>&1
Utilisation des specs internes.
COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/lto-wrapper Cible : x86_64-redhat-linux

Quoted 8 lines

Override the user's local with LC_ALL=C.

Cc "Yann E. MORIN" <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Thomas

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