Skip to content

[cpullvm] Enable libcxxabi tests#341

Open
Shreeyash Pandey (bojle) wants to merge 6 commits into
qualcomm:qualcomm-softwarefrom
bojle:libcxxabi
Open

[cpullvm] Enable libcxxabi tests#341
Shreeyash Pandey (bojle) wants to merge 6 commits into
qualcomm:qualcomm-softwarefrom
bojle:libcxxabi

Conversation

@bojle

@bojle Shreeyash Pandey (bojle) commented May 8, 2026

Copy link
Copy Markdown
Contributor

Enable ENABLE_LIBCXX_TESTS for all embedded picolibc variants that have CXX libs and libc tests already enabled (ENABLE_CXX_LIBS=ON, ENABLE_LIBC_TESTS=ON). This covers ARM, AArch64 and RISC-V variants and allows running the libcxxabi test suite against them via QEMU semihosting

@bojle Shreeyash Pandey (bojle) changed the title Enable libcxxabi tests [WIP] Enable libcxxabi tests May 8, 2026
@bojle Shreeyash Pandey (bojle) marked this pull request as ready for review May 12, 2026 08:35
@bojle

Copy link
Copy Markdown
Contributor Author

@apazos

Copy link
Copy Markdown
Contributor

Thanks Shreeyash Pandey (@bojle), as you observed, we should rebase the patch after #340 is merged.

Let's also separate your changes by placing the CMake build commands in a different patch. Pranav will handle running tests and generating failure logs, and test failures will not block other host builds.

If there are multilib variants missing to run the tests, we can consider adding them and avoid disabling the tests. As far as I know there are no issues with QEMU installation we have in the builders, and failures with Xqci QEMU should be investigated. Please make sure the right QEMU is being invoked. Please reach out to Sudharsan.

Comment thread qualcomm-software/embedded-runtimes/test-support/xfails.py Outdated
Comment thread qualcomm-software/embedded-runtimes/test-support/xfails.py Outdated
Comment thread qualcomm-software/embedded-runtimes/test-support/xfails.py Outdated
Comment thread qualcomm-software/embedded-runtimes/test-support/xfails.py Outdated
Comment thread qualcomm-software/embedded-multilib/CMakeLists.txt
Comment thread qualcomm-software/embedded-multilib/CMakeLists.txt Outdated
Comment thread qualcomm-software/embedded-runtimes/test-support/xfails.py Outdated
Jonathon Penix (jonathonpenix) added a commit to jonathonpenix/cpullvm-toolchain that referenced this pull request May 14, 2026
Previously, a TLS model was only ever explicitly set for picolibc--other
projects (libc++, etc.) would use whatever the compiler selected. This
shouldn't necessarily be a problem, but in practice can cause issues when
global-dynamic is selected and is implemented via calls to `__tls_get_addr`
(ex: in our 32bit Arm and 32/64bit RISC-V PIC configs). Given we don't provide
an implementation and we don't expect people to use a dynamic linker that would
implement this, people will generally get undefined reference errors. See the
discussion in qualcomm#341.

To try and address this, consistently specify a TLS model across all of the
libraries we are building.

Note that this seems to primarily be an issue with picolibc as it uses "normal"
TLS mechanisms [1]. musl-embedded doesn't seem to (see ex: `__errno_location`)
and consequently I don't see any obvious TLS usage in any of our libraries
built with musl-embedded as the libc.

However, I don't know if this holds true in general (if ex: libc++ itself will
never have "normal" TLS accesses of it's own). And, given that the usecases we
expect for our picolibc variants are the same as for our musl-embedded variants
(and these expectations in turn match the restrictions imposed by the given TLS
model), I'm erring on the side of specifying the TLS model for variants which
use musl-embedded as well.

[1] https://github.com/picolibc/picolibc/blob/main/doc/tls.md

Signed-off-by: Jonathon Penix <jpenix@qti.qualcomm.com>
@apazos

Copy link
Copy Markdown
Contributor

Shreeyash Pandey (@bojle) please update commit message to include libcxxabi and libunwind

Comment thread qualcomm-software/embedded-runtimes/test-support/run_qemu.py Outdated

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.

Shreeyash Pandey (@bojle) please remove this change; Jonathon is pushing the fix for building C++ libs which fixes this issue.

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.

Shreeyash Pandey (@bojle), remove this change, no need to xfail the tests. Pawan Nirpal (@pawan-nirpal-031) has a fix for the QEMU issue and he will push it as a separate PR.

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.

This is related to #354. I don't think there's a patch up for that issue yet. Jonathon Penix (@jonathonpenix) is aware of this.

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.

Remove the change and sync up with Pawan Nirpal (@pawan-nirpal-031), he pushing the fix for QEMU in separate patch.

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.

Shreeyash Pandey (@bojle) please remove this change, Pawan Nirpal (@pawan-nirpal-031) has this fix for all C++ tests

Comment thread qualcomm-software/embedded-runtimes/test-support/xfails.py Outdated
@bojle

Copy link
Copy Markdown
Contributor Author

Jonathon Penix (jonathonpenix) added a commit that referenced this pull request May 21, 2026
…icolibc (#377)

Previously, a TLS model was only ever explicitly set for picolibc--other
projects (libc++, etc.) would use whatever the compiler selected. This
shouldn't necessarily be a problem, but in practice can cause issues when
global-dynamic is selected and is implemented via calls to __tls_get_addr (ex:
in our 32bit Arm and 32/64bit RISC-V PIC configs). Given we don't provide an
implementation and we don't expect people to use a dynamic linker that would                                                                            implement this, people will generally get undefined reference errors. See the
discussion in #341.

Note that this seems to primarily be an issue with picolibc as it uses "normal"
TLS mechanisms [1]. musl-embedded doesn't seem to (see ex: __errno_location)                                                                            and consequently I don't see any obvious TLS usage in any of our libraries
built with musl-embedded as the libc.

To try and address this, consistently specify a TLS model across all of the
libraries we are building when using picolibc.

For musl-embedded, given that a) it is generally not expected to be thread safe
b) it doesn't seem to use the "usual" TLS mechanisms from the toolchain as
mentioned above and c) historically we haven't had any special handling
downstream for this, musl-embedded configs are intentionally excluded here.

Since we're special casing the flag on the libc type now, at the same time add
basic error checking so we aren't silently dropping this if it is specified via
JSON.

[1] https://github.com/picolibc/picolibc/blob/main/doc/tls.md

Signed-off-by: Jonathon Penix <jpenix@qti.qualcomm.com>
@bojle Shreeyash Pandey (bojle) changed the title [WIP] Enable libcxxabi tests [cpullvm] Enable libcxxabi tests May 22, 2026
Jonathon Penix (jonathonpenix) added a commit to jonathonpenix/cpullvm-toolchain that referenced this pull request May 22, 2026
…icolibc

Previously, a TLS model was only ever explicitly set for picolibc--other
projects (libc++, etc.) would use whatever the compiler selected. This
shouldn't necessarily be a problem, but in practice can cause issues when
global-dynamic is selected and is implemented via calls to __tls_get_addr (ex:
in our 32bit Arm and 32/64bit RISC-V PIC configs). Given we don't provide an
implementation and we don't expect people to use a dynamic linker that would
implement this, people will generally get undefined reference errors. See the
discussion in qualcomm#341.

Note that this seems to primarily be an issue with picolibc as it uses "normal"
TLS mechanisms [1]. musl-embedded doesn't seem to (see ex: __errno_location)
and consequently I don't see any obvious TLS usage in any of our libraries
built with musl-embedded as the libc.

To try and address this, consistently specify a TLS model across all of the
libraries we are building when using picolibc.

For musl-embedded, given that a) it is generally not expected to be thread safe
b) it doesn't seem to use the "usual" TLS mechanisms from the toolchain as
mentioned above and c) historically we haven't had any special handling
downstream for this, musl-embedded configs are intentionally excluded here.

Since we're special casing the flag on the libc type now, at the same time add
basic error checking so we aren't silently dropping this if it is specified via
JSON.

[1] https://github.com/picolibc/picolibc/blob/main/doc/tls.md

Signed-off-by: Jonathon Penix <jpenix@qti.qualcomm.com>
Jonathon Penix (jonathonpenix) added a commit that referenced this pull request May 26, 2026
…icolibc (#357)

Previously, a TLS model was only ever explicitly set for picolibc--other
projects (libc++, etc.) would use whatever the compiler selected. This
shouldn't necessarily be a problem, but in practice can cause issues when
global-dynamic is selected and is implemented via calls to __tls_get_addr (ex:
in our 32bit Arm and 32/64bit RISC-V PIC configs). Given we don't provide an
implementation and we don't expect people to use a dynamic linker that would
implement this, people will generally get undefined reference errors. See the
discussion in #341.

Note that this seems to primarily be an issue with picolibc as it uses "normal"
TLS mechanisms [1]. musl-embedded doesn't seem to (see ex: __errno_location)
and consequently I don't see any obvious TLS usage in any of our libraries
built with musl-embedded as the libc.

To try and address this, consistently specify a TLS model across all of the
libraries we are building when using picolibc.

For musl-embedded, given that a) it is generally not expected to be thread safe
b) it doesn't seem to use the "usual" TLS mechanisms from the toolchain as
mentioned above and c) historically we haven't had any special handling
downstream for this, musl-embedded configs are intentionally excluded here.

Since we're special casing the flag on the libc type now, at the same time add
basic error checking so we aren't silently dropping this if it is specified via
JSON.

[1] https://github.com/picolibc/picolibc/blob/main/doc/tls.md

Signed-off-by: Jonathon Penix <jpenix@qti.qualcomm.com>
@bojle

Copy link
Copy Markdown
Contributor Author

Hi Ana Pazos (@apazos) Jonathon Penix (@jonathonpenix), could you please review this? The build failures are the same as (https://github.com/qualcomm/cpullvm-toolchain/actions/runs/27567168746/job/81494042988) and should resolve once that issue is fixed. I have rebased all dependent patches and retested. Currently, cxxabi needs only one xfail (due to missing atomics in non-A nothreads riscv variants) and a minor change in libc++abi.cfg.in, which I can submit in a separate patch if needed.

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 we add armv7m_hard_fpv5_d16_nopic as well? It has both ENABLE_CXX_LIBS and ENABLE_LIBC_TESTS turned on

Besides that, this LGTM. Thanks!

(But I think this still has to wait to merge until the libc++ patches go in?)

@bojle

Shreeyash Pandey (bojle) commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Jonathon Penix (@jonathonpenix) CI failures right now are due to cxx tests, these are enabled as cxx and cxxabi are enabled via the same option ENABLE_LIBCXX_TESTS

cc:Pawan Nirpal (@pawan-nirpal-031)

Signed-off-by: Shreeyash Pandey <shrpand@qti.qualcomm.com>
Signed-off-by: Shreeyash Pandey <shrpand@qti.qualcomm.com>
Signed-off-by: Shreeyash Pandey <shrpand@qti.qualcomm.com>
Signed-off-by: Shreeyash Pandey <shrpand@qti.qualcomm.com>
Signed-off-by: Shreeyash Pandey <shrpand@qti.qualcomm.com>
Signed-off-by: Shreeyash Pandey <shrpand@qti.qualcomm.com>
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.

3 participants