Repository navigation
Conversation
nm sorts symbols that have the same address by the collation rules of the locale. With a UTF-8 locale such as en_AU.UTF-8, GNU nm 2.47 gives a different order than the expected output in test_loadobjs.py. Thus test_tool_output_lines and test_run_tool fail in GCC mode. Set LC_ALL=C for the tools that tool_output_lines() and run_tool() run. Then the tool output does not change with the host locale, and translated messages do not break the ASCII decode. Run test_tool_output_lines and test_run_tool in the C locale and in an installed UTF-8 locale. CI then finds this problem also when the runner uses the C locale. If the host has no UTF-8 locale, pytest skips the UTF-8 case. Tested with pytest on Python 3.9 and 3.13, in GCC and clang mode, with LC_ALL=C and with LC_ALL=en_AU.UTF-8. Without the change to loadobjs.py, the UTF-8 cases fail in GCC mode. Assisted-By: LLM Signed-off-by: lanjak <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test_tool_output_linesandtest_run_toolfail in GCC mode when the host uses a UTF-8 locale such asen_AU.UTF-8. nm sorts symbols that have the same address by locale collation, so the order does not agree with the expected output. CI passes because the runner uses the C collation order.This change sets
LC_ALL=Cfor the tools thattool_output_lines()andrun_tool()run. The two tests now also run in an installed UTF-8 locale, so CI finds this problem even when the runner uses the C locale. If the host has no UTF-8 locale, pytest skips that case.Tested on Arch Linux, GNU binutils 2.47, GCC 16.2 cross and clang 23: pytest on Python 3.9 and 3.13, in GCC and clang mode, with
LC_ALL=CandLC_ALL=en_AU.UTF-8. Without theloadobjs.pychange, the new UTF-8 cases fail in GCC mode. With it, all runs pass.LLM disclosure: an LLM (Claude) found the cause, wrote the change and the test, and ran the tests. It had access only to this repository and toolchain output. No Apple binaries or other RE material were used. I reviewed the change.