Skip to content

Conversation

@laundmo
Copy link
Contributor

@laundmo laundmo commented May 29, 2025

in LinkAction, dunce::canonicalize(linker) was being called, which resulted in a "file not found" IoError as it tried to find the linker relative to the workdir, even though linker="command_on_PATH" is accepted by Cargo. This falls back to using the linker command directly in those cases.

This used to only pass through -Wl,-fuse-ld=mold when thin linking, but Rustflags uses -C link-arg=-fuse-ld=mold which causes -fuse-ld=mold to be passed. This PR adds that case.

These changes present a big annoyance with setting up subsecond to use a linker besides the default, like Mold. With this PR the following .cargo/config.toml works as expected:

[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = [
    "-C",
    "link-arg=-fuse-ld=mold",
]

Closes:

@jkelleyrtp jkelleyrtp merged commit 937e9b9 into DioxusLabs:main May 30, 2025
17 checks passed
AnteDeliria pushed a commit to AnteDeliria/dioxus that referenced this pull request Jun 2, 2025
…usLabs#4222)

* subsecond/cli: fix passing through -fuse-ld for LinkerFlavour::Gnu

* if linker isn't a relative, local path, keep it unresolved since its a command on PATH
AnteDeliria pushed a commit to AnteDeliria/dioxus that referenced this pull request Jul 23, 2025
…usLabs#4222)

* subsecond/cli: fix passing through -fuse-ld for LinkerFlavour::Gnu

* if linker isn't a relative, local path, keep it unresolved since its a command on PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants