为 moka 手机构建 ubuntu touch 时出错

为 moka 手机构建 ubuntu touch 时出错

我正在尝试为 moka 手机构建 ubuntu touch 但出现以下错误:

host C: libext2_e2p_host <= external/e2fsprogs/lib/e2p/feature.c

host SharedLib: libext2_e2p_host (phablet/out/host/linux-x86/obj/lib/libext2_e2p_host.so)

phablet/out/host/linux-x86/obj/SHARED_LIBRARIES/libext2_e2p_host_intermediates/feature.o: in function "ext2fs_mark_block_bitmap":


phablet/external/e2fsprogs/lib/ext2fs/bitops.h:303: undefined reference to "ext2fs_mark_generic_bitmap"

collect2: error: ld returned 1 exit status

build/core/host_shared_library.mk:44: set di istruzioni per l'obiettivo "phablet/out/host/linux-x86/obj/lib/libext2_e2p_host.so" non riuscito

make: *** [phablet/out/host/linux-x86/obj/lib/libext2_e2p_host.so] Errore 1

与“phablet-dev-bootstrap phablet”同步后,我使用了以下命令:

. build/envsetup.sh

lunch

我选择了 10 号摩卡壶

make

答案1

该问题是由于 gcc 版本较新导致的,gcc-4.8 的小版本差异会导致该问题,
后续版本需要定义并实现 inline 函数,
可以在命令行中定义 NO_INLINE_FUNCS 或者打上以下补丁:

diff --git a/lib/ext2fs/bitops.h b/lib/ext2fs/bitops.h
index 32111ba..375d140 100644
--- a/lib/ext2fs/bitops.h
+++ b/lib/ext2fs/bitops.h
@@ -118,6 +118,8 @@ extern int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap,
 extern __u32 ext2fs_get_generic_bitmap_start(ext2fs_generic_bitmap bitmap);
 extern __u32 ext2fs_get_generic_bitmap_end(ext2fs_generic_bitmap bitmap);

+#define NO_INLINE_FUNCS
+
 /*
  * The inline routines themselves...
  *
@@ -145,6 +147,7 @@ extern __u32 ext2fs_get_generic_bitmap_end(ext2fs_generic_bitmap bitmap);
 #endif
 #endif

+
 /*
  * Fast bit set/clear functions that doesn't need to return the
  * previous bit value.

相关内容