Skip to contentSkip to conversation

fix linker generated lists on non-C locales

PATCH New Pavel Herrmann 3 participants 13 messages Dec 2, 2012 – Dec 3, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix linker generated lists on non-C locales

Setting LC_COLLATE=C is not enough if LC_ALL=en_US.utf8. The result is a build that has no available commands. Setting LC_ALL=C for the generator script helps.

---
 helper.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
helper.mk +2 -2
index 79a1da0..2b75182 100644
@@ -35,7 +35,7 @@
 #    line. Next, append "@" at the end and print the line. Finally,
 #    append "~" at the end of line. This will make sense in conjunction
 #    with 6) and 7).
-# 7) Sort the lines. It is imperative to use LC_COLLATE=C here because
+# 7) Sort the lines. It is imperative to use LC_ALL=C here because
 #    with this, the "\a" symbol is first and "~" symbol is last. Any
 #    other symbols fall inbetween. Symbols like "@", which marks the
 #    end of current line (representing current section) and ".", which
@@ -57,7 +57,7 @@ $(1): $(2)
 		-e 's/\.[^\.]\+$$$$//' \
 		-e ':s /^.\+$$$$/ { p;s/^\(.*\)\.[^\.]*$$$$/\1/;b s }' | \
 	sed -n -e 'h;s/$$$$/\a/p;g;s/$$$$/@/p;g;s/$$$$/~/p;' | \
-	LC_COLLATE=C sort -u | \
+	LC_ALL=C sort -u | \
 	sed -n -e '/\a$$$$/ { s/\./_/g;s/\a$$$$/__start = .;/p; }'\
 		-e '/~$$$$/ { s/\./_/g;s/~$$$$/__end = .;/p; }'\
 		-e '/@$$$$/ { s/\(.*\)@$$$$/*(SORT(\1.*));/p }' > $(1)
Signature · 1 line
1.7.12.4
#1 lore raw

PATCH 1/1 fix linker generated lists on non-C locales

Dear Pavel Herrmann,

Quoted 23 lines

Setting LC_COLLATE=C is not enough if LC_ALL=en_US.utf8. The result is a build that has no available commands. Setting LC_ALL=C for the generator script helps.

---
 helper.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
helper.mk +1 -1
index 79a1da0..2b75182 100644
@@ -35,7 +35,7 @@
 #    line. Next, append "@" at the end and print the line. Finally,
 #    append "~" at the end of line. This will make sense in conjunction
 #    with 6) and 7).
-# 7) Sort the lines. It is imperative to use LC_COLLATE=C here because
+# 7) Sort the lines. It is imperative to use LC_ALL=C here because
 #    with this, the "\a" symbol is first and "~" symbol is last. Any
 #    other symbols fall inbetween. Symbols like "@", which marks the
 #    end of current line (representing current section) and ".", which

helper.mk $(1): $(2) · line 60

Quoted 5 lines
helper.mk +1 -1
@@ -57,7 +57,7 @@ $(1): $(2)
 		-e 's/\.[^\.]\+$$$$//' \
 		-e ':s /^.\+$$$$/ { p;s/^\(.*\)\.[^\.]*$$$$/\1/;b s }' | \
 	sed -n -e 'h;s/$$$$/\a/p;g;s/$$$$/@/p;g;s/$$$$/~/p;' | \
-	LC_COLLATE=C sort -u | \
+	LC_ALL=C sort -u | \

How will this work? LC_COLLATE is supposed to adjust the behavior of "sort" command, without it, "sort" will not behave as expected.

Best regards,
Marek Vasut

#2 lore raw

PATCH 1/1 fix linker generated lists on non-C locales

Quoted 34 lines · On Sunday 02 of December 2012 18:50:53 Marek Vasut wrote:

Dear Pavel Herrmann,

Quoted 32 lines

Setting LC_COLLATE=C is not enough if LC_ALL=en_US.utf8. The result is a build that has no available commands. Setting LC_ALL=C for the generator script helps.

---

 helper.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
