瀏覽代碼

coreutils: Disable statx for native build

The statx requires glibc >= 2.28 and linux kernel >= 4.11, but coreutils's
configure only checks glibc compatibility for statx syscall but fail to check
kernel support, e.g.:

RedHat Enterprise Linux Server 7.6 (Maipo)
Host kernel: 3.10.0-1127.8.2.el7.x86_64
Docker OS: Ubuntu 20.04.1 LTS

$ bitbake coreutils-native
find the binary ls and run it as "ls -l ."
The result is something like: "?????????. ? ? ? ? ? foo"

This is because glibc is 2.31 (Ubunut 20.04 in docker) which has statx,
but host's kernel is 3.10.0 (CentOS 7) which doesn't support statx.

Disable statx for native build to fix the problem.

Original from: Davi Poyastro <davi.poyastro@nokia.com>
(From OE-Core rev: 6c120d8856fab044e7b8e09d6de91c2b228a2dd9)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Robert Yang 3 年之前
父節點
當前提交
5ce1060e3a
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      meta/recipes-core/coreutils/coreutils_9.0.bb

+ 7 - 0
meta/recipes-core/coreutils/coreutils_9.0.bb

@@ -151,6 +151,13 @@ ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
 ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
 ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
 
+# The statx() requires glibc >= 2.28 and linux kernel >= 4.11, it doesn't work
+# when glibc >= 2.28 ((Ubuntu 20.04 in docker) and kernel < 4.11 (Host OS
+# CentOS 7), we can check kernel version and disable it, but that would cause
+# two different signatures for coreutils-native, so disable it unconditionally
+# for deterministic build.
+EXTRA_OECONF:append:class-native = " ac_cv_func_statx=0"
+
 python __anonymous() {
     for prog in d.getVar('base_bindir_progs').split():
         d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))