Skip to contentSkip to conversation

coreutils: fix statx failure on native builds

PATCH In review Robert Yang 2 participants 6 messages Mar 1, 2022

lore
Share & tools
lore
#0 lore raw

cover coreutils: fix statx failure on native builds

The following changes since commit b1bb4e2d73985c6e8cf03b0fea94e8b739648cf7:

flit_core: inherit setuptools3-base (2022-02-27 12:34:05 +0000)

are available in the Git repository at:

git://git.openembedded.org/openembedded-core-contrib rbt/coreutils
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/coreutils

Davi Poyastro (1):
coreutils: fix statx failure on native builds

 meta/recipes-core/coreutils/coreutils_9.0.bb | 5 +++++
 1 file changed, 5 insertions(+)
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/1 coreutils: fix statx failure on native builds

From: Davi Poyastro <[email protected]>

Coreutils configure only checks glibc compatibility for statx syscall but fail to check kernel support.

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

$ bitbake coreutils-native
find the binary ls and run it as "ls -l ."
The result is something like: "?????????. ? ? ? ? ? foo"
---
 meta/recipes-core/coreutils/coreutils_9.0.bb | 5 +++++
 1 file changed, 5 insertions(+)
meta/recipes-core/coreutils/coreutils_9.0.bb +5 -0
index e4633949f42..40fad72bbf4 100644
@@ -152,6 +152,11 @@ ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
 ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
 
 python __anonymous() {
+    from distutils.version import LooseVersion
+    # statx syscall require glibc >= 2.28 and linux kernel >= 4.11
+    if LooseVersion(os.uname().release) < LooseVersion('4.11'):
+        d.appendVar("EXTRA_OECONF_class-native", " ac_cv_func_statx=0")
+
     for prog in d.getVar('base_bindir_progs').split():
         d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
 
Signature · 1 line
2.31.1
#2 lore raw
Quoted 24 lines · Robert Yang

From: Davi Poyastro <[email protected]>

Coreutils configure only checks glibc compatibility for statx syscall but fail to check kernel support.

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

$ bitbake coreutils-native
find the binary ls and run it as "ls -l ."
The result is something like: "?????????. ? ? ? ? ? foo"
---
 meta/recipes-core/coreutils/coreutils_9.0.bb | 5 +++++
 1 file changed, 5 insertions(+)
meta/recipes-core/coreutils/coreutils_9.0.bb +0 -0
index e4633949f42..40fad72bbf4 100644

meta/recipes-core/coreutils/coreutils_9.0.bb ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1" · line 159

Quoted 8 lines
meta/recipes-core/coreutils/coreutils_9.0.bb +5 -0
@@ -152,6 +152,11 @@ ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
 ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
 
 python __anonymous() {
+    from distutils.version import LooseVersion
+    # statx syscall require glibc >= 2.28 and linux kernel >= 4.11
+    if LooseVersion(os.uname().release) < LooseVersion('4.11'):
+        d.appendVar("EXTRA_OECONF_class-native", " ac_cv_func_statx=0")
+

Shouldn't that be EXTRA_OECONF:class-native?

Which makes me worry about where this was tested/needed?

I'm then a bit worried we have two different signatures for coreutils-native depending upon which host this runs on, which will cause a number of other issues. I don't think we can do this.

Cheers,

Richard

#3 lore raw
Quoted 27 lines · Richard Purdie
Quoted 26 lines · Robert Yang

From: Davi Poyastro <[email protected]>

Coreutils configure only checks glibc compatibility for statx syscall but fail to check kernel support.

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

$ bitbake coreutils-native
find the binary ls and run it as "ls -l ."
The result is something like: "?????????. ? ? ? ? ? foo"
---
  meta/recipes-core/coreutils/coreutils_9.0.bb | 5 +++++
  1 file changed, 5 insertions(+)
meta/recipes-core/coreutils/coreutils_9.0.bb +0 -0
index e4633949f42..40fad72bbf4 100644
@@ -152,6 +152,11 @@ ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
  ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
 
Quoted 8 lines

meta/recipes-core/coreutils/coreutils_9.0.bb ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1" · line 159

Quoted 6 lines
meta/recipes-core/coreutils/coreutils_9.0.bb +5 -0
  python __anonymous() {
+    from distutils.version import LooseVersion
+    # statx syscall require glibc >= 2.28 and linux kernel >= 4.11
+    if LooseVersion(os.uname().release) < LooseVersion('4.11'):
+        d.appendVar("EXTRA_OECONF_class-native", " ac_cv_func_statx=0")
+

Shouldn't that be EXTRA_OECONF:class-native?

Yes, you're right, I took this patch from hardknott and built it, but didn't realize that I need change the override syntax.

Quoted 6 lines

Which makes me worry about where this was tested/needed?

I'm then a bit worried we have two different signatures for coreutils-native depending upon which host this runs on, which will cause a number of other issues. I don't think we can do this.

That's a problem, maybe we need disable statx for coreutils-native?

The errors happens when glibc has a higher version (Ubuntu 20.04 in docker) which has statx(), but kernel version is low (CentOS 7) which doesn't support statx.

// Robert

Quoted 5 lines

Cheers,

Richard

#4 lore raw
Quoted 48 lines · Robert Yang
Quoted 27 lines · Richard Purdie
Quoted 26 lines · Robert Yang

From: Davi Poyastro <[email protected]>

Coreutils configure only checks glibc compatibility for statx syscall but fail to check kernel support.

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

$ bitbake coreutils-native
find the binary ls and run it as "ls -l ."
The result is something like: "?????????. ? ? ? ? ? foo"
---
  meta/recipes-core/coreutils/coreutils_9.0.bb | 5 +++++
  1 file changed, 5 insertions(+)
meta/recipes-core/coreutils/coreutils_9.0.bb +0 -0
index e4633949f42..40fad72bbf4 100644
@@ -152,6 +152,11 @@ ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
  ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
 
Quoted 8 lines

meta/recipes-core/coreutils/coreutils_9.0.bb ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1" · line 159

Quoted 6 lines
meta/recipes-core/coreutils/coreutils_9.0.bb +5 -0
  python __anonymous() {
+    from distutils.version import LooseVersion
+    # statx syscall require glibc >= 2.28 and linux kernel >= 4.11
+    if LooseVersion(os.uname().release) < LooseVersion('4.11'):
+        d.appendVar("EXTRA_OECONF_class-native", " ac_cv_func_statx=0")
+

Shouldn't that be EXTRA_OECONF:class-native?

Yes, you're right, I took this patch from hardknott and built it, but didn't realize that I need change the override syntax.

Quoted 6 lines

Which makes me worry about where this was tested/needed?

I'm then a bit worried we have two different signatures for coreutils-native depending upon which host this runs on, which will cause a number of other issues. I don't think we can do this.

Quoted 5 lines

That's a problem, maybe we need disable statx for coreutils-native?

The errors happens when glibc has a higher version (Ubuntu 20.04 in docker) which has statx(), but kernel version is low (CentOS 7) which doesn't support statx.

Disabling it unconditionally which a comment about the version issues may be the only option we have. I'm not sure everyone will like that but if we want to support that combination, I'm not sure we have much choice.

Cheers,

Richard

#5 lore raw
Quoted 51 lines · Richard Purdie
Quoted 50 lines · Robert Yang
Quoted 27 lines · Richard Purdie
Quoted 26 lines · Robert Yang

From: Davi Poyastro <[email protected]>

Coreutils configure only checks glibc compatibility for statx syscall but fail to check kernel support.

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

$ bitbake coreutils-native
find the binary ls and run it as "ls -l ."
The result is something like: "?????????. ? ? ? ? ? foo"
---
   meta/recipes-core/coreutils/coreutils_9.0.bb | 5 +++++
   1 file changed, 5 insertions(+)
meta/recipes-core/coreutils/coreutils_9.0.bb +0 -0
index e4633949f42..40fad72bbf4 100644
@@ -152,6 +152,11 @@ ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
   ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
 
Quoted 8 lines

meta/recipes-core/coreutils/coreutils_9.0.bb ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1" · line 159

Quoted 6 lines
meta/recipes-core/coreutils/coreutils_9.0.bb +5 -0
   python __anonymous() {
+    from distutils.version import LooseVersion
+    # statx syscall require glibc >= 2.28 and linux kernel >= 4.11
+    if LooseVersion(os.uname().release) < LooseVersion('4.11'):
+        d.appendVar("EXTRA_OECONF_class-native", " ac_cv_func_statx=0")
+

Shouldn't that be EXTRA_OECONF:class-native?

Yes, you're right, I took this patch from hardknott and built it, but didn't realize that I need change the override syntax.

Quoted 6 lines

Which makes me worry about where this was tested/needed?

I'm then a bit worried we have two different signatures for coreutils-native depending upon which host this runs on, which will cause a number of other issues. I don't think we can do this.

That's a problem, maybe we need disable statx for coreutils-native?

Quoted 7 lines
Quoted 3 lines

The errors happens when glibc has a higher version (Ubuntu 20.04 in docker) which has statx(), but kernel version is low (CentOS 7) which doesn't support statx.

Disabling it unconditionally which a comment about the version issues may be the only option we have. I'm not sure everyone will like that but if we want to support that combination, I'm not sure we have much choice.

It's worth trying for deterministic build, and we only disable coreutils-native, I will send a patch for it.

// Robert

Quoted 5 lines

Cheers,

Richard