FS#75695 - [glibc] 2.36-3 conflicting definitions between <linux/mount.h> and <sys/mount.h>

Attached to Project: Arch Linux
Opened by Mike Schuchardt (shoecart) - Thursday, 25 August 2022, 22:16 GMT
Last edited by freswa (frederik) - Wednesday, 05 October 2022, 14:36 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To freswa (frederik)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
glibc 2.36 contains new mount configuration APIs which conflict with definitions from /usr/include/linux/mount.h. This issue has already been fixed in upstream glibc and backported to the 2.36 release branch.

https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/release/2.36/master

With the current glibc package 2.36-3 I get the following compilation error when building gcc10 from AUR:

libtool: compile: /home/mike/.cache/yay/gcc10/src/gcc-build/./gcc/xgcc -shared-libgcc -B/home/mike/.cache/yay/gcc10/src/gcc-build/./gcc -nostdinc++ -L/home/mike/.cache/yay/gcc10/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src -
L/home/mike/.cache/yay/gcc10/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/home/mike/.cache/yay/gcc10/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-lin
ux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DHAVE_RPC_XDR_H=0 -DHAVE_TIRPC_RPC_XD
R_H=0 -I. -I/home/mike/.cache/yay/gcc10/src/gcc/libsanitizer/sanitizer_common -I.. -I /home/mike/.cache/yay/gcc10/src/gcc/libsanitizer/include -I /home/mike/.cache/yay/gcc10/src/gcc/libsanitizer -isystem /home/mike/.cache/yay/gcc10
/src/gcc/libsanitizer/include/system -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros
-I../../libstdc++-v3/include -I../../libstdc++-v3/include/x86_64-pc-linux-gnu -I/home/mike/.cache/yay/gcc10/src/gcc/libsanitizer/../libstdc++-v3/libsupc++ -std=gnu++11 -fcf-protection -mshstk -DSANITIZER_LIBBACKTRACE -DSANITIZER_C
P_DEMANGLE -I /home/mike/.cache/yay/gcc10/src/gcc/libsanitizer/../libbacktrace -I ../libbacktrace -I /home/mike/.cache/yay/gcc10/src/gcc/libsanitizer/../include -include /home/mike/.cache/yay/gcc10/src/gcc/libsanitizer/libbacktrace
/backtrace-rename.h -g -march=x86-64 -mtune=generic -O2 -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -MT sanitizer_procmaps_solaris.lo -MD -
MP -MF .deps/sanitizer_procmaps_solaris.Tpo -c /home/mike/.cache/yay/gcc10/src/gcc/libsanitizer/sanitizer_common/sanitizer_procmaps_solaris.cpp -o sanitizer_procmaps_solaris.o >/dev/null 2>&1
libtool: compile: /home/mike/.cache/yay/gcc10/src/gcc-build/./gcc/xgcc -shared-libgcc -B/home/mike/.cache/yay/gcc10/src/gcc-build/./gcc -nostdinc++ -L/home/mike/.cache/yay/gcc10/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src -
L/home/mike/.cache/yay/gcc10/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/home/mike/.cache/yay/gcc10/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-lin
ux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DHAVE_RPC_XDR_H=0 -DHAVE_TIRPC_RPC_XD
R_H=0 -I. -I/home/mike/.cache/yay/gcc10/src/gcc/libsanitizer/sanitizer_common -I.. -I /home/mike/.cache/yay/gcc10/src/gcc/libsanitizer/include -I /home/mike/.cache/yay/gcc10/src/gcc/libsanitizer -isystem /home/mike/.cache/yay/gcc10
/src/gcc/libsanitizer/include/system -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros
-I../../libstdc++-v3/include -I../../libstdc++-v3/include/x86_64-pc-linux-gnu -I/home/mike/.cache/yay/gcc10/src/gcc/libsanitizer/../libstdc++-v3/libsupc++ -std=gnu++11 -fcf-protection -mshstk -DSANITIZER_LIBBACKTRACE -DSANITIZER_C
P_DEMANGLE -I /home/mike/.cache/yay/gcc10/src/gcc/libsanitizer/../libbacktrace -I ../libbacktrace -I /home/mike/.cache/yay/gcc10/src/gcc/libsanitizer/../include -include /home/mike/.cache/yay/gcc10/src/gcc/libsanitizer/libbacktrace
/backtrace-rename.h -g -march=x86-64 -mtune=generic -O2 -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -MT sanitizer_rtems.lo -MD -MP -MF .dep
s/sanitizer_rtems.Tpo -c /home/mike/.cache/yay/gcc10/src/gcc/libsanitizer/sanitizer_common/sanitizer_rtems.cpp -fPIC -DPIC -o .libs/sanitizer_rtems.o
In file included from /usr/include/linux/fs.h:19,
from /home/mike/.cache/yay/gcc10/src/gcc/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:75:
/usr/include/linux/mount.h:95:6: error: multiple definition of ‘enum fsconfig_command’
95 | enum fsconfig_command {
| ^~~~~~~~~~~~~~~~
In file included from /home/mike/.cache/yay/gcc10/src/gcc/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:62:
/usr/include/sys/mount.h:189:6: note: previous definition here
189 | enum fsconfig_command
| ^~~~~~~~~~~~~~~~
In file included from /usr/include/linux/fs.h:19,
from /home/mike/.cache/yay/gcc10/src/gcc/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:75:
/usr/include/linux/mount.h:129:8: error: redefinition of ‘struct mount_attr’
129 | struct mount_attr {
| ^~~~~~~~~~
In file included from /home/mike/.cache/yay/gcc10/src/gcc/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:62:
/usr/include/sys/mount.h:161:8: note: previous definition of ‘struct mount_attr’
161 | struct mount_attr
| ^~~~~~~~~~

This task depends upon

Closed by  freswa (frederik)
Wednesday, 05 October 2022, 14:36 GMT
Reason for closing:  Fixed
Additional comments about closing:  2.36-5
Comment by freswa (frederik) - Thursday, 25 August 2022, 22:39 GMT
You can just backport f29c845782c43bda89820566648b921203bb967b from the gcc repo to gcc10 and the mentioned issue will probably be gone.
Since many upstreams adapted to the current header situation, I'll rather wait a few days/weeks until glibc is sure about their intentions with the header files.
Comment by Csaba Henk (csheemea) - Thursday, 01 September 2022, 22:29 GMT
I also hit this bug with another application (glusterfs).

From user POV, I think there is not much point in working this around at application level (that is, if you have administrative privileges on the system where you are facing this).

If you have, replacing /usr/include/sys/mount.h with the mount.h from the upstream Glibc commit that fixes this:

https://sourceware.org/git/?p=glibc.git;a=commit;h=bb1e8b0ca99b5cbedfae3e6245528a87d95ff3e2

solves the issue for good until Arch gets to the point that it can ship a Glibc package that incorporates this change.

(For convenience, said instance of mount.h:

https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=sysdeps/unix/sysv/linux/sys/mount.h;h=2e3fd6a7fe6b38f32c2563512719a4ad76d73794;hb=bb1e8b0ca99b5cbedfae3e6245528a87d95ff3e2)
Comment by Antony (checkdgt) - Tuesday, 06 September 2022, 10:37 GMT
Huge thank you to @csheemea. Spent the better part of an evening trying to figure out why compiler-rt8 wouldn't build and this saved my bacon!

I've mentioned this on the compiler-rt8 comments in the AUR so hopefully someone else having the same issue doesn't have to go through the same pain.

Loading...