ziglang / zig-bootstrap

take off every zig
369 stars 86 forks source link

Build fails at 100% during installation: The C compiler is not able to compile a simple test program (unknown architecture / CPU) #87

Closed fschutt closed 2 years ago

fschutt commented 2 years ago

I get an error while trying to bootstrap zig for native-linux-gnu: error: Unknown CPU: ''

Log:

$ ./build -j12 native-linux-gnu
[...]
[100%] Built target zig
Install the project...
-- Install configuration: "Release"
-- Installing: /home/fs/Development/zig-bootstrap/out/host/bin/zig
-- Set runtime path of "/home/fs/Development/zig-bootstrap/out/host/bin/zig" to ""
-- Installing: /home/fs/Development/zig-bootstrap/out/host/lib
-- The C compiler identification is unknown
-- Check for working C compiler: /home/fs/Development/zig-bootstrap/out/host/bin/zig
-- Check for working C compiler: /home/fs/Development/zig-bootstrap/out/host/bin/zig -- broken
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "/home/fs/Development/zig-bootstrap/out/host/bin/zig"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/fs/Development/zig-bootstrap/out/build-zlib-native-linux-gnu-/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/make cmTC_8d3b2/fast && /usr/bin/make -f CMakeFiles/cmTC_8d3b2.dir/build.make CMakeFiles/cmTC_8d3b2.dir/build
    make[1]: Verzeichnis „/home/fs/Development/zig-bootstrap/out/build-zlib-native-linux-gnu-/CMakeFiles/CMakeTmp“ wird betreten
    Building C object CMakeFiles/cmTC_8d3b2.dir/testCCompiler.c.o
    /home/fs/Development/zig-bootstrap/out/host/bin/zig  cc -fno-sanitize=all -s -target native-linux-gnu -mcpu=    -o CMakeFiles/cmTC_8d3b2.dir/testCCompiler.c.o   -c /home/fs/Development/zig-bootstrap/out/build-zlib-native-linux-gnu-/CMakeFiles/CMakeTmp/testCCompiler.c
    info: Available CPUs for architecture 'x86_64':
     alderlake
     amdfam10
     athlon
     athlon64
     athlon64_sse3
     athlon_4
     athlon_fx
     athlon_mp
     athlon_tbird
     athlon_xp
     atom
     barcelona
     bdver1
     bdver2
     bdver3
     bdver4
     bonnell
     broadwell
     btver1
     btver2
     c3
     c3_2
     cannonlake
     cascadelake
     cooperlake
     core2
     core_avx2
     core_avx_i
     corei7
     corei7_avx
     generic
     geode
     goldmont
     goldmont_plus
     haswell
     i386
     i486
     i586
     i686
     icelake_client
     icelake_server
     ivybridge
     k6
     k6_2
     k6_3
     k8
     k8_sse3
     knl
     knm
     lakemont
     nehalem
     nocona
     opteron
     opteron_sse3
     penryn
     pentium
     pentium2
     pentium3
     pentium3m
     pentium4
     pentium4m
     pentium_m
     pentium_mmx
     pentiumpro
     prescott
     rocketlake
     sandybridge
     sapphirerapids
     silvermont
     skx
     skylake
     skylake_avx512
     slm
     tigerlake
     tremont
     westmere
     winchip2
     winchip_c6
     x86_64
     x86_64_v2
     x86_64_v3
     x86_64_v4
     yonah
     znver1
     znver2
     znver3

    error: Unknown CPU: ''
    make[1]: *** [CMakeFiles/cmTC_8d3b2.dir/build.make:66: CMakeFiles/cmTC_8d3b2.dir/testCCompiler.c.o] Fehler 1
    make[1]: Verzeichnis „/home/fs/Development/zig-bootstrap/out/build-zlib-native-linux-gnu-/CMakeFiles/CMakeTmp“ wird verlassen
    make: *** [Makefile:121: cmTC_8d3b2/fast] Fehler 2

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:4 (project)

-- Configuring incomplete, errors occurred!
See also "/home/fs/Development/zig-bootstrap/out/build-zlib-native-linux-gnu-/CMakeFiles/CMakeOutput.log".
See also "/home/fs/Development/zig-bootstrap/out/build-zlib-native-linux-gnu-/CMakeFiles/CMakeError.log".

Operating system:

Linux 5.4.0-121-generic #137-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux

DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=20.3
DISTRIB_CODENAME=una
DISTRIB_DESCRIPTION="Linux Mint 20.3 Una"

clang version 10.0.0-4ubuntu1 
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.

GNU Make 4.2.1 (x86_64-pc-linux-gnu)

cmake version 3.16.3

Python 3.10.5

Log files:

CMakeError.log CMakeOutput.log cpuinfo.txt

fschutt commented 2 years ago

This seems to be a style error, the output file /home/fs/Development/zig-bootstrap/out/host/bin/zig seems to work nonetheless.

Not sure what this error means then.

andrewrk commented 2 years ago

Check the readme instructions carefully, all args are required