ziglang / zig-bootstrap

take off every zig
381 stars 91 forks source link

arm-linux-gnueabi #101

Open LinuxUserGD opened 2 years ago

LinuxUserGD commented 2 years ago

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-gnueabi-baseline/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_b0baf/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_b0baf.dir/build.make CMakeFiles/cmTC_b0baf.dir/build
    gmake[1]: Entering directory '/home/user/zig-bootstrap/out/build-zlib-arm-linux-gnueabi-baseline/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_b0baf.dir/testCCompiler.c.o
    /home/user/zig-bootstrap/out/host/bin/zig  cc -fno-sanitize=all -s -target arm-linux-gnueabi -mcpu=baseline    -MD -MT CMakeFiles/cmTC_b0baf.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_b0baf.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_b0baf.dir/testCCompiler.c.o -c /home/user/zig-bootstrap/out/build-zlib-arm-linux-gnueabi-baseline/CMakeFiles/CMakeTmp/testCCompiler.c
    Linking C executable cmTC_b0baf
    /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b0baf.dir/link.txt --verbose=1
    /home/user/zig-bootstrap/out/host/bin/zig  cc -fno-sanitize=all -s -target arm-linux-gnueabi -mcpu=baseline -rdynamic CMakeFiles/cmTC_b0baf.dir/testCCompiler.c.o -o cmTC_b0baf
    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_b0baf.dir/build.make:100: cmTC_b0baf] Error 1
    gmake[1]: Leaving directory '/home/user/zig-bootstrap/out/build-zlib-arm-linux-gnueabi-baseline/CMakeFiles/CMakeTmp'
    gmake: *** [Makefile:127: cmTC_b0baf/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-gnueabi-baseline/CMakeFiles/CMakeOutput.log".
See also "/home/user/zig-bootstrap/out/build-zlib-arm-linux-gnueabi-baseline/CMakeFiles/CMakeError.log".
matu3ba commented 2 years ago

Where does it fail, if you add/apply this PR https://github.com/ziglang/zig/pull/12346 ?

LinuxUserGD commented 2 years ago

Where does it fail, if you add/apply this PR ziglang/zig#12346 ?

After copying the file to out/host/lib/zig/libc/glibc/sysdeps/arm/arm-features.h, zlib compiles fine but build (https://github.com/ziglang/zig-bootstrap/commit/326b8a409688d91f6392d06a8d26c2f9dfe01421) fails later with different error, mentioning https://github.com/ziglang/zig/issues/6573

/home/user/git/zig-bootstrap/zlib/zutil.c:317:20: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
void ZLIB_INTERNAL zcfree(opaque, ptr)
                   ^
3 warnings generated.
34 warnings generated.
26 warnings generated.
[100%] Linking C static library libz.a
[100%] Built target z
Install the project...
-- Install configuration: "Release"
-- Installing: /home/user/git/zig-bootstrap/out/arm-linux-gnueabi-baseline/lib/libz.a
-- Installing: /home/user/git/zig-bootstrap/out/arm-linux-gnueabi-baseline/include/zconf.h
-- Installing: /home/user/git/zig-bootstrap/out/arm-linux-gnueabi-baseline/include/zlib.h
-- The C compiler identification is Clang 15.0.3
-- The CXX compiler identification is unknown
-- The ASM compiler identification is unknown
-- Found assembler: /home/user/git/zig-bootstrap/out/host/bin/zig
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/user/git/zig-bootstrap/out/host/bin/zig - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /home/user/git/zig-bootstrap/out/host/bin/zig
-- Check for working CXX compiler: /home/user/git/zig-bootstrap/out/host/bin/zig - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:63 (message):
  The C++ compiler

    "/home/user/git/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/git/zig-bootstrap/out/build-llvm-arm-linux-gnueabi-baseline/CMakeFiles/CMakeScratch/TryCompile-NnaEpK

    Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_a021c/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_a021c.dir/build.make CMakeFiles/cmTC_a021c.dir/build
    gmake[1]: Entering directory '/home/user/git/zig-bootstrap/out/build-llvm-arm-linux-gnueabi-baseline/CMakeFiles/CMakeScratch/TryCompile-NnaEpK'
    Building CXX object CMakeFiles/cmTC_a021c.dir/testCXXCompiler.cxx.o
    /home/user/git/zig-bootstrap/out/host/bin/zig c++ -fno-sanitize=all -s -target arm-linux-gnueabi -mcpu=baseline    -o CMakeFiles/cmTC_a021c.dir/testCXXCompiler.cxx.o -c /home/user/git/zig-bootstrap/out/build-llvm-arm-linux-gnueabi-baseline/CMakeFiles/CMakeScratch/TryCompile-NnaEpK/testCXXCompiler.cxx
    warning(compilation): libc++ does not work on multi-threaded ARM yet.
    For more details: https://github.com/ziglang/zig/issues/6573
    error: unable to create compilation: TargetRequiresSingleThreaded
    gmake[1]: *** [CMakeFiles/cmTC_a021c.dir/build.make:78: CMakeFiles/cmTC_a021c.dir/testCXXCompiler.cxx.o] Error 1
    gmake[1]: Leaving directory '/home/user/git/zig-bootstrap/out/build-llvm-arm-linux-gnueabi-baseline/CMakeFiles/CMakeScratch/TryCompile-NnaEpK'
    gmake: *** [Makefile:127: cmTC_a021c/fast] Error 2

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

-- Configuring incomplete, errors occurred!
See also "/home/user/git/zig-bootstrap/out/build-llvm-arm-linux-gnueabi-baseline/CMakeFiles/CMakeOutput.log".
See also "/home/user/git/zig-bootstrap/out/build-llvm-arm-linux-gnueabi-baseline/CMakeFiles/CMakeError.log".
alexrp commented 2 months ago

On the 2nd build of LLVM:

-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Failed
-- Looking for __atomic_fetch_add_4 in atomic
-- Looking for __atomic_fetch_add_4 in atomic - not found
CMake Error at cmake/modules/CheckAtomic.cmake:59 (message):
  Host compiler appears to require libatomic, but cannot find it.
Call Stack (most recent call first):
  cmake/config-ix.cmake:412 (include)
  CMakeLists.txt:898 (include)

-- Configuring incomplete, errors occurred!

(./build arm-linux-gnueabi baseline)

This is very likely https://github.com/ziglang/zig/issues/10411.