Skip to content

stage2: zig run hello.c -lc spews a lot of errors about missing glibc headers #11168

@mitchellh

Description

@mitchellh

Zig Version

0.10.0-dev.1311+5ea94e771

Steps to Reproduce

hello.c:

void main {}

Then run zig run hello.c -lc with the stage2-built compiler.

Expected Behavior

Exit code 0.

Actual Behavior

A lot of errors about missing headers. See the full output below.

Potentially relevant details:

  • I'm on aarch64_linux.
  • Master-built stage1 zig does not have these same errors.
Toggle for full error output
error(compilation): clang failed with stderr: In file included from :370:
/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symbols.h:88:10: fatal error: cannot open file '/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symver.h': No such file or directory

error(compilation): /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/sysdeps/aarch64/crti.S:1:1: unable to build C object: clang exited with code 1
error(compilation): clang failed with stderr: /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/sysdeps/aarch64/crtn.S:40:10: fatal error: cannot open file '/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/sysdep.h': No such file or directory

error(compilation): /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/sysdeps/aarch64/crtn.S:1:1: unable to build C object: clang exited with code 1
error(compilation): clang failed with stderr: /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/csu/abi-note.S:56:10: fatal error: cannot open file '/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/csu/config.h': No such file or directory

error(compilation): clang failed with stderr: In file included from :372:
/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symbols.h:88:10: fatal error: cannot open file '/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symver.h': No such file or directory

error(compilation): /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/csu/abi-note.S:1:1: unable to build C object: clang exited with code 1
error(compilation): /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/sysdeps/aarch64/start-2.33.S:1:1: unable to build C object: clang exited with code 1
error(compilation): clang failed with stderr: In file included from :2:
/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symbols.h:88:10: fatal error: cannot open file '/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symver.h': No such file or directory

error(compilation): clang failed with stderr: In file included from :2:
/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symbols.h:88:10: fatal error: cannot open file '/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symver.h': No such file or directory

error(compilation): clang failed with stderr: In file included from :2:
/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symbols.h:88:10: fatal error: cannot open file '/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symver.h': No such file or directory

error(compilation): clang failed with stderr: In file included from :2:
/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symbols.h:88:10: fatal error: cannot open file '/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symver.h': No such file or directory

error(compilation): clang failed with stderr: In file included from :2:
/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symbols.h:88:10: fatal error: cannot open file '/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symver.h': No such file or directory

error(compilation): clang failed with stderr: In file included from :2:
/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symbols.h:88:10: fatal error: cannot open file '/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symver.h': No such file or directory

error(compilation): clang failed with stderr: In file included from :2:
/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symbols.h:88:10: fatal error: cannot open file '/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symver.h': No such file or directory

error(compilation): clang failed with stderr: In file included from :2:
/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symbols.h:88:10: fatal error: cannot open file '/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symver.h': No such file or directory

error(compilation): clang failed with stderr: In file included from :2:
/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symbols.h:88:10: fatal error: cannot open file '/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symver.h': No such file or directory

error(compilation): clang failed with stderr: In file included from :2:
/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symbols.h:88:10: fatal error: cannot open file '/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symver.h': No such file or directory

error(compilation): clang failed with stderr: In file included from :2:
/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symbols.h:88:10: fatal error: cannot open file '/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symver.h': No such file or directory

error(compilation): clang failed with stderr: In file included from :2:
/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symbols.h:88:10: fatal error: cannot open file '/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symver.h': No such file or directory

error(compilation): clang failed with stderr: In file included from :2:
/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symbols.h:88:10: fatal error: cannot open file '/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symver.h': No such file or directory

error(compilation): clang failed with stderr: In file included from :2:
/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symbols.h:88:10: fatal error: cannot open file '/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symver.h': No such file or directory

error(compilation): clang failed with stderr: In file included from :2:
/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symbols.h:88:10: fatal error: cannot open file '/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symver.h': No such file or directory

error(compilation): clang failed with stderr: In file included from :2:
/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symbols.h:88:10: fatal error: cannot open file '/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symver.h': No such file or directory

error(compilation): clang failed with stderr: In file included from :2:
/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symbols.h:88:10: fatal error: cannot open file '/home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/include/libc-symver.h': No such file or directory

error(compilation): /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/sysdeps/unix/sysv/linux/stat_t64_cp.c:1:1: unable to build C object: clang exited with code 1
error(compilation): /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/io/mknod.c:1:1: unable to build C object: clang exited with code 1
error(compilation): /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/sysdeps/unix/sysv/linux/mknodat.c:1:1: unable to build C object: clang exited with code 1
error(compilation): /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/sysdeps/unix/sysv/linux/fstatat.c:1:1: unable to build C object: clang exited with code 1
error(compilation): /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/sysdeps/unix/sysv/linux/fstatat64.c:1:1: unable to build C object: clang exited with code 1
error(compilation): /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/sysdeps/unix/sysv/linux/lstat64.c:1:1: unable to build C object: clang exited with code 1
error(compilation): /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/sysdeps/unix/sysv/linux/fstat64.c:1:1: unable to build C object: clang exited with code 1
error(compilation): /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/sysdeps/unix/sysv/linux/stat64.c:1:1: unable to build C object: clang exited with code 1
error(compilation): /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/sysdeps/unix/sysv/linux/fstat.c:1:1: unable to build C object: clang exited with code 1
error(compilation): /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/sysdeps/unix/sysv/linux/lstat.c:1:1: unable to build C object: clang exited with code 1
error(compilation): /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/csu/elf-init-2.33.c:1:1: unable to build C object: clang exited with code 1
error(compilation): /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/csu/errno.c:1:1: unable to build C object: clang exited with code 1
error(compilation): /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/sysdeps/unix/sysv/linux/stat.c:1:1: unable to build C object: clang exited with code 1
error(compilation): /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/debug/stack_chk_fail_local.c:1:1: unable to build C object: clang exited with code 1
error(compilation): /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/sysdeps/pthread/pthread_atfork.c:1:1: unable to build C object: clang exited with code 1
error(compilation): /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/stdlib/at_quick_exit.c:1:1: unable to build C object: clang exited with code 1
error(compilation): /home/mitchellh/code/go/src/github.com/ziglang/zig/build/stage2/lib/zig/libc/glibc/stdlib/atexit.c:1:1: unable to build C object: clang exited with code 1
error: unable to build glibc CRT file: BuildingLibCObjectFailed

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions