Skip to content

regression - nightly 2023-03-30 -> 2023-03-31 causes linker error when importing wasm_bindgen::JsValue in a proc_macro #111888

Closed
@finnbear

Description

Notes for other investigators

(2023-07-19)

  1. stylist-rs has been updated with a workaround, so the reproduction described below will need adapting (e.g. check out that repo from around futursolo/stylist-rs@fbd788f or earlier, since that will not include the workaround added in Mitigate linker error from Rust compiler futursolo/stylist-rs#123 )

  2. This problem exhibits itself only with certain numbers of codegen-units. The default setting for codegen-units is host dependent (the default is chosen, in part, as a function of the number of cores the host has available, in order to parallelize the code-generation performed by LLVM). In my own experiments, the problem is masked (does not arise) for codegen-units={1,2,4,8}, and the problem does arise for codegen-units={16,32,64,128,256}. You are best off passing -Ccodegen-units explicit when investigating this, just to ward against that being an invisible factor in the experiments.

(bug report follows below)

Code

I tried this code:

[package]
name = "nightly_stylist"
version = "0.1.0"
edition = "2021"

[dependencies]
stylist-macros = "0.12"
fn main() {}

stylist-macros

I expected to see this happen: cargo check succeeds in debug mode.

Instead, this happened: cargo check fails in debug mode.

  = note: /usr/bin/ld: __wbindgen_realloc: undefined version: 
          /usr/bin/ld: __wbindgen_malloc: undefined version: 
          /usr/bin/ld: __wbindgen_free: undefined version: 
          /usr/bin/ld: __wbindgen_exn_store: undefined version: 
          /usr/bin/ld: failed to set dynamic section sizes: bad value
          collect2: error: ld returned 1 exit status

Version it worked on

rustc 1.70.0-nightly (ec2f40c6b 2023-03-30)
binary: rustc
commit-hash: ec2f40c6b04f0e9850dd1f454e8639d319f4ed9b
commit-date: 2023-03-30
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 16.0.0

Version with regression

rustc 1.70.0-nightly (5e1d3299a 2023-03-31)
binary: rustc
commit-hash: 5e1d3299a290026b85787bc9c7e72bcc53ac283f
commit-date: 2023-03-31
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 16.0.0

Cargo bisect-rustc

searched toolchains ec2f40c6b04f0e9850dd1f454e8639d319f4ed9b through 5e1d3299a290026b85787bc9c7e72bcc53ac283f


********************************************************************************
Regression in 22a7a19f9333bc1fcba97ce444a3515cb5fb33e6
********************************************************************************

*isn't immediately obvious why this change would cause the problem

searched nightlies: from nightly-2023-03-27 to nightly-2023-04-02
regressed nightly: nightly-2023-04-01
searched commit range: ec2f40c...5e1d329
regressed commit: 22a7a19

bisected with cargo-bisect-rustc v0.6.6

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --start 2023-03-27 --end 2023-04-02 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

A-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions