Skip to content

[ATfE] Enable minimal libc++ testing with LLVM libc - #953

Open
voltur01 wants to merge 1 commit into
arm:arm-softwarefrom
voltur01:test_libcxx_with_libc
Open

[ATfE] Enable minimal libc++ testing with LLVM libc#953
voltur01 wants to merge 1 commit into
arm:arm-softwarefrom
voltur01:test_libcxx_with_libc

Conversation

@voltur01

@voltur01 voltur01 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

This adds one AArch64 and two Armv7-M (softfp and hardfp) configurations to test libc++ on top on LLVM libc.

This requires some small changes/fixes along the way:

  • JSON files enable tests and also provide enough memory for C++ tests.
  • CMake and lit option to tell which C library is used for C++ tests.
  • CMake disable rt library to avoid use of clock_gettime() that bare-metal LLVM libc does not provide.
  • Test runners to only pass the name of the test binary - not full paths that exceeds LLVM libc bootcode limit and is not used anyway.
  • Enable stderr to be used separately from stdout in LLVM semihosting and FVP parameters by using OPENMODE_A to open the special semihosting file.

The resulting failures added to the xfail list: mostly missing functionality or mismatch with hosted behavior. A few stdin tests excluded since they hang with semihosting thus trigger the long timeout.

This adds one AArch64 and two Armv7-M (softfp and hardfp) configurations
to test libc++ on top on LLVM libc.

This requires some small changes/fixes along the way:
- JSON files enable tests and also provide enough memory for C++ tests.
- CMake and lit option to tell which C library is used for C++ tests.
- CMake disable unused rt library.
- Test runners to only pass the name of the test binary - not full paths that
  exceeds LLVM libc bootcode limit and is not used anyway.
- Enable stderr to be used separately from stdout in LLVM semihosting and FVP
  parameters.

The resulting failures added to the xfail list: mostly missing functionality or
mismatch with hosted behavior. A few stdin tests excluded since they hang with
semihosting thus trigger the long timeout.
@voltur01
voltur01 requested a review from a team as a code owner July 24, 2026 12:45
-DLIBCXX_ENABLE_FILESYSTEM=OFF
-DLIBCXX_ENABLE_LOCALIZATION=ON
-DLIBCXX_ENABLE_UNICODE=OFF
-DLIBCXX_HAS_RT_LIB=OFF

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain in the PR description why the rt lib needs to be disabled?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, expanded: it effectively controls use of clock_gettime() that is a POSIX function provided by bare-metal LLVM libc now (it seems to be provided for some other targets though).

stdio_open(&__llvm_libc_stdin_cookie, OPENMODE_R);
stdio_open(&__llvm_libc_stdout_cookie, OPENMODE_W);
stdio_open(&__llvm_libc_stderr_cookie, OPENMODE_W);
stdio_open(&__llvm_libc_stderr_cookie, OPENMODE_A);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expanded the description as well: this is how the stderr is opened (vs stdout).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants