ned14 / llfio

P1031 low level file i/o and filesystem library for the C++ standard
https://ned14.github.io/llfio/
Other
880 stars 45 forks source link

`glibc` 2.36 `sys/mount.h` incompatibility with `linux/mount.h` #97

Closed BurningEnlightenment closed 1 year ago

BurningEnlightenment commented 2 years ago

Building llfio with glibc 2.36 fails due to detail/impl/posix/storage_profile.ipp including linux/fs.h (including linux/mount.h) and detail/impl/posix/statfs.ipp including sys/mount.h:

/usr/sbin/c++ -DLLFIO_DYNAMIC_THREAD_POOL_GROUP_USING_GCD=0 -DLLFIO_ENABLE_TEST_IO_MULTIPLEXERS=1 -DLLFIO_INCLUDE_STORAGE_PROFILE=1 -DLLFIO_SOURCE=1 -DLLFIO_STATIC_LINK=1 -DQUICKCPPLIB_ENABLE_VALGRIND=1 -isystem /root/ldevel/vcpkg/installed/x64-linux/include -fPIC -g -fPIC -fexceptions -frtti -fstack-protector-strong -fconcepts -fcoroutines -Wall -Wextra -std=gnu++20 -MD -MT CMakeFiles/llfio_sl.dir/src/llfio.cpp.o -MF CMakeFiles/llfio_sl.dir/src/llfio.cpp.o.d -o CMakeFiles/llfio_sl.dir/src/llfio.cpp.o -c /root/ldevel/vcpkg/buildtrees/llfio/src/c8406280fa-2f2d7fa4bd.clean/src/llfio.cpp
In file included from /usr/include/linux/fs.h:19,
                 from /root/ldevel/vcpkg/buildtrees/llfio/src/c8406280fa-2f2d7fa4bd.clean/src/../include/llfio/v2.0/detail/impl/posix/storage_profile.ipp:32,
                 from /root/ldevel/vcpkg/buildtrees/llfio/src/c8406280fa-2f2d7fa4bd.clean/src/../include/llfio/v2.0/detail/impl/storage_profile.ipp:1371,
                 from /root/ldevel/vcpkg/buildtrees/llfio/src/c8406280fa-2f2d7fa4bd.clean/src/../include/llfio/v2.0/storage_profile.hpp:407,
                 from /root/ldevel/vcpkg/buildtrees/llfio/src/c8406280fa-2f2d7fa4bd.clean/src/../include/llfio/v2.0/llfio.hpp:74,
                 from /root/ldevel/vcpkg/buildtrees/llfio/src/c8406280fa-2f2d7fa4bd.clean/src/../include/llfio/llfio.hpp:18,
                 from /root/ldevel/vcpkg/buildtrees/llfio/src/c8406280fa-2f2d7fa4bd.clean/src/llfio.cpp:7:
/usr/include/linux/mount.h:95:6: error: multiple definition of ‘enum fsconfig_command’
   95 | enum fsconfig_command {
      |      ^~~~~~~~~~~~~~~~
In file included from /root/ldevel/vcpkg/buildtrees/llfio/src/c8406280fa-2f2d7fa4bd.clean/src/../include/llfio/v2.0/detail/impl/../../detail/impl/../../detail/impl/posix/statfs.ipp:32,
                 from /root/ldevel/vcpkg/buildtrees/llfio/src/c8406280fa-2f2d7fa4bd.clean/src/../include/llfio/v2.0/detail/impl/../../detail/impl/../../statfs.hpp:157,
                 from /root/ldevel/vcpkg/buildtrees/llfio/src/c8406280fa-2f2d7fa4bd.clean/src/../include/llfio/v2.0/detail/impl/../../detail/impl/path_discovery.ipp:28,
                 from /root/ldevel/vcpkg/buildtrees/llfio/src/c8406280fa-2f2d7fa4bd.clean/src/../include/llfio/v2.0/detail/impl/../../file_handle.hpp:552,
                 from /root/ldevel/vcpkg/buildtrees/llfio/src/c8406280fa-2f2d7fa4bd.clean/src/../include/llfio/v2.0/detail/impl/dynamic_thread_pool_group.ipp:27,
                 from /root/ldevel/vcpkg/buildtrees/llfio/src/c8406280fa-2f2d7fa4bd.clean/src/../include/llfio/v2.0/dynamic_thread_pool_group.hpp:526,
                 from /root/ldevel/vcpkg/buildtrees/llfio/src/c8406280fa-2f2d7fa4bd.clean/src/../include/llfio/v2.0/llfio.hpp:67:
/usr/include/sys/mount.h:191:6: note: previous definition here
  191 | enum fsconfig_command
      |      ^~~~~~~~~~~~~~~~
/usr/include/linux/mount.h:129:8: error: redefinition of ‘struct mount_attr’
  129 | struct mount_attr {
      |        ^~~~~~~~~~
/usr/include/sys/mount.h:162:8: note: previous definition of ‘struct mount_attr’
  162 | struct mount_attr
      |        ^~~~~~~~~~

This new incompatibility has been documented in the glibc wiki. According to this mailing thread the glibc maintainers are aware of this and will likely workaround this within the glibc sources in a few weeks. Currently this only affects rolling linux distributions living at the bleeding edge like Arch Linux. So I don't think it's worth to be patched here.

BurningEnlightenment commented 1 year ago

The situation has been resolved upstream (see commit on master and cherry-pick on 2.36 release)