-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[compiler-rt] error: multiple definition of 'enum fsconfig_command' #56421
Comments
Can you share detailed reproduce instructions? I have built latest glibc in With cmake The
glibc 7eae6a91e9b1670330c9f15730082c91c0b1d570 triggered this. |
…mount_attr conflict with glibc 2.36 It is generally not a good idea to mix usage of glibc headers and Linux UAPI headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h defines `fsconfig_command` which conflicts with linux/mount.h: .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’ Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually. Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h. In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp but this commit is easy to cherry pick into older compiler-rt releases. Fix #56421 Reviewed By: #sanitizers, vitalybuka, zatrazz Differential Revision: https://reviews.llvm.org/D129471
9cf1306 is the commit to cherry pick into older compiler-rt if you want to build those packages on glibc 2.36 (will be released soon in 2022-08). |
…mount_attr conflict with glibc 2.36 It is generally not a good idea to mix usage of glibc headers and Linux UAPI headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h defines `fsconfig_command` which conflicts with linux/mount.h: .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’ Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually. Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h. In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp but this commit is easy to cherry pick into older compiler-rt releases. Fix llvm#56421 Reviewed By: #sanitizers, vitalybuka, zatrazz Differential Revision: https://reviews.llvm.org/D129471 Signed-off-by: Khem Raj <raj.khem@gmail.com>
Can you please cherry-pick the commit for LLVM 14 branch? |
@marxin: 14 branch is not longer supported. |
Hm, but version 15 hasn't been released yet, right? |
Fixes are backported to 15. |
But why don't you have an overlap in between supported branches? Note that right now, there is no stable LLVM release that would contain this change and so that can co-exist with glibc 2.39. Sigh. |
CC @tstellar for questions about release branch processes. |
…mount_attr conflict with glibc 2.36 It is generally not a good idea to mix usage of glibc headers and Linux UAPI headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h defines `fsconfig_command` which conflicts with linux/mount.h: .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’ Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually. Fix llvm/llvm-project#56421 Reviewed By: #sanitizers, vitalybuka, zatrazz Differential Revision: https://reviews.llvm.org/D129471
…mount_attr conflict with glibc 2.36 It is generally not a good idea to mix usage of glibc headers and Linux UAPI headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h defines `fsconfig_command` which conflicts with linux/mount.h: .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’ Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually. Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h. In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp but this commit is easy to cherry pick into older compiler-rt releases. Fix llvm/llvm-project#56421 Reviewed By: #sanitizers, vitalybuka, zatrazz Differential Revision: https://reviews.llvm.org/D129471
…mount_attr conflict with glibc 2.36 It is generally not a good idea to mix usage of glibc headers and Linux UAPI headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h defines `fsconfig_command` which conflicts with linux/mount.h: .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’ Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually. Fix llvm/llvm-project#56421 Reviewed By: #sanitizers, vitalybuka, zatrazz Differential Revision: https://reviews.llvm.org/D129471
…mount_attr conflict with glibc 2.36 It is generally not a good idea to mix usage of glibc headers and Linux UAPI headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h defines `fsconfig_command` which conflicts with linux/mount.h: .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’ Remove #include <linux/fs.h> which pulls in linux/mount.h. Expand its 4 macros manually. Android sys/mount.h doesn't define BLKBSZGET and it still needs linux/fs.h. In the long term we should move Linux specific definitions to sanitizer_platform_limits_linux.cpp but this commit is easy to cherry pick into older compiler-rt releases. Fix llvm/llvm-project#56421 Reviewed By: #sanitizers, vitalybuka, zatrazz Differential Revision: https://reviews.llvm.org/D129471
When compiling older GCC versions in newer machines, libsanitizer does not compile, showing a error: `multiple definition of 'enum fsconfig_command'` (e.g. llvm/llvm-project#56421). This is because starting from Glibc 2.36, it is not possible to include both "linux/fs.h" and "sys/mount.h". We can apply a patch, similar to the one in https://reviews.llvm.org/D129471 , but with the extension and lines changed to match the file. This is also similar to the upstream fix.
When compiling older GCC versions in newer machines, libsanitizer does not compile, showing a error: `multiple definition of 'enum fsconfig_command'` (e.g. llvm/llvm-project#56421). This is because starting from Glibc 2.36, it is not possible to include both "linux/fs.h" and "sys/mount.h". We can apply a patch, similar to the one in https://reviews.llvm.org/D129471 , but with the extension and lines changed to match the file. This is also similar to the upstream fix. See merge request nexedi/slapos!1579
libsanitizer fails to build with the very latest glibc:
The text was updated successfully, but these errors were encountered: