[libcxx-commits] [libcxx] [libcxx] Work around picolibc argv handling in tests. (PR #127662)

Simon Tatham via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 18 08:55:51 PST 2025


statham-arm wrote:

The alternative would be to rewrite the Arm semihosting definition to mandate a specific quoting scheme for the command line string, and get everyone to sign up to it:
* picolibc would have to dequote and split the semihosting command string according to the new rules
  * so would every other libc that compiles in a semihosting mode
* everything that constructs a semihosting command line would have to implement the quoting side
  * qemu
  * other simulators, free and proprietary
  * anything that uses semihosting to debug on real hardware dev boards over a network or serial line
* everyone who has already defined some other semantics for the semihosting command string would have to work around breakage introduced by this change, or introduce a mode flag

I appreciate that it's always worth asking "why can't we fix this properly rather than adding a workaround?", but in this case I really think the cure would be worse than the disease. Also, implementing that fix would require a lot of separate software projects to all agree to do it, most of which neither Arm nor LLVM has any control over.

This is currently affecting Arm's downstream embedded toolchain built on picolibc + libcxx, but we expect that LLVM's own picolibc-based testing will run into it once it updates picolibc past some recent locale support patches.

https://github.com/llvm/llvm-project/pull/127662


More information about the libcxx-commits mailing list