zig icon indicating copy to clipboard operation
zig copied to clipboard

Some tooling fails due the the lack of GNU linker replacement, for example `zig ld`

Open ChipZhang opened this issue 6 months ago • 2 comments

Zig Version

0.14

Steps to Reproduce and Observed Behavior

In a fresh linux system with zig downloaded, but no system binutils installed, some software's tooling (especially some software using autotools) may fail to detect the correct ld:

configure:5359: checking for ld used by zig cc -target x86_64-linux-gnu
configure:5429: result: no

Of course if I install binutils using system package manager (which provides GNU linker ld command), the above error may be fixed.

Expected Behavior

Since zig is based on clang, and LLVM has its own linker, zig should provide the LLVM's linker via a command like zig ld. So that I can export LD='zig ld' to tell the tooling to use the correct linker.

Or some tooling may depend on system installed GNU linker. And their behavior may be different.

ChipZhang avatar May 16 '25 05:05 ChipZhang

zig should provide the LLVM's linker via a command like zig ld

It's provided with zig ld.lld

LinuxUserGD avatar May 16 '25 21:05 LinuxUserGD

It's provided with zig ld.lld

This is not shown in zig help command

ChipZhang avatar May 20 '25 13:05 ChipZhang