Skip to content

fix(std): Fix undefined reference to __my_thread_exit on QNX 8.0 #144354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rafaeling
Copy link

@rafaeling rafaeling commented Jul 23, 2025

When cross-compiling for the x86_64/aarch64-unknown-nto-qnx800 target (QNX SDP 8.0), the build fails during the final link stage with the error:

error: linking with `qcc` failed: exit status: 1
  ...
  = note: undefined reference to `__my_thread_exit'
  • On QNX 7.1: The __my_thread_exit symbol is defined and exported by the main C library (libc.a/libc.so). The std backtrace code can therefore successfully take its address at compile time.

  • On QNX 8.0: As part of a toolchain modernization, this symbol has been refactored. It is no longer present in any of the standard system libraries (.a or .so).

This patch addresses the problem at its source by conditionally compiling the problematic code.

Fixes #142726

@rustbot
Copy link
Collaborator

rustbot commented Jul 23, 2025

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 23, 2025
@rustbot

This comment has been minimized.

This commit adds an empty stub for the  function
for QNX 8 targets. This symbol is required by the unwinder but is
not present, causing a linking failure when building with the
standard library.
@rafaeling rafaeling force-pushed the fix-142726-qnx8-link-fail branch from 58ae39f to 43fab36 Compare July 24, 2025 07:40
@tgross35
Copy link
Contributor

This seems reasonable to me, pinging the target maintainers to make sure: @flba-eb @jonathanpallant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[QNX] Failure to link with std on QNX 8.0
3 participants