Skip to content

librustc_llvm: call llvm-config with correct linking mode #36854

Closed
@leahneukirchen

Description

@leahneukirchen

In 1.12, src/librustc_llvm/build.rs figures out which libraries it needs for external LLVM using llvm-config --libs which breaks if you have LLVM with -DLLVM_BUILD_LLVM_DYLIB=ON and -DLLVM_LINK_LLVM_DYLIB=OFF (which is needed for clang 3.9 these days), since then there is a dynamic libLLVM3.9.so and lots of libLLVM*.a, but the code sees the libLLVM and decides it has to link statically, which fails.

The code should decide whether to link static or dynamic first, and then call llvm-config --libs --link-shared resp --link-static, to get the correct library name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions