Bug 100289 - [11/12/13/14/15 Regression] libgcc/libgcov.h: bootstrap failure due to missing #include <sys/mman.h>
Summary: [11/12/13/14/15 Regression] libgcc/libgcov.h: bootstrap failure due to missin...
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: gcov-profile (show other bugs)
Version: 11.1.0
: P2 normal
Target Milestone: 11.5
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2021-04-27 12:13 UTC by rudi
Modified: 2024-04-26 10:40 UTC (History)
7 users (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-libreelec-linux-gnu
Build: x86_64-pc-linux-gnu
Known to work: 10.3.0
Known to fail: 11.1.0
Last reconfirmed:


Attachments
Config.log (7.75 KB, text/plain)
2021-04-28 12:16 UTC, rudi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rudi 2021-04-27 12:13:13 UTC
Performing a bootstrap on Ubuntu 18.04 for a LibreELEC10 build, with just an update from gcc 10.3.0 to 11.1.0, the bootstrap fails. Configure incorrectly defines HAVE_SYS_MMAN_H as 1. Removing sys/mmap.h allows the successful build of gcc:bootstrap. 

Gcc:host subsequently fails build with - 

/storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/gcc-11.1.0/libgcc/libgcov.h:426:10: warning: implicit declaration of function 'mmap' [-Wimplicit-function-declaration]

Failure log of bootstrap build - 
Failure logs of host build - http://paste.ubuntu.com/p/tCtc4nRfkV/
Comment 1 Richard Biener 2021-04-27 12:17:41 UTC
I suppose HAVE_SYS_MMAN_H is for the host and not for the target.
Comment 2 Richard Biener 2021-04-27 12:18:58 UTC
But it uses

#ifndef IN_GCOV_TOOL
/* About the target.  */
/* This path will be used by libgcov runtime.  */

#include "tconfig.h"
#include "auto-target.h"
#include "tsystem.h"

so that's configure results for the target.  Can you attach config.log?
Comment 3 rudi 2021-04-27 12:20:03 UTC
Bootstrap build log. http://paste.ubuntu.com/p/JFPPZqvk3c/
Comment 4 rudi 2021-04-27 12:22:15 UTC
.x86_64-linux-gnu-bootstrap/x86_64-libreelec-linux-gnu/libgcc/config.log
http://paste.ubuntu.com/p/Y6wFsSBdqv/
Comment 5 Richard Biener 2021-04-28 06:06:05 UTC
(In reply to rudi from comment #4)
> .x86_64-linux-gnu-bootstrap/x86_64-libreelec-linux-gnu/libgcc/config.log
> http://paste.ubuntu.com/p/Y6wFsSBdqv/

I wonder if you can attach this logfile in this bug instead?  pastes tend
to time out and I can't download the raw text from there w/o creating an account (huh?!).
Comment 6 Jakub Jelinek 2021-04-28 10:21:21 UTC
This is libgcc configure, so it should be checking for target headers there.
So, do you have sys/mman.h on the host and not present in the sysroot (ditto other C library headers, including stdlib.h)?
For x86_64-*-linux* target that certainly seems like a user error.
Though, from config.log it seems the sys/mman.h etc. header checking passed while for stdlib.h it didn't.
Comment 7 rudi 2021-04-28 11:23:11 UTC
Here is the find / -name mman.h
http://paste.ubuntu.com/p/KVdjQp8qq3/

./usr/include/x86_64-linux-gnu/asm/mman.h
./usr/include/x86_64-linux-gnu/bits/mman.h
./usr/include/x86_64-linux-gnu/sys/mman.h
./usr/include/linux/mman.h
./usr/include/asm-generic/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/install_pkg/glibc-2.33/usr/include/bits/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/install_pkg/glibc-2.33/usr/include/sys/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/linux/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/bits/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/asm-generic/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/sys/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/glibc-2.33/bits/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/glibc-2.33/misc/sys/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/glibc-2.33/sysdeps/unix/sysv/linux/aarch64/bits/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/glibc-2.33/sysdeps/unix/sysv/linux/ia64/bits/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/glibc-2.33/sysdeps/unix/sysv/linux/bits/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/glibc-2.33/sysdeps/unix/sysv/linux/sparc/bits/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/glibc-2.33/sysdeps/unix/sysv/linux/mips/bits/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/glibc-2.33/sysdeps/unix/sysv/linux/x86/bits/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/glibc-2.33/sysdeps/unix/sysv/linux/hppa/bits/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/glibc-2.33/sysdeps/unix/sysv/linux/powerpc/bits/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/glibc-2.33/sysdeps/unix/sysv/linux/alpha/bits/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/glibc-2.33/include/sys/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/dest/include/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/dest/include/linux/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/dest/include/asm-generic/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/usr/include/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/usr/include/linux/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/usr/include/asm-generic/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/arm/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/ia64/include/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/ia64/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/sparc/include/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/sparc/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/mips/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/x86/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/powerpc/include/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/powerpc/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/arm64/include/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/arm64/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/parisc/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/alpha/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/xtensa/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/arm/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/ia64/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/sparc/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/mips/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/x86/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/sh/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/powerpc/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/s390/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/arm64/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/arc/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/parisc/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/microblaze/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/alpha/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/xtensa/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/h8300/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/hexagon/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/include/uapi/linux/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/include/uapi/asm-generic/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/include/linux/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/include/uapi/linux/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/include/uapi/asm-generic/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/gcc-10.3.0/fixincludes/tests/base/sys/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/asm-arm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/asm-s390/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/linux/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/asm-x86/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/asm-generic/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/asm-mips/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/asm-powerpc/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/asm-arm64/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/xorg-intel-gpu-tools-1.26/lib/stubs/syscalls/sys/mman.h
Comment 8 rudi 2021-04-28 11:28:41 UTC
This is after a success LibreELEC10 build with gcc 10.3.0.

Just testing build of gcc:bootstrap and gcc:host after doing a scripts/clean gcc.
This works.

So now doing a full make clean (which is where I got the error in the first place.)
Comment 9 rudi 2021-04-28 12:06:02 UTC
After a full make clean: 

The bootstrap build fails:

In file included from /storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/gcc-11.1.0/libgcc/libgcov-merge.c:26:
/storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/gcc-11.1.0/libgcc/libgcov.h:49:10: fatal error: sys/mman.h: No such file or directory
   49 | #include <sys/mman.h>
      |          ^~~~~~~~~~~~
compilation terminated.
make[3]: *** [Makefile:921: _gcov_merge_add.o] Error 1

These headers are added to sysroot by linux:host

grep mman.h 58.log 
  HDRINST usr/include/asm-generic/mman.h
  HDRINST usr/include/linux/mman.h
  HDRINST usr/include/asm/mman.h

Here are the headers of the clean environment.

./usr/include/x86_64-linux-gnu/asm/mman.h
./usr/include/x86_64-linux-gnu/bits/mman.h
./usr/include/x86_64-linux-gnu/sys/mman.h
./usr/include/linux/mman.h
./usr/include/asm-generic/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/linux/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/asm-generic/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/gcc-11.1.0/fixincludes/tests/base/sys/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/dest/include/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/dest/include/linux/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/dest/include/asm-generic/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/usr/include/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/usr/include/linux/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/usr/include/asm-generic/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/arm/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/ia64/include/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/ia64/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/sparc/include/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/sparc/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/mips/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/x86/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/powerpc/include/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/powerpc/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/arm64/include/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/arm64/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/parisc/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/alpha/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/xtensa/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/arm/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/ia64/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/sparc/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/mips/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/x86/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/sh/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/powerpc/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/s390/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/arm64/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/arc/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/parisc/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/microblaze/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/alpha/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/xtensa/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/h8300/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/hexagon/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/include/uapi/linux/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/include/uapi/asm-generic/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/include/linux/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/include/uapi/linux/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/include/uapi/asm-generic/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/asm-arm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/asm-s390/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/linux/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/asm-x86/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/asm-generic/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/asm-mips/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/asm-powerpc/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/asm-arm64/mman.h

Here is the make code that copies the kernel header files into sysroot.

make_host() {
  make \
    ARCH=${HEADERS_ARCH:-${TARGET_KERNEL_ARCH}} \
    HOSTCC="${TOOLCHAIN}/bin/host-gcc" \
    HOSTCXX="${TOOLCHAIN}/bin/host-g++" \
    HOSTCFLAGS="${HOST_CFLAGS}" \
    HOSTCXXFLAGS="${HOST_CXXFLAGS}" \
    HOSTLDFLAGS="${HOST_LDFLAGS}" \
    headers_check
}

makeinstall_host() {
  make \
    ARCH=${HEADERS_ARCH:-${TARGET_KERNEL_ARCH}} \
    HOSTCC="${TOOLCHAIN}/bin/host-gcc" \
    HOSTCXX="${TOOLCHAIN}/bin/host-g++" \
    HOSTCFLAGS="${HOST_CFLAGS}" \
    HOSTCXXFLAGS="${HOST_CXXFLAGS}" \
    HOSTLDFLAGS="${HOST_LDFLAGS}" \
    INSTALL_HDR_PATH=dest \
    headers_install
  mkdir -p ${SYSROOT_PREFIX}/usr/include
    cp -R dest/include/* ${SYSROOT_PREFIX}/usr/include
}
Comment 10 rudi 2021-04-28 12:06:34 UTC
After a full make clean: 

The bootstrap build fails:

In file included from /storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/gcc-11.1.0/libgcc/libgcov-merge.c:26:
/storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/gcc-11.1.0/libgcc/libgcov.h:49:10: fatal error: sys/mman.h: No such file or directory
   49 | #include <sys/mman.h>
      |          ^~~~~~~~~~~~
compilation terminated.
make[3]: *** [Makefile:921: _gcov_merge_add.o] Error 1

These headers are added to sysroot by linux:host

grep mman.h 58.log 
  HDRINST usr/include/asm-generic/mman.h
  HDRINST usr/include/linux/mman.h
  HDRINST usr/include/asm/mman.h

Here are the headers of the clean environment.

./usr/include/x86_64-linux-gnu/asm/mman.h
./usr/include/x86_64-linux-gnu/bits/mman.h
./usr/include/x86_64-linux-gnu/sys/mman.h
./usr/include/linux/mman.h
./usr/include/asm-generic/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/linux/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/asm-generic/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/gcc-11.1.0/fixincludes/tests/base/sys/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/dest/include/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/dest/include/linux/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/dest/include/asm-generic/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/usr/include/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/usr/include/linux/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/usr/include/asm-generic/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/arm/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/ia64/include/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/ia64/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/sparc/include/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/sparc/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/mips/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/x86/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/powerpc/include/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/powerpc/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/arm64/include/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/arm64/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/parisc/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/alpha/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/arch/xtensa/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/arm/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/ia64/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/sparc/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/mips/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/x86/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/sh/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/powerpc/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/s390/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/arm64/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/arc/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/parisc/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/microblaze/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/alpha/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/xtensa/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/h8300/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/arch/hexagon/include/uapi/asm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/include/uapi/linux/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/tools/include/uapi/asm-generic/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/include/linux/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/include/uapi/linux/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/linux-5.10.32/include/uapi/asm-generic/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/asm-arm/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/asm-s390/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/linux/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/asm-x86/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/asm-generic/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/asm-mips/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/asm-powerpc/mman.h
./storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/qemu-5.2.0/linux-headers/asm-arm64/mman.h

Here is the make code that copies the kernel header files into sysroot.

make_host() {
  make \
    ARCH=${HEADERS_ARCH:-${TARGET_KERNEL_ARCH}} \
    HOSTCC="${TOOLCHAIN}/bin/host-gcc" \
    HOSTCXX="${TOOLCHAIN}/bin/host-g++" \
    HOSTCFLAGS="${HOST_CFLAGS}" \
    HOSTCXXFLAGS="${HOST_CXXFLAGS}" \
    HOSTLDFLAGS="${HOST_LDFLAGS}" \
    headers_check
}

makeinstall_host() {
  make \
    ARCH=${HEADERS_ARCH:-${TARGET_KERNEL_ARCH}} \
    HOSTCC="${TOOLCHAIN}/bin/host-gcc" \
    HOSTCXX="${TOOLCHAIN}/bin/host-g++" \
    HOSTCFLAGS="${HOST_CFLAGS}" \
    HOSTCXXFLAGS="${HOST_CXXFLAGS}" \
    HOSTLDFLAGS="${HOST_LDFLAGS}" \
    INSTALL_HDR_PATH=dest \
    headers_install
  mkdir -p ${SYSROOT_PREFIX}/usr/include
    cp -R dest/include/* ${SYSROOT_PREFIX}/usr/include
}
Comment 11 rudi 2021-04-28 12:16:07 UTC
Created attachment 50700 [details]
Config.log

As requested by Richard
Comment 12 rudi 2021-04-28 12:16:45 UTC
(In reply to Richard Biener from comment #5)
> (In reply to rudi from comment #4)
> > .x86_64-linux-gnu-bootstrap/x86_64-libreelec-linux-gnu/libgcc/config.log
> > http://paste.ubuntu.com/p/Y6wFsSBdqv/
> 
> I wonder if you can attach this logfile in this bug instead?  pastes tend
> to time out and I can't download the raw text from there w/o creating an
> account (huh?!).

Attached.
Comment 13 rudi 2021-04-30 07:11:31 UTC
I have looked further into this; and here are the locations of sys/mman.h, this include comes from the glibc package. gcc builds in package #80, whilst glibc builds in package #82. The dependancies - given the way the gcc11 configure script works (and must be pulling from /usr/include/x86_64-linux-gnu/sys/mman.h) is a recursive dependency.

Here are the packages in question. gcc:bootstrap does not have a glibc dependency.

== gcc package ==
PKG_NAME="gcc"
PKG_DEPENDS_BOOTSTRAP="ccache:host autoconf:host binutils:host gmp:host mpfr:host mpc:host zstd:host"
PKG_DEPENDS_TARGET="toolchain"
PKG_DEPENDS_HOST="ccache:host autoconf:host binutils:host gmp:host mpfr:host mpc:host zstd:host glibc"
PKG_DEPENDS_INIT="toolchain"

== glibc package ==
PKG_NAME="glibc"
PKG_DEPENDS_TARGET="ccache:host autotools:host linux:host gcc:bootstrap pigz:host Python3:host"
PKG_DEPENDS_INIT="glibc"

== here is the actual creation of mman.h (using gcc10.3.0) ==
grep sys/mman.h 82.log /usr/bin/install -c -m 644 sys/mman.h /storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/.sysroot/glibc.target/usr/include/sys/mman.h
/usr/bin/install -c -m 644 sys/mman.h /storage/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/install_pkg/glibc-2.33/usr/include/sys/mman.h

== the find after a full build ==
find . -name mman.h | grey sys/
./build.LibreELEC-Generic.x86_64-10.0-devel/install_pkg/glibc-2.33/usr/include/sys/mman.h
./build.LibreELEC-Generic.x86_64-10.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/sys/mman.h
./build.LibreELEC-Generic.x86_64-10.0-devel/build/glibc-2.33/misc/sys/mman.h
./build.LibreELEC-Generic.x86_64-10.0-devel/build/glibc-2.33/include/sys/mman.h
./build.LibreELEC-Generic.x86_64-10.0-devel/build/gcc-10.3.0/fixincludes/tests/base/sys/mman.h
./build.LibreELEC-Generic.x86_64-10.0-devel/build/xorg-intel-gpu-tools-1.26/lib/stubs/syscalls/sys/mman.h
Comment 14 Richard Biener 2021-07-28 07:06:30 UTC
GCC 11.2 is being released, retargeting bugs to GCC 11.3
Comment 15 rudi 2021-07-28 11:34:25 UTC
I can confirm issue still occurring with 11.2.0

In file included from /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/gcc-11.2.0/libgcc/libgcov-merge.c:26:
/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-10.0-devel/build/gcc-11.2.0/libgcc/libgcov.h:49:10: fatal error: sys/mman.h: No such file or directory
   49 | #include <sys/mman.h>
      |          ^~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:921: _gcov_merge_add.o] Error 1
Comment 16 Joerg Wunsch 2022-02-18 22:30:41 UTC
Can confirm this bug when building an AVR cross-compiler (11.2) on FreeBSD.

To get it working, I'm now patching it to #undef HAVE_SYS_MMAN_H in libgcov.h before starting.
Comment 17 rudi 2022-02-20 10:21:04 UTC
Hi Joerg, 

I saw your comment and took it as a prompt. I fixed the LE toolchain with your patch. I thought about it further and then used --disable-gcov as the gcc:bootstrap - leaving HAVE_SYS_MMAN_H defined for the gcc:host target. Thus I did not end up using the #undef / your patch. Given that the “gcc:bootstrap with gcov” would not be used once the gcc:host is built.

The PR is at https://github.com/LibreELEC/LibreELEC.tv/pull/6253

The issue is still there during the bootstrap build, but maybe --disable-gcov might help you in your cross compile toolchain too.

The LE toolchain builds “target” as a cross compile even if the triple is the same. The usual build host is x86_64 though build are also done on aarch64 as well.
Comment 18 Joerg Wunsch 2022-02-20 13:40:18 UTC
(In reply to rudi from comment #17)

> The issue is still there during the bootstrap build, but maybe
> --disable-gcov might help you in your cross compile toolchain too.

Yes, --disable-gcov does help as well.

I just wasn't sure whether having gcov support might make sense on a cross-compiler or not, and as the FreeBSD port did have it enabled before, I was merely tempted to do it that way.

But yes, it's probably questionable whether anyone would really run gcov on an AVR. ;-)
Comment 19 Richard Biener 2022-04-21 07:49:13 UTC
GCC 11.3 is being released, retargeting bugs to GCC 11.4.
Comment 20 Jan-Benedict Glaw 2023-03-31 18:43:57 UTC
I see this as well for my CI builds using a (slightly hacked to use local copies of the GIT trees) build-many-glibcs.py (from glibc.)

If you call call:

/var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/glibc/scripts/build-many-glibcs.py --keep all --replace-sources -j 1 /var/lib/laminar/run/glibcbot-alpha-linux-gnu/21 checkout binutils-vcs-master gcc-vcs-master glibc-vcs-master linux-vcs-master

log_execute host-libraries /var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/glibc/scripts/build-many-glibcs.py --keep all --replace-sources -j 1 /var/lib/laminar/run/glibcbot-alpha-linux-gnu/21 host-libraries

log_execute compilers /var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/glibc/scripts/build-many-glibcs.py --keep all --replace-sources -j 1 /var/lib/laminar/run/glibcbot-alpha-linux-gnu/21 --full-gcc compilers alpha-linux-gnu

(as an example, use the Alpha builds at http://toolchain.lug-owl.de/laminar/jobs/glibcbot-alpha-linux-gnu , with the actual breakage for example at http://toolchain.lug-owl.de/archive/glibcbot-alpha-linux-gnu/21/logs/compilers/alpha-linux-gnu/012-compilers-alpha-linux-gnu-gcc-first-build-log.txt)

...we're ending up at the same spot:
  echo 'int __libgcc_eh_dummy;' > eh_dummy.c;		\
  /var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/build/compilers/alpha-linux-gnu/gcc-first/./gcc/xgcc -B/var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/build/compilers/alpha-linux-gnu/gcc-first/./gcc/ -B/var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/install/compilers/alpha-linux-gnu/alpha-glibc-linux-gnu/bin/ -B/var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/install/compilers/alpha-linux-gnu/alpha-glibc-linux-gnu/lib/ -isystem /var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/install/compilers/alpha-linux-gnu/alpha-glibc-linux-gnu/include -isystem /var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/install/compilers/alpha-linux-gnu/alpha-glibc-linux-gnu/sys-include    -g -O2 -mieee -O2  -g -O2 -mieee -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -mieee -mfp-rounding-mode=d -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -fPIC -mieee -mfp-rounding-mode=d -I. -I. -I../.././gcc -I/var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/src/gcc/libgcc -I/var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/src/gcc/libgcc/. -I/var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/src/gcc/libgcc/../gcc -I/var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/src/gcc/libgcc/../include  -DHAVE_CC_TLS   -fvisibility=hidden -DHIDE_EXPORTS -c eh_dummy.c		\
     -o eh_dummy.o;				\
  objects=eh_dummy.o;				\
fi;							\
/var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/install/compilers/alpha-linux-gnu/alpha-glibc-linux-gnu/bin/ar  rc libgcc.a $objects
/var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/install/compilers/alpha-linux-gnu/alpha-glibc-linux-gnu/bin/ranlib libgcc.a
/var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/build/compilers/alpha-linux-gnu/gcc-first/./gcc/xgcc -B/var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/build/compilers/alpha-linux-gnu/gcc-first/./gcc/ -B/var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/install/compilers/alpha-linux-gnu/alpha-glibc-linux-gnu/bin/ -B/var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/install/compilers/alpha-linux-gnu/alpha-glibc-linux-gnu/lib/ -isystem /var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/install/compilers/alpha-linux-gnu/alpha-glibc-linux-gnu/include -isystem /var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/install/compilers/alpha-linux-gnu/alpha-glibc-linux-gnu/sys-include    -g -O2 -mieee -O2  -g -O2 -mieee -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -mieee -mfp-rounding-mode=d -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -fPIC -mieee -mfp-rounding-mode=d -I. -I. -I../.././gcc -I/var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/src/gcc/libgcc -I/var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/src/gcc/libgcc/. -I/var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/src/gcc/libgcc/../gcc -I/var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/src/gcc/libgcc/../include  -DHAVE_CC_TLS   -o _gcov_merge_add.o -MT _gcov_merge_add.o -MD -MP -MF _gcov_merge_add.dep -DL_gcov_merge_add -c /var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/src/gcc/libgcc/libgcov-merge.c
In file included from /var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/src/gcc/libgcc/libgcov-merge.c:26:
/var/lib/laminar/run/glibcbot-alpha-linux-gnu/21/src/gcc/libgcc/libgcov.h:49:10: fatal error: sys/mman.h: No such file or directory
   49 | #include <sys/mman.h>
      |          ^~~~~~~~~~~~
compilation terminated.



ISTR that it worked without --full-gcc (which enables all languages), so I wonder if I'd try a build round with --disable-gcov and maybe submit a patch for glibc's build-many-glibcs.py?
Comment 21 Jan-Benedict Glaw 2023-03-31 18:55:13 UTC
But the basic question is: Should a first build pass --disable-gcov (glibc's failure to provide this) or should GCC detect that there's (not yet) no sys/mman.h (GCC problem)?
Comment 22 Jakub Jelinek 2023-05-29 10:04:35 UTC
GCC 11.4 is being released, retargeting bugs to GCC 11.5.