Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gcc: exclude malformed
sys/mount.h
from fixed headers directory
Previously, builds such as `cmake` would fail with errors like this: In file included from /nix/store/injyphmxqgi028skp28fsmdvbdb57nvl-glibc-2.36-48-dev/include/linux/fs.h:19, from /build/cmake-3.24.2/Utilities/cmlibarchive/libarchive/archive_read_disk_posix.c:56: /nix/store/injyphmxqgi028skp28fsmdvbdb57nvl-glibc-2.36-48-dev/include/linux/mount.h:95:6: error: redeclaration of 'enum fsconfig_command' 95 | enum fsconfig_command { | ^~~~~~~~~~~~~~~~ The reason behind that is that the kernel exports `linux/mount.h` via kernel headers APIs that are also defined in `sys/mount.h` from glibc. To avoid clashes, safeguards were implemented in glibc to prevent this from happening[1][2]. However, these `#ifndef`-safeguards are removed by `fixincludes` during gcc's build and the (broken) result is subsequently copied into `include-fixed/sys/mount.h` which is added to each build via the cc-wrapper. To work around this, I decided to simply drop the file: it also exists in glibc's output and our gcc12 doesn't seem to expose this anymore anyways. [1] Commit bb1e8b0ca99b5cbedfae3e6245528a87d95ff3e2 [2] Commit 3bd3c612e98a53ce60ed972f5cd2b90628b3cba5
- Loading branch information