Skip to content

Commit 09a489d

Browse files
authored
Unrolled build for #144354
Rollup merge of #144354 - rafaeling:fix-142726-qnx8-link-fail, r=tgross35 fix(std): Fix undefined reference to __my_thread_exit on QNX 8.0 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
2 parents ef8d1d6 + 17c8667 commit 09a489d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/std/src/sys/backtrace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ unsafe fn _print_fmt(fmt: &mut fmt::Formatter<'_>, print_fmt: PrintFmt) -> fmt::
113113
res = bt_fmt.frame().symbol(frame, symbol);
114114
}
115115
});
116-
#[cfg(target_os = "nto")]
116+
#[cfg(all(target_os = "nto", any(target_env = "nto70", target_env = "nto71")))]
117117
if libc::__my_thread_exit as *mut libc::c_void == frame.ip() {
118118
if !hit && print {
119119
use crate::backtrace_rs::SymbolName;

0 commit comments

Comments
 (0)