Commit a693bc5
[Xamarin.Android.Build.Tasks] Fix
Fixes: #7939
Context: dotnet/runtime#13363
Context: https://www.unicode.org/charts/PDF/U2200.pdf (page 2)
Context: 5271f3e
The LLVM IR generator (5271f3e) outputs a number of integer values,
relying on the standard `int.ToString()` method to convert the value
to a string. However, since .NET 6, this conversion is culture-
sensitive and in certain cultures (list below) it will output the
minus sign not as the "standard" ASCII \u002d character `-` but
instead as something else (see complete list below for details).
This breaks LLVM LLC:
llc: environment.arm64-v8a.ll:554:7: error: expected value token
stderr | i32 −1, ; apk_fd
Fix the problem by using invariant culture when converting ***all***
integers and unknown objects to strings. The reason all of them are
converted in this way is to avoid future changes to ICU and/or .NET
to-string conversion that might affect the resulting integer format.
Workaround: export `$LANG` to a locale that uses 0x2D `-` for
negation, e.g. `LANG=C`.
Locales/cultures affected by this issue are as follows:
* ARABIC LETTER MARK + HYPHEN-MINUS `-` (\u061c \u002d): 26 cultures
* ar
* ar-001
* ar-BH
* ar-DJ
* ar-EG
* ar-ER
* ar-IL
* ar-IQ
* ar-JO
* ar-KM
* ar-KW
* ar-LB
* ar-MR
* ar-OM
* ar-PS
* ar-QA
* ar-SA
* ar-SD
* ar-SO
* ar-SS
* ar-SY
* ar-TD
* ar-YE
* sd
* sd-Arab
* sd-Arab-PK
* LEFT-TO-RIGHT MARK + HYPHEN-MINUS `-` (\u200e \u002d): 10 cultures
* ar-AE
* ar-DZ
* ar-EH
* ar-LY
* ar-MA
* ar-TN
* he
* he-IL
* ur
* ur-PK
* RIGHT-TO-LEFT MARK + HYPHEN-MINUS `-` (\u200f \u002d): 3 cultures
* ckb
* ckb-IQ
* ckb-IR
* MINUS SIGN `−` (\u2212): 38 cultures
* et
* et-EE
* eu
* eu-ES
* fi
* fi-FI
* fo
* fo-DK
* fo-FO
* gsw
* gsw-CH
* gsw-FR
* gsw-LI
* hr
* hr-BA
* hr-HR
* ksh
* ksh-DE
* lt
* lt-LT
* nb
* nb-NO
* nb-SJ
* nn
* nn-NO
* no
* rm
* rm-CH
* se
* se-FI
* se-NO
* se-SE
* sl
* sl-SI
* sv
* sv-AX
* sv-FI
* sv-SE
* LEFT-TO-RIGHT MARK + MINUS SIGN `−` (\u200e \u2212): 3 cultures
* fa
* fa-AF
* fa-IR
* LEFT-TO-RIGHT MARK + HYPHEN-MINUS + LEFT-TO-RIGHT MARK `-` (\u200e \u002d \u002e): 16 cultures
* ks
* ks-Arab
* ks-Arab-IN
* lrc
* lrc-IQ
* lrc-IR
* mzn
* mzn-IR
* pa-Arab
* pa-Arab-PK
* ps
* ps-AF
* ps-PK
* ur-IN
* uz-Arab
* uz-Arab-AF
Update `BuildTest2.BuildBasicApplication()` to export
`LANG=sv_SE.UTF-8` as part of the `dotnet build` command to test this
scenario on macOS and Linux. (This change is ignored on Windows.)-int.ToString() for locales (#7941)1 parent 8d8b77f commit a693bc5
File tree
8 files changed
+80
-47
lines changed- src/Xamarin.Android.Build.Tasks
- Tests/Xamarin.Android.Build.Tests
- Utilities
- LlvmIrGenerator
8 files changed
+80
-47
lines changedLines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
56 | 64 | | |
57 | | - | |
| 65 | + | |
58 | 66 | | |
59 | 67 | | |
60 | 68 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
253 | 254 | | |
254 | 255 | | |
255 | 256 | | |
256 | | - | |
| 257 | + | |
257 | 258 | | |
258 | 259 | | |
259 | 260 | | |
| |||
Lines changed: 8 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
116 | | - | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
168 | | - | |
| 169 | + | |
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
174 | | - | |
| 175 | + | |
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
| |||
701 | 702 | | |
702 | 703 | | |
703 | 704 | | |
704 | | - | |
| 705 | + | |
705 | 706 | | |
706 | 707 | | |
707 | 708 | | |
708 | 709 | | |
709 | 710 | | |
710 | | - | |
| 711 | + | |
711 | 712 | | |
712 | 713 | | |
713 | 714 | | |
| |||
721 | 722 | | |
722 | 723 | | |
723 | 724 | | |
724 | | - | |
| 725 | + | |
725 | 726 | | |
726 | 727 | | |
727 | 728 | | |
| |||
734 | 735 | | |
735 | 736 | | |
736 | 737 | | |
737 | | - | |
| 738 | + | |
738 | 739 | | |
739 | 740 | | |
740 | 741 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | | - | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
181 | | - | |
| 182 | + | |
182 | 183 | | |
183 | 184 | | |
184 | 185 | | |
| |||
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
198 | | - | |
| 199 | + | |
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
| |||
372 | 373 | | |
373 | 374 | | |
374 | 375 | | |
375 | | - | |
| 376 | + | |
| 377 | + | |
376 | 378 | | |
377 | 379 | | |
378 | 380 | | |
| |||
403 | 405 | | |
404 | 406 | | |
405 | 407 | | |
406 | | - | |
| 408 | + | |
407 | 409 | | |
408 | 410 | | |
409 | 411 | | |
| |||
532 | 534 | | |
533 | 535 | | |
534 | 536 | | |
535 | | - | |
| 537 | + | |
536 | 538 | | |
537 | 539 | | |
538 | 540 | | |
| |||
0 commit comments