Skip to content

Linking with cargo-zigbuild failed on armv7-unknown-linux-{gnu, musl}eabihf due to missing symbols #108392

Open
@NobodyXu

Description

@NobodyXu

release-builds / armv7-unknown-linux-musleabihf

release-builds / armv7-unknown-linux-gnueabihf

This can be reproduced by running:

git clone https://github.com/cargo-bins/cargo-binstall
cd cargo-binstall

export CI=true
export JUST_FOR_RELEASE=true
export CARGO_BUILD_TARGET="armv7-unknown-linux-gnueabihf"
export GLIBC_VERSION='2.17'
export JUST_USE_CARGO_ZIGBUILD=true
just build

Or by running the following cmds on the clone:

export RUSTFLAGS='-Z share-generics -C linker-plugin-lto -C link-arg=-static-libgcc -C link-arg=-Wl,--icf=safe'

cargo-zigbuild build  --release --target armv7-unknown-linux-musleabihf -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --config='profile.release.split-debuginfo="packed"' --config=profile.release.debug=2 --features static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug,cross-lang-fat-lto

The CI failed with several missing symbols.

Also, cargo-zigbuild failed to handle several link args:

  = note: warning: unsupported linker arg: -znoexecstack
          warning: unsupported linker arg: -plugin-opt
          warning: unsupported linker arg: O2
          warning: unsupported linker arg: -plugin-opt
          warning: unsupported linker arg: mcpu=generic
          warning: unsupported linker arg: -zrelro
          warning: unsupported linker arg: -znow
          warning: unsupported linker arg: --icf
          warning: unsupported linker arg: safe

Version it worked on

It most recently worked on: rust version 1.69.0-nightly (7aa413d59 2023-02-19)

Version with regression

rust version 1.69.0-nightly (5243ea5c2 2023-02-20)

@rustbot modify labels: +regression-from-stable-to-nightly -regression-untriaged

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions