bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compiling glibc: mutex-solid.c:20:10: fatal error: cthreads.h: No such f


From: haha wang
Subject: Compiling glibc: mutex-solid.c:20:10: fatal error: cthreads.h: No such file or directory
Date: Fri, 15 Jan 2021 22:34:06 +0900

I try to compile the Hurd from the source the first time with the help of cross-hurd. By calling `bash bootstrap.sh", the compiling procedure goes and passes a few stages.
 
```
cd src &&
compile_binutils &&
compile_gmp &&
compile_mpfr &&
compile_mpc &&
compile_gcc &&
compile_pkgconfiglite &&
install_gnumach_headers &&
install_gnumig &&
install_hurd_headers &&
compile_first_glibc &&
compile_full_gcc &&
compile_second_glibc &&
print_info "bootstrap.sh finished successfully" &&
exit 0
```
but it fails and the `compile_first_glibc` stage and get the following error:
 
```
mutex-solid.c:20:10: fatal error: cthreads.h: No such file or directory
20 | #include <cthreads.h>
| ^~~~~~~~~~~~
compilation terminated.
make[2]: *** [/home/hahawang/code/hurd/my-cross-hurd/tmp/src/glibc-2.32.first_obj/mach/mutex-solid.o] Error 1
make[1]: *** [mach/subdir_lib] Error 2
make: *** [all] Error 2
mutex-solid.c:20:10: fatal error: cthreads.h: No such file or directory
20 | #include <cthreads.h>
| ^~~~~~~~~~~~
compilation terminated.
```
I have found the `cthread.h` within the source package of the gnumach but not at the include path of the cross-building Hurd. It seems that it haven't been installed yet.
By reading the `INSTALL-cross` guide, I have found the first compiling of glibc always fails and you can just ignore it. I do as it told, continue to compile gcc again. But the second compiling of gcc failed too and dumped the following error:
 
```
cc1: note: self-tests are not enabled in this build
cc1plus: note: self-tests are not enabled in this build
In file included from ../../../gcc-9.2.0/libgcc/libgcc2.c:27:
../../../gcc-9.2.0/libgcc/../gcc/tsystem.h:87:10: fatal error: stdio.h: No such file or directory
87 | #include <stdio.h>
| ^~~~~~~~~
compilation terminated.
make[2]: *** [_muldi3.o] Error 1
make[1]: *** [all-target-libgcc] Error 2
make: *** [all] Error 2
```
It seems that compiling gcc the second time needs glibc to provide a working `stdio.h`, but the glibc also needs a second compiling after the compiling of gcc succeeds. Now it stuck. I know its a chicken-and-egg problem, but how to fix it? Should I replace gcc with another version or find some patch files? Thank you in advance.
 
GCC and GLIBC version:
[1] GCC: gcc-9.2.0
[2] GLIBC: glibc-2.32
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]