helper.mk +1 -1
index 79a1da0..2b75182 100644
@@ -35,7 +35,7 @@
 
 #    line. Next, append "@" at the end and print the line. Finally,
 #    append "~" at the end of line. This will make sense in conjunction
 #    with 6) and 7).
 
-# 7) Sort the lines. It is imperative to use LC_COLLATE=C here because
+# 7) Sort the lines. It is imperative to use LC_ALL=C here because
 
 #    with this, the "\a" symbol is first and "~" symbol is last. Any
 #    other symbols fall inbetween. Symbols like "@", which marks the
 #    end of current line (representing current section) and ".", which
helper.mk +0 -0
@@ -57,7 +57,7 @@ $(1): $(2)
 
 		-e 's/\.[^\.]\+$$$$//' \
 		-e ':s /^.\+$$$$/ { p;s/^\(.*\)\.[^\.]*$$$$/\1/;b s }' | \
 
Quoted 7 lines

helper.mk $(1): $(2) · line 60

Quoted 4 lines
helper.mk +1 -1
 	sed -n -e 'h;s/$$$$/\a/p;g;s/$$$$/@/p;g;s/$$$$/~/p;' | \
 
-	LC_COLLATE=C sort -u | \
+	LC_ALL=C sort -u | \

How will this work? LC_COLLATE is supposed to adjust the behavior of "sort" command, without it, "sort" will not behave as expected.

Clearly, LC_COLLATE is not enough for it to behave correctly, as seen on my setup.
This works because LC_ALL sets LC_COLLATE, as well as all other LC_* environment variables.

Pavel Herrmann

#3 lore raw

PATCH 1/1 fix linker generated lists on non-C locales

Dear Pavel Herrmann,

Quoted 43 lines · On Sunday 02 of December 2012 18:50:53 Marek Vasut wrote:
Quoted 34 lines

Dear Pavel Herrmann,

Quoted 32 lines

Setting LC_COLLATE=C is not enough if LC_ALL=en_US.utf8. The result is a build that has no available commands. Setting LC_ALL=C for the generator script helps.

---

 helper.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
helper.mk +1 -1
index 79a1da0..2b75182 100644
@@ -35,7 +35,7 @@
 
 #    line. Next, append "@" at the end and print the line. Finally,
 #    append "~" at the end of line. This will make sense in
 conjunction #    with 6) and 7).
 
-# 7) Sort the lines. It is imperative to use LC_COLLATE=C here because
+# 7) Sort the lines. It is imperative to use LC_ALL=C here because
 
 #    with this, the "\a" symbol is first and "~" symbol is last. Any
 #    other symbols fall inbetween. Symbols like "@", which marks the
 #    end of current line (representing current section) and ".", which
helper.mk +0 -0
@@ -57,7 +57,7 @@ $(1): $(2)
 
 		-e 's/\.[^\.]\+$$$$//' \
 		-e ':s /^.\+$$$$/ { p;s/^\(.*\)\.[^\.]*$$$$/\1/;b s }' | \
 
Quoted 7 lines

helper.mk $(1): $(2) · line 60

Quoted 4 lines
helper.mk +1 -1
 	sed -n -e 'h;s/$$$$/\a/p;g;s/$$$$/@/p;g;s/$$$$/~/p;' | \
 
-	LC_COLLATE=C sort -u | \
+	LC_ALL=C sort -u | \

How will this work? LC_COLLATE is supposed to adjust the behavior of "sort" command, without it, "sort" will not behave as expected.

Quoted 4 lines

Clearly, LC_COLLATE is not enough for it to behave correctly, as seen on my setup.
This works because LC_ALL sets LC_COLLATE, as well as all other LC_* environment variables.

Do you have any reference where I can verify this claim please?

Best regards,
Marek Vasut

#4 lore raw

PATCH 1/1 fix linker generated lists on non-C locales

Quoted 47 lines · On Sunday 02 of December 2012 19:12:17 Marek Vasut wrote:

Dear Pavel Herrmann,

Quoted 45 lines · On Sunday 02 of December 2012 18:50:53 Marek Vasut wrote:
Quoted 43 lines

Dear Pavel Herrmann,

Quoted 30 lines

Setting LC_COLLATE=C is not enough if LC_ALL=en_US.utf8. The result is a build that has no available commands. Setting LC_ALL=C for the generator script helps.

---

 helper.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
helper.mk +0 -1
index 79a1da0..2b75182 100644
@@ -35,7 +35,7 @@
 
 #    line. Next, append "@" at the end and print the line. Finally,
 #    append "~" at the end of line. This will make sense in
 conjunction #    with 6) and 7).
 
-# 7) Sort the lines. It is imperative to use LC_COLLATE=C here

because

helper.mk +1 -0
+# 7) Sort the lines. It is imperative to use LC_ALL=C here because
 
 #    with this, the "\a" symbol is first and "~" symbol is last. Any
 #    other symbols fall inbetween. Symbols like "@", which marks the
 #    end of current line (representing current section) and ".",
 which

helper.mk $(1): $(2) · line 63

Quoted 8 lines
helper.mk +1 -1
@@ -57,7 +57,7 @@ $(1): $(2)
 
 		-e 's/\.[^\.]\+$$$$//' \
 		-e ':s /^.\+$$$$/ { p;s/^\(.*\)\.[^\.]*$$$$/\1/;b s }' | \
 
 	sed -n -e 'h;s/$$$$/\a/p;g;s/$$$$/@/p;g;s/$$$$/~/p;' | \
 
-	LC_COLLATE=C sort -u | \
+	LC_ALL=C sort -u | \

How will this work? LC_COLLATE is supposed to adjust the behavior of "sort" command, without it, "sort" will not behave as expected.

Quoted 7 lines
Quoted 5 lines

Clearly, LC_COLLATE is not enough for it to behave correctly, as seen on my
setup.
This works because LC_ALL sets LC_COLLATE, as well as all other LC_* environment variables.

Do you have any reference where I can verify this claim please?

Which claim? that this helps, or that LC_ALL sets LC_COLLATE as well?

#5 lore raw

PATCH 1/1 fix linker generated lists on non-C locales

Dear Pavel Herrmann,

Quoted 35 lines · On Sunday 02 of December 2012 19:12:17 Marek Vasut wrote:
Quoted 34 lines

Dear Pavel Herrmann,

Quoted 32 lines · On Sunday 02 of December 2012 18:50:53 Marek Vasut wrote:
Quoted 31 lines

Dear Pavel Herrmann,

Quoted 29 lines

Setting LC_COLLATE=C is not enough if LC_ALL=en_US.utf8. The result is a build that has no available commands. Setting LC_ALL=C for the generator script helps.

---

 helper.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
helper.mk +0 -1
index 79a1da0..2b75182 100644
@@ -35,7 +35,7 @@
 
 #    line. Next, append "@" at the end and print the line.
 Finally, #    append "~" at the end of line. This will make sense
 in conjunction #    with 6) and 7).
 
-# 7) Sort the lines. It is imperative to use LC_COLLATE=C here

because
+# 7) Sort the lines. It is imperative to use LC_ALL=C here because

# with this, the "\a" symbol is first and "~" symbol is last.
Any # other symbols fall inbetween. Symbols like "@", which
marks the # end of current line (representing current section)
and ".", which

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

helper.mk $(1): $(2) · line 59

Quoted 4 lines
helper.mk +0 -0
@@ -57,7 +57,7 @@ $(1): $(2)
 
 		-e 's/\.[^\.]\+$$$$//' \
 		-e ':s /^.\+$$$$/ { p;s/^\(.*\)\.[^\.]*$$$$/\1/;b s }' | 

\

Quoted 15 lines
Quoted 15 lines
Quoted 14 lines
Quoted 8 lines

helper.mk $(1): $(2) · line 60

Quoted 5 lines
helper.mk +1 -1
 	sed -n -e 'h;s/$$$$/\a/p;g;s/$$$$/@/p;g;s/$$$$/~/p;' | \
 
-	LC_COLLATE=C sort -u | \
+	LC_ALL=C sort -u | \

How will this work? LC_COLLATE is supposed to adjust the behavior of "sort" command, without it, "sort" will not behave as expected.

Clearly, LC_COLLATE is not enough for it to behave correctly, as seen on my
setup.
This works because LC_ALL sets LC_COLLATE, as well as all other LC_* environment variables.

Quoted 3 lines
Quoted 1 line

Do you have any reference where I can verify this claim please?

Which claim? that this helps, or that LC_ALL sets LC_COLLATE as well?

You claim the following:

"This works because LC_ALL sets LC_COLLATE, as well as all other LC_* environment variables."

Where can I verify this? Do you have any link to any documentation?

Best regards,
Marek Vasut

#6 lore raw

PATCH 1/1 fix linker generated lists on non-C locales

Dear Marek Vasut,

Quoted 5 lines · In message <[email protected]> you wrote:

"This works because LC_ALL sets LC_COLLATE, as well as all other LC_* environment variables."

Where can I verify this? Do you have any link to any documentation?

Is it really so difficult to find TFM these days?

Try: man locale

...
LC_ALL If set to a non-empty string value, override the values of all the other internationalization variables.
...

Is this clear enough?

As mentioned before, if this variable is set, it can usually be considered a bug.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Life would be so much easier if we could  just  look  at  the  source
code.                                                   -- Dave Olson
#7 lore raw

PATCH 1/1 fix linker generated lists on non-C locales

In reply to Marek Vasut
Quoted 47 lines · On Sunday 02 of December 2012 19:12:17 Marek Vasut wrote:

Dear Pavel Herrmann,

Quoted 45 lines · On Sunday 02 of December 2012 18:50:53 Marek Vasut wrote:
Quoted 43 lines

Dear Pavel Herrmann,

Quoted 30 lines

Setting LC_COLLATE=C is not enough if LC_ALL=en_US.utf8. The result is a build that has no available commands. Setting LC_ALL=C for the generator script helps.

---

 helper.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
helper.mk +0 -1
index 79a1da0..2b75182 100644
@@ -35,7 +35,7 @@
 
 #    line. Next, append "@" at the end and print the line. Finally,
 #    append "~" at the end of line. This will make sense in
 conjunction #    with 6) and 7).
 
-# 7) Sort the lines. It is imperative to use LC_COLLATE=C here

because

helper.mk +1 -0
+# 7) Sort the lines. It is imperative to use LC_ALL=C here because
 
 #    with this, the "\a" symbol is first and "~" symbol is last. Any
 #    other symbols fall inbetween. Symbols like "@", which marks the
 #    end of current line (representing current section) and ".",
 which

helper.mk $(1): $(2) · line 63

Quoted 8 lines
helper.mk +1 -1
@@ -57,7 +57,7 @@ $(1): $(2)
 
 		-e 's/\.[^\.]\+$$$$//' \
 		-e ':s /^.\+$$$$/ { p;s/^\(.*\)\.[^\.]*$$$$/\1/;b s }' | \
 
 	sed -n -e 'h;s/$$$$/\a/p;g;s/$$$$/@/p;g;s/$$$$/~/p;' | \
 
-	LC_COLLATE=C sort -u | \
+	LC_ALL=C sort -u | \

How will this work? LC_COLLATE is supposed to adjust the behavior of "sort" command, without it, "sort" will not behave as expected.

Quoted 7 lines
Quoted 5 lines

Clearly, LC_COLLATE is not enough for it to behave correctly, as seen on my
setup.
This works because LC_ALL sets LC_COLLATE, as well as all other LC_* environment variables.

Do you have any reference where I can verify this claim please?

Actually, the problem seems to be a little different - when i have LC_ALL set, changing LC_COLLATE doesnt do anything (try running "LC_COLLATE=crazy locale" with LC_ALL set)
anyways, the fix remains the same.

Pavel Herrmann

#8 lore raw

PATCH 1/1 fix linker generated lists on non-C locales

Dear Pavel Herrmann,

[...]

Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
Quoted 5 lines

helper.mk $(1): $(2) · line 60

Quoted 2 lines
helper.mk +1 -1
-	LC_COLLATE=C sort -u | \
+	LC_ALL=C sort -u | \

How will this work? LC_COLLATE is supposed to adjust the behavior of "sort" command, without it, "sort" will not behave as expected.

Clearly, LC_COLLATE is not enough for it to behave correctly, as seen on my
setup.
This works because LC_ALL sets LC_COLLATE, as well as all other LC_* environment variables.

Quoted 6 lines
Quoted 1 line

Do you have any reference where I can verify this claim please?

Actually, the problem seems to be a little different - when i have LC_ALL set, changing LC_COLLATE doesnt do anything (try running "LC_COLLATE=crazy locale" with LC_ALL set)
anyways, the fix remains the same.

Ugh, can you please provide any relevant documentation? Besides, is the commit message wrong now?

Best regards,
Marek Vasut

#9 lore raw

PATCH 1/1 fix linker generated lists on non-C locales

In reply to Pavel Herrmann

Dear Pavel Herrmann,

Quoted 2 lines · In message <[email protected]> you…

Setting LC_COLLATE=C is not enough if LC_ALL=en_US.utf8. The result is a build that has no available commands. Setting LC_ALL=C for the generator script helps.

Setting LC_ALL is a pretty supid thing and can usually be considered a bug. Using it as suggested here brings us fromt he frying pan into the fire.

IMHO it would make more sense to just make sure that LC_ALL is not set at all, i. e. to explicitly unset it.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
       There is enough for the need of everyone in this world,
       but not for the greed of everyone.     - Mahatma Gandhi
#10 lore raw

PATCH 1/1 fix linker generated lists on non-C locales

Dear Wolfgang Denk,

Quoted 3 lines

Dear Pavel Herrmann,

In message <[email protected]> you

Quoted 10 lines · wrote:
Quoted 3 lines

Setting LC_COLLATE=C is not enough if LC_ALL=en_US.utf8. The result is a build that has no available commands. Setting LC_ALL=C for the generator script helps.

Setting LC_ALL is a pretty supid thing and can usually be considered a bug. Using it as suggested here brings us fromt he frying pan into the fire.

IMHO it would make more sense to just make sure that LC_ALL is not set at all, i. e. to explicitly unset it.

Hrm ... shall we introduce a patch that sanitizes the env then? Maybe we can fix the LDFLAGS/yocto issue that way too?

Best regards,
Marek Vasut

#11 lore raw

PATCH 1/1 fix linker generated lists on non-C locales

Dear Marek Vasut,

Quoted 6 lines · In message <[email protected]> you wrote:
Quoted 3 lines

IMHO it would make more sense to just make sure that LC_ALL is not set at all, i. e. to explicitly unset it.

Hrm ... shall we introduce a patch that sanitizes the env then? Maybe we can fix the LDFLAGS/yocto issue that way too?

Except for LC_ALL, what else do you have in mind?

I would leave out the LDFLAGS thing here; it is unrelated, and it bites also for all older versions of U-Boot, and we cannot fix the past.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
8 Catfish                                               = 1 Octo-puss
#12 lore raw

PATCH 1/1 fix linker generated lists on non-C locales

Dear Wolfgang Denk,

Quoted 10 lines

Dear Marek Vasut,

Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 2 lines

IMHO it would make more sense to just make sure that LC_ALL is not set at all, i. e. to explicitly unset it.

Hrm ... shall we introduce a patch that sanitizes the env then? Maybe we can fix the LDFLAGS/yocto issue that way too?

Except for LC_ALL, what else do you have in mind?

If that's the only issue, then only LC_ALL.

Quoted 3 lines

I would leave out the LDFLAGS thing here; it is unrelated, and it bites also for all older versions of U-Boot, and we cannot fix the past.

That's right.

Quoted 3 lines

Best regards,

Wolfgang Denk

Best regards,
Marek Vasut