Skip to content

[QNX] Failure to link with std on QNX 8.0 #142726

Open
@tronical

Description

@tronical

I tried this code:

fn main() {
}

I expected to see this happen: Compiles.

Instead, this happened: Linking fails with this:

error: linking with `qcc` failed: exit status: 1
  |
  = note:  "qcc" "-Vgcc_ntoaarch64le_cxx" "/tmp/rustcdYZPCb/symbols.o" "<6 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "<sysroot>/lib/rustlib/aarch64-unknown-nto-qnx800/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,libcfg_if-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lc" "-lm" "-lsocket" "-lregex" "-L" "/tmp/rustcdYZPCb/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-o" "/home/simon/src/qnx-test/target/aarch64-unknown-nto-qnx800/debug/deps/qnx-test-fbbe5a782bfd11a8" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: /home/simon/qnx/qnx800/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx8.0.0-ld: /home/simon/src/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/aarch64-unknown-nto-qnx800/lib/libstd-06a16e12f5d93859.rlib(std-06a16e12f5d93859.std.59a1aa632481cede-cgu.10.rcgu.o): in function `std::sys::backtrace::_print_fmt::{{closure}}':
          std.59a1aa632481cede-cgu.10:(.text._ZN3std3sys9backtrace10_print_fmt28_$u7b$$u7b$closure$u7d$$u7d$17h7223c4412795f075E+0x90): undefined reference to `__my_thread_exit'
          /home/simon/qnx/qnx800/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx8.0.0-ld: std.59a1aa632481cede-cgu.10:(.text._ZN3std3sys9backtrace10_print_fmt28_$u7b$$u7b$closure$u7d$$u7d$17h7223c4412795f075E+0x94): undefined reference to `__my_thread_exit'

  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-
link-lib)

If I comment out the __my_thread_exit related code in library/std/src/sys/backtrace.rs the program links and everything runs as expected (my real app, not just the above dummy main).

Meta

rustc --version --verbose:

rustc 1.89.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.89.0-dev
LLVM version: 20.1.7
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.02s

(This is, in fact, the master branch built from commit 2fcf177 )

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-neutrinoOS: QNX Neutrino, a POSIX-compatible real-time operating systemT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions