ziglang/zig-bootstrap

arm-linux-gnueabihf

LinuxUserGD opened this issue · 5 comments

Host system: x86_64-gentoo-linux-musl

-- Found ccache /usr/bin/ccache
-- Configuring zig version 0.10.0-dev.2931+bdf3fa12f
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/zig-bootstrap/out/build-zig-host
[  1%] Built target opt_c_util
[ 82%] Built target embedded_softfloat
[ 86%] Built target zigcpp
[ 98%] Built target zigstage1
[ 99%] Built target zig0
[100%] Built target zig
Install the project...
-- Install configuration: "Release"
-- Installing: /home/user/zig-bootstrap/out/host/bin/zig
-- Set runtime path of "/home/user/zig-bootstrap/out/host/bin/zig" to ""
-- Installing: /home/user/zig-bootstrap/out/host/lib
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is Clang 14.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /home/user/zig-bootstrap/out/host/bin/zig
-- Check for working C compiler: /home/user/zig-bootstrap/out/host/bin/zig - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "/home/user/zig-bootstrap/out/host/bin/zig"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/user/zig-bootstrap/out/build-zlib-arm-linux-gnueabihf-baseline/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_52df7/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_52df7.dir/build.make CMakeFiles/cmTC_52df7.dir/build
    gmake[1]: Entering directory '/home/user/zig-bootstrap/out/build-zlib-arm-linux-gnueabihf-baseline/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_52df7.dir/testCCompiler.c.o
    /home/user/zig-bootstrap/out/host/bin/zig  cc -fno-sanitize=all -s -target arm-linux-gnueabihf -mcpu=baseline    -MD -MT CMakeFiles/cmTC_52df7.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_52df7.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_52df7.dir/testCCompiler.c.o -c /home/user/zig-bootstrap/out/build-zlib-arm-linux-gnueabihf-baseline/CMakeFiles/CMakeTmp/testCCompiler.c
    Linking C executable cmTC_52df7
    /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_52df7.dir/link.txt --verbose=1
    /home/user/zig-bootstrap/out/host/bin/zig  cc -fno-sanitize=all -s -target arm-linux-gnueabihf -mcpu=baseline -rdynamic CMakeFiles/cmTC_52df7.dir/testCCompiler.c.o -o cmTC_52df7
    In file included from /home/user/zig-bootstrap/out/host/lib/zig/libc/glibc/sysdeps/arm/crti.S:44:
    In file included from /home/user/zig-bootstrap/out/host/lib/zig/libc/glibc/sysdeps/unix/sysv/linux/arm/sysdep.h:25:
    In file included from /home/user/zig-bootstrap/out/host/lib/zig/libc/glibc/sysdeps/unix/arm/sysdep.h:19:
    /home/user/zig-bootstrap/out/host/lib/zig/libc/glibc/sysdeps/arm/sysdep.h:25:11: fatal error: 'arm-features.h' file not found
    # include <arm-features.h>
              ^~~~~~~~~~~~~~~~
    1 error generated.
    gmake[1]: *** [CMakeFiles/cmTC_52df7.dir/build.make:100: cmTC_52df7] Error 1
    gmake[1]: Leaving directory '/home/user/zig-bootstrap/out/build-zlib-arm-linux-gnueabihf-baseline/CMakeFiles/CMakeTmp'
    gmake: *** [Makefile:127: cmTC_52df7/fast] Error 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/user/zig-bootstrap/out/build-zlib-arm-linux-gnueabihf-baseline/CMakeFiles/CMakeOutput.log".
See also "/home/user/zig-bootstrap/out/build-zlib-arm-linux-gnueabihf-baseline/CMakeFiles/CMakeError.log".
alexrp commented
install
└─ install zig
   └─ zig build-exe zig ReleaseFast arm-linux-gnueabihf failure
error: warning(link): unexpected LLD stderr:
ld.lld: warning: Linking two modules of different target triples: '/home/alexrp/Source/zig-bootstrap/zig/.zig-cache/o/01689e06a60d64e2c89337e609a9fed9/zig.o' is 'arm-unknown-linux-gnueabihf' whereas 'ld-temp.o' is 'armv6kz-unknown-linux-gnueabihf'

Not sure what could be causing this.

When producing the LLVM target triple, it needs to select the appropriate LLVM subarch for arm. In Zig we model this with CPU features instead of a "sub architecture" concept.

alexrp commented

I'm just not clear on where exactly that subarch gets added to the triple. 🤔

alexrp commented

Oh, sorry, are you saying we don't currently add the appropriate Arm version to the triple but we should?

Yeah. Or maybe it had to do with assembly files taking the target differently. This is definitely my fault, I remember noticing it and thinking, "oh that's an easy fix" and then never doing it.