Coder Social home page Coder Social logo

Comments (4)

expenses avatar expenses commented on July 18, 2024 1

That works! Thanks!

from mold.

rui314 avatar rui314 commented on July 18, 2024

Could you try setting linker to just ld?

linker = "ld"

I believe the above configuration won't work as well, because linker should be set to a compiler driver (e.g. gcc or clang) instead of a linker command itself (e.g. ld or mold).

If you undo your changes to use mold and instead run cargo build as mold -run cargo build, does that work? If a build command is run as mold -run <command>, all invocations of /usr/bin/ld, /usr/bin/ld.gold or /usr/bin/ld.lld are replaced with mold.

from mold.

expenses avatar expenses commented on July 18, 2024

Hmm, with

[target.x86_64-unknown-linux-gnu]
rustflags = [
    "-C", "link-arg=-L/usr/lib",
]
linker = "ld"

and running mold -run cargo run I get the same

  = note: mold: library not found: gcc

error.
The ld/mold command that's run seems to be the same.

from mold.

rui314 avatar rui314 commented on July 18, 2024

Please remove rustflags and linker from ~/.cargo/config and run mold -run cargo run. In other words, you don't have to edit your cargo config file to use mold. Just run mold -run cargo run without changing any config file.

Generally, linker in a cargo config file is expected to set to gcc or clang. If you set it to ld, lld or anything else, that will fail.

from mold.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.