Commit cf1bf7dd authored by Carlos Ramos Carreño's avatar Carlos Ramos Carreño

Fix libarchive for CMake in newer machines.

When compiling CMake, libarchive does not compile, showing a error:
`multiple definition of 'enum fsconfig_command'` (e.g.
https://discourse.cmake.org/t/building-cmake-from-source-on-linux-fedora-37/7519/4).
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://patchwork.yoctoproject.org/project/oe-core/patch/20220728143044.1696098-1-raj.khem@gmail.com/ ,
but with the filenames and lines changed to match the correct file.

Note that this error is the same in !1579 but for a different component.
parent 76642bf9
......@@ -14,3 +14,7 @@ md5sum = ab3c9ed9578cdb496a252c6733989d78
environment =
CMAKE_INCLUDE_PATH=${ncurses:location}/include:${openssl:location}/include
CMAKE_LIBRARY_PATH=${ncurses:location}/lib:${openssl:location}/lib
patch-binary = ${patch:location}/bin/patch
patch-options = -p1
patches =
${:_profile_base_location_}/cmake-libarchive-multiple-definition-fsconfig_command.patch#cb281d372ac0d90ccd5b3c8cb50cc734
--- a/Utilities/cmlibarchive/libarchive/archive_read_disk_posix.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_disk_posix.c
@@ -34,9 +34,6 @@
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
-#ifdef HAVE_SYS_MOUNT_H
-#include <sys/mount.h>
-#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
@@ -54,6 +51,8 @@
#endif
#ifdef HAVE_LINUX_FS_H
#include <linux/fs.h>
+#elif defined(HAVE_SYS_MOUNT_H)
+#include <sys/mount.h>
#endif
/*
* Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment