Bug 4586 - [Anolis23][5.10][nightly][x86_64] ltp编译安装失败
Summary: [Anolis23][5.10][nightly][x86_64] ltp编译安装失败
Status: RESOLVED FIXED
Alias: None
Product: Anolis OS 23
Classification: Anolis OS
Component: Others (show other bugs) Others
Version: 23.0
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: yunmeng365524
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-22 12:04 UTC by anolislw
Modified: 2023-05-26 16:54 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description anolislw alibaba_cloud_group 2023-03-22 12:04:57 UTC
Description of problem:
Anolis 23 5.10 x86_64 ECS环境,nightly测试,ltp测试套编译安装失败。

Version-Release number of selected component (if applicable):
How reproducible:

Steps to Reproduce:
1.git clone https://gitee.com/anolis/ltp.git --branch 20230315
2.cd ltp;make autotools;./configure #出错
3.make && make install

Actual results:
[root@localhost ltp]# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... none
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for bison... bison -y
checking for gcc options needed to detect all undeclared functions... cannot detect
configure: error: in `/root/ltp':
configure: error: cannot make gcc report undeclared builtins
See `config.log' for more details
[root@localhost ltp]# echo $?
1


Expected results:
ltp编译安装通过

Additional info:
[root@localhost ltp]# uname -r
5.10.134-55.git.b549959d6ad5.an23.x86_64
[root@localhost ltp]# cat /etc/anolis-release
Anolis OS release 23
[root@localhost ltp]# free -g
               total        used        free      shared  buff/cache   available
Mem:              15           0          11           1           2          12
Swap:              0           0           0
[root@localhost ltp]# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        4.0M     0  4.0M   0% /dev
tmpfs           7.6G     0  7.6G   0% /dev/shm
tmpfs           3.1G  528K  3.1G   1% /run
/dev/vda1        40G  9.6G   31G  24% /
tmpfs           7.6G  1.8G  5.8G  24% /tmp
tmpfs           1.6G     0  1.6G   0% /run/user/0
[root@localhost ltp]# cat /proc/cmdline
BOOT_IMAGE=(hd0,msdos1)/boot/vmlinuz-5.10.134-55.git.b549959d6ad5.an23.x86_64 root=UUID=ece72b7f-465b-433d-8b3b-e5fa53a04642 ro rhgb cryptomgr.notests rcupdate.rcu_cpu_stall_timeout=300 quiet biosdevname=0 net.ifnames=0 console=tty0 console=ttyS0,115200n8 noibrs nvme_core.io_timeout=4294967295 nvme_core.admin_timeout=4294967295 cgroup.memory=nokmem crashkernel=0M-2G:0M,2G-8G:192M,8G-:256M
[root@localhost ltp]# lscpu
Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         46 bits physical, 57 bits virtual
  Byte Order:            Little Endian
CPU(s):                  4
  On-line CPU(s) list:   0-3
Vendor ID:               GenuineIntel
  BIOS Vendor ID:        Alibaba Cloud
  Model name:            Intel(R) Xeon(R) Platinum 8369B CPU @ 2.70GHz
    BIOS Model name:     pc-i440fx-2.1  CPU @ 0.0GHz
    BIOS CPU family:     1
    CPU family:          6
    Model:               106
    Thread(s) per core:  2
    Core(s) per socket:  2
    Socket(s):           1
    Stepping:            6
    BogoMIPS:            5399.99
    Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht sy
                         scall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid tsc_known_freq pni pclmulqdq monit
                         or ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm
                         3dnowprefetch cpuid_fault invpcid_single ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpci
                         d avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt x
                         savec xgetbv1 xsaves wbnoinvd arat avx512vbmi pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx5
                         12_bitalg avx512_vpopcntdq rdpid fsrm arch_capabilities
Virtualization features:
  Hypervisor vendor:     KVM
  Virtualization type:   full
Caches (sum of all):
  L1d:                   96 KiB (2 instances)
  L1i:                   64 KiB (2 instances)
  L2:                    2.5 MiB (2 instances)
  L3:                    48 MiB (1 instance)
NUMA:
  NUMA node(s):          1
  NUMA node0 CPU(s):     0-3
Vulnerabilities:
  Itlb multihit:         Not affected
  L1tf:                  Not affected
  Mds:                   Not affected
  Meltdown:              Not affected
  Mmio stale data:       Vulnerable: Clear CPU buffers attempted, no microcode; SMT Host state unknown
  Retbleed:              Not affected
  Spec store bypass:     Vulnerable
  Spectre v1:            Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:            Mitigation; Enhanced IBRS, RSB filling, PBRSB-eIBRS SW sequence
  Srbds:                 Not affected
  Tsx async abort:       Not affected
[root@localhost ltp]# rpm -qa | grep glibc
glibc-common-2.36-3.an23.x86_64
glibc-gconv-extra-2.36-3.an23.x86_64
glibc-minimal-langpack-2.36-3.an23.x86_64
glibc-2.36-3.an23.x86_64
glibc-devel-2.36-3.an23.x86_64
glibc-static-2.36-3.an23.x86_64
[root@localhost ltp]#
[root@localhost ltp]# gcc --version
gcc (GCC) 12.2.1 20221121 (Anolis OS 12.2.1-1)
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[root@localhost ltp]# rpm -q make
make-4.4.1-1.an23.x86_64
[root@localhost ltp]# rpm -q automake
automake-1.16.5-3.an23.noarch
Comment 1 anolislw alibaba_cloud_group 2023-03-23 18:17:05 UTC
将glibc升级至2.36-5,ltp编译安装执行make报错如下:



---------------------------------------
CC testcases/kernel/syscalls/flock/flock04
CC testcases/kernel/syscalls/flock/flock06
make -C "/root/ltp/lib" -f "/root/ltp/lib/Makefile" all
make[6]: Nothing to be done for 'all'.
make[6]: Nothing to be done for 'all'.
fmtmsg01.c: In function 'main':
fmtmsg01.c:103:9: warning: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Wunused-result]
  103 |         fread(buf, sizeof(buf[0]), strlen(str1), fp);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fmtmsg01.c:112:9: warning: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Wunused-result]
  112 |         fread(&ch, sizeof(ch), 1, fp);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fmtmsg01.c:114:17: warning: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Wunused-result]
  114 |                 fread(&ch, sizeof(ch), 1, fp);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fmtmsg01.c:118:9: warning: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Wunused-result]
  118 |         fread(buf, sizeof(buf[0]), strlen(str2), fp);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fmtmsg01.c:169:9: warning: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Wunused-result]
  169 |         fread(buf, sizeof(buf[0]), strlen(str3), fp);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fmtmsg01.c:178:9: warning: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Wunused-result]
  178 |         fread(&ch, sizeof(ch), 1, fp);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fmtmsg01.c:180:17: warning: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Wunused-result]
  180 |                 fread(&ch, sizeof(ch), 1, fp);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fmtmsg01.c:184:9: warning: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Wunused-result]
  184 |         fread(buf, sizeof(buf[0]), strlen(str4), fp);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC testcases/kernel/syscalls/fmtmsg/fmtmsg01
make -C "/root/ltp/lib" -f "/root/ltp/lib/Makefile" all
make[6]: Nothing to be done for 'all'.
make[6]: Nothing to be done for 'all'.
CC testcases/kernel/syscalls/fork/fork01
CC testcases/kernel/syscalls/fork/fork03
fork04.c: In function 'child_environment':
fork04.c:157:17: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result]
  157 |                 write(fildes, msg, sizeof(msg));
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC testcases/kernel/syscalls/fork/fork04
CC testcases/kernel/syscalls/fork/fork05
CC testcases/kernel/syscalls/fork/fork06
CC testcases/kernel/syscalls/fork/fork07
CC testcases/kernel/syscalls/fork/fork08
CC testcases/kernel/syscalls/fork/fork09
fork10.c: In function 'main':
fork10.c:77:17: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result]
   77 |                 write(fildes, "ABCDEFGHIJKLMNOPQRSTUVWXYZ\n", 27);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fork10.c:127:41: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result]
  127 |                                         write(fildes, parchar, 1);
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~
CC testcases/kernel/syscalls/fork/fork10
CC testcases/kernel/syscalls/fork/fork11
CC testcases/kernel/syscalls/fork/fork12
CC testcases/kernel/syscalls/fork/fork13
CC testcases/kernel/syscalls/fork/fork14
make -C "/root/ltp/lib" -f "/root/ltp/lib/Makefile" all
make[6]: Nothing to be done for 'all'.
make[6]: Nothing to be done for 'all'.
CC testcases/kernel/syscalls/fpathconf/fpathconf01
make -C "/root/ltp/lib" -f "/root/ltp/lib/Makefile" all
make[6]: Nothing to be done for 'all'.
make[6]: Nothing to be done for 'all'.
CC testcases/kernel/syscalls/fremovexattr/fremovexattr01
CC testcases/kernel/syscalls/fremovexattr/fremovexattr02
make -C "/root/ltp/lib" -f "/root/ltp/lib/Makefile" all
make[6]: Nothing to be done for 'all'.
make[6]: Nothing to be done for 'all'.
In file included from fsconfig01.c:9:
../../../../include/lapi/fsmount.h:55:8: error: redefinition of 'struct mount_attr'
   55 | struct mount_attr {
      |        ^~~~~~~~~~
In file included from ../../../../include/lapi/fsmount.h:14:
/usr/include/sys/mount.h:210:8: note: originally defined here
  210 | struct mount_attr
      |        ^~~~~~~~~~
make[4]: *** [../../../../include/mk/rules.mk:45: fsconfig01] Error 1
make[3]: *** [../../../include/mk/generic_trunk_target.inc:108: all] Error 2
make[2]: *** [../../include/mk/generic_trunk_target.inc:108: all] Error 2
make[1]: *** [../include/mk/generic_trunk_target.inc:108: all] Error 2
make[1]: Leaving directory '/root/ltp/testcases'
make: *** [Makefile:94: testcases-all] Error 2
[root@qibo-anolis23-nightly-func-x86-1 ltp]# echo $?
2


glibc gcc  make版本信息:
------------------------------------
[root@qibo-anolis23-nightly-func-x86-1 ltp]# rpm -qa | grep glibc
glibc-common-2.36-5.an23.x86_64
glibc-gconv-extra-2.36-5.an23.x86_64
glibc-minimal-langpack-2.36-5.an23.x86_64
glibc-2.36-5.an23.x86_64
glibc-devel-2.36-5.an23.x86_64
glibc-static-2.36-5.an23.x86_64
[root@qibo-anolis23-nightly-func-x86-1 ltp]# gcc --version
gcc (GCC) 12.2.1 20221121 (Anolis OS 12.2.1-1)
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[root@qibo-anolis23-nightly-func-x86-1 ltp]# rpm -q make
make-4.4.1-1.an23.x86_64
Comment 2 yunmeng365524 2023-03-23 19:05:04 UTC
根本的原因就是有两个地方重复定义了mount_attr这个结构体。
对比an8的glibc,是没有这个结构体的:
[root@nu1l07429 tests]# grep -nr mount_attr /usr/include/sys/mount.h
[root@nu1l07429 tests]#
[root@nu1l07429 tests]# yum info glibc-devel
Installed Packages
Name         : glibc-devel
Version      : 2.28
Release      : 189.5.0.1.an8_6
Architecture : x86_64
Size         : 234 k
Source       : glibc-2.28-189.5.0.1.an8_6.src.rpm
Repository   : @System
From repo    : koji-override-2
Summary      : Object files for development using standard C libraries.
URL          : http://www.gnu.org/software/glibc/
License      : LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and
             : Public Domain and GFDL
Description  : The glibc-devel package contains the object files necessary
             : for developing programs which use the standard C libraries (which are
             : used by nearly all programs).  If you are developing programs which
             : will use the standard C libraries, your system needs to have these
             : standard object files available in order to create the
             : executables.
             :
             : Install glibc-devel if you are going to develop programs which will
             : use the standard C libraries.

而an23的有:
[root@qibo-anolis23-nightly-func-x86-1 ltp]# yum info glibc-devel
Failed to set locale, defaulting to C.UTF-8
Last metadata expiration check: 0:34:48 ago on Thu Mar 23 18:27:55 2023.
Installed Packages
Name         : glibc-devel
Version      : 2.36
Release      : 3.an23
Architecture : x86_64
Size         : 2.2 M
Source       : glibc-2.36-3.an23.src.rpm
Repository   : @System
From repo    : BaseOS
Summary      : Object files for development using standard C libraries.
URL          : http://www.gnu.org/software/glibc/
License      : LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and
             : Public Domain and GFDL
Description  : The glibc-devel package contains the object files necessary
             : for developing programs which use the standard C libraries (which are
             : used by nearly all programs).  If you are developing programs which
             : will use the standard C libraries, your system needs to have these
             : standard object files available in order to create the
             : executables.
             :
             : Install glibc-devel if you are going to develop programs which will
             : use the standard C libraries.

[root@qibo-anolis23-nightly-func-x86-1 ltp]# grep -nr mount_attr /usr/include/sys/mount.h
204:#define MOUNT_ATTR_IDMAP        0x00100000 /* Idmap mount to @userns_fd in struct mount_attr.  */
210:struct mount_attr
317:			  struct mount_attr *__uattr, size_t __usize)

不管是注释掉./include/lapi/fsmount.h还是/usr/include/sys/mount.h中的mount_attr结构体定义,都可以编译OK:
make[1]: Entering directory '/root/ltp/metadata'
HOSTCC metadata/metaparse
/root/ltp/metadata/parse.sh > ltp.json
make[1]: Leaving directory '/root/ltp/metadata'
if git describe >/dev/null 2>&1; then \
	git describe > "Version"; \
else \
	cp /root/ltp/VERSION "Version"; \
fi
[root@qibo-anolis23-nightly-func-x86-1 ltp]# echo $?
0

因此个人觉得是需要ltp适配新版的glibc的。
Comment 3 yunmeng365524 2023-05-26 16:54:38 UTC
当前最新的nightly环境,ltp已经在正常运行,关闭本bug