libarchive: fix ext2fs build race error condition
authorPetr Štetiar <ynezz@true.cz>
Thu, 16 Jun 2022 11:38:11 +0000 (13:38 +0200)
committerRosen Penev <rosenp@gmail.com>
Wed, 6 Jul 2022 06:00:30 +0000 (23:00 -0700)
libarchive looks for ext2fs headers during configure, and if it finds
them it will expect to find them during compile, or on the rare occasion
when they aren't it will fail:

 libarchive/archive_entry.c:59:55: fatal error: ext2fs/ext2_fs.h: No such file or directory

As we just need headers for some type constants, let's re-use headers
from tools/e2fsprogs package which are always available.

Reported-by: Adam Dov <adov@maxlinear.com>
Suggested-by: Paul Eggleton <paul.eggleton@linux.intel.com>
References: https://git.yoctoproject.org/poky/commit/?id=f0b9a7cf9f80be1917e45266fa201f464a28c1e5
Signed-off-by: Petr Štetiar <ynezz@true.cz>
libs/libarchive/Makefile

index 23d6341b197f014b62faf345b7c133129f800f57..d871e88d0a76367d06f5af437c879ac2b84864de 100644 (file)
@@ -104,6 +104,14 @@ else
        CMAKE_OPTIONS += -DENABLE_OPENSSL=ON
 endif
 
+EXTRA_CFLAGS += "-I$(PKG_BUILD_DIR)/extra-includes"
+
+define Build/Configure
+       $(INSTALL_DIR) $(PKG_BUILD_DIR)/extra-includes/
+       $(CP) -R $(STAGING_DIR_HOST)/include/ext2fs $(PKG_BUILD_DIR)/extra-includes/
+       $(Build/Configure/Default)
+endef
+
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
        $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/