Skip to content

zig cc fails to compile the linux kernel #16944

Open
@theoparis

Description

@theoparis

Zig Version

0.12.0-dev.163+6780a6bbf

Steps to Reproduce and Observed Behavior

  • Write zigcc, zigobjcopy, zigar and zigcxx alias scripts
  • Use them with the makefile
make \
	-j$(nproc) \
	CC="zigcc" \
	LD="zigcc" \
	AR="zigar" \
	OBJCOPY="zigobjcopy" \
	HOSTCC="zigcc" \
	HOSTCXX="zigcxx" \
	HOSTAR="zigar" \
	HOSTLD="zigcc" \
	defconfig

Errors Encountered

HOSTCC  scripts/basic/fixdep
zig: warning: argument unused during compilation: '-MD' [-Wunused-command-line-argument]
scripts/basic/fixdep.c:1:1: error: unable to build C object: FileNotFound
make[1]: *** [scripts/Makefile.host:110: scripts/basic/fixdep] Error 1
make: *** [Makefile:646: scripts_basic] Error 2

@Rexicon226 seems to have gotten further but I'm not sure how... However they encountered this:
image

I should also mention that zig is missing readelf, objdump, and strip which LLVM has.

Expected Behavior

Successful compilation of the Linux kernel, clang/llvm/lld works fine but zig does not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorzig ccZig as a drop-in C compiler feature

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions