Bug 4524 - [Anolis23.1][RC1][Anolis 23][社区nightly & ANCK-5.10-14-rc1][LTP]适配新版本LTP,make阶段出现error: redefinition of 'struct mount_attr'
Summary: [Anolis23.1][RC1][Anolis 23][社区nightly & ANCK-5.10-14-rc1][LTP]适配新版本LTP,make阶...
Status: CLOSED FIXED
Alias: None
Product: Anolis OS 23
Classification: Anolis OS
Component: Others (show other bugs) Others
Version: 23.1
Hardware: All Linux
: P2-High S2-major
Target Milestone: ---
Assignee: happy_orange
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-15 14:12 UTC by Banana
Modified: 2024-03-29 09:43 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Banana alibaba_cloud_group 2023-03-15 14:12:01 UTC
[问题描述]:适配新版本LTP,make出现error: redefinition of 'struct mount_attr'

make -C "/root/ltp-master/lib" -f "/root/ltp-master/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-master/lib" -f "/root/ltp-master/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-master/testcases'
make: *** [Makefile:94: testcases-all] Error 2

[环境信息]:
机器类型:ECS

[内核信息]:
[root@qibo-anolis23-nightly-func-arm-1 ltp-master]# uname -r
5.10.134-38.git.868a8003184f.an23.aarch64

[操作系统信息]:
[root@qibo-anolis23-nightly-func-arm-1 ltp-master]# cat /etc/os-release
NAME="Anolis OS"
VERSION="23"
ID="anolis"
VERSION_ID="23"
PLATFORM_ID="platform:an23"
PRETTY_NAME="Anolis OS 23"
ANSI_COLOR="0;31"
HOME_URL="https://openanolis.cn/"
BUG_REPORT_URL="https://bugzilla.openanolis.cn/"

[问题发生概率]:必现

[复现步骤]:
1、GitHub下载最新版本的LTP
2、make autotools
3、./configure
4、make
Comment 1 Banana alibaba_cloud_group 2023-03-15 14:14:59 UTC
make autotools阶段还有个设置语言环境的问题,是警告信息。

[root@qibo-anolis23-nightly-func-arm-1 ltp-master]# make autotools
autoheader
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "en_US.UTF-8",
        LC_ALL = (unset),
        LC_NUMERIC = "C",
        LC_COLLATE = "C",
        LANG = "en_US:zh_CN.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "en_US.UTF-8",
        LC_ALL = (unset),
        LC_COLLATE = "C",
        LC_NUMERIC = "C",
        LANG = "en_US:zh_CN.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Comment 2 xuchunmei alibaba_cloud_group 2023-03-15 14:16:00 UTC
(In reply to anolislhy from comment #1)
> make autotools阶段还有个设置语言环境的问题,是警告信息。
> 
> [root@qibo-anolis23-nightly-func-arm-1 ltp-master]# make autotools
> autoheader
> perl: warning: Setting locale failed.
> perl: warning: Please check that your locale settings:
>         LANGUAGE = "en_US.UTF-8",
>         LC_ALL = (unset),
>         LC_NUMERIC = "C",
>         LC_COLLATE = "C",
>         LANG = "en_US:zh_CN.UTF-8"
>     are supported and installed on your system.
> perl: warning: Falling back to the standard locale ("C").
> perl: warning: Setting locale failed.
> perl: warning: Please check that your locale settings:
>         LANGUAGE = "en_US.UTF-8",
>         LC_ALL = (unset),
>         LC_COLLATE = "C",
>         LC_NUMERIC = "C",
>         LANG = "en_US:zh_CN.UTF-8"
>     are supported and installed on your system.
> perl: warning: Falling back to the standard locale ("C").

dnf install glibc-langpack-en即可解决
Comment 3 Jacob alibaba_cloud_group 2023-03-15 14:42:58 UTC
(In reply to xuchunmei from comment #2)
> (In reply to anolislhy from comment #1)
> > make autotools阶段还有个设置语言环境的问题,是警告信息。
> > 
> > [root@qibo-anolis23-nightly-func-arm-1 ltp-master]# make autotools
> > autoheader
> > perl: warning: Setting locale failed.
> > perl: warning: Please check that your locale settings:
> >         LANGUAGE = "en_US.UTF-8",
> >         LC_ALL = (unset),
> >         LC_NUMERIC = "C",
> >         LC_COLLATE = "C",
> >         LANG = "en_US:zh_CN.UTF-8"
> >     are supported and installed on your system.
> > perl: warning: Falling back to the standard locale ("C").
> > perl: warning: Setting locale failed.
> > perl: warning: Please check that your locale settings:
> >         LANGUAGE = "en_US.UTF-8",
> >         LC_ALL = (unset),
> >         LC_COLLATE = "C",
> >         LC_NUMERIC = "C",
> >         LANG = "en_US:zh_CN.UTF-8"
> >     are supported and installed on your system.
> > perl: warning: Falling back to the standard locale ("C").
> 
> dnf install glibc-langpack-en即可解决

是的,安装了这个之后不会报语言问题了
Comment 4 Jacob alibaba_cloud_group 2023-03-16 15:38:21 UTC
升级Anolis23后问题没再复现
Comment 5 Banana alibaba_cloud_group 2023-08-14 14:35:01 UTC
在前几个版本yum update之后此问题已经解决,但是换成新环境后,yum update之后仍有此问题,之前判断的应该是glibc的问题
Comment 7 Banana alibaba_cloud_group 2023-08-14 16:00:41 UTC
An23 x86、arm 错误: redefinition of 'struct mount_attr' 问题,注释掉vim /usr/include/sys/mount.h 中定义的 mount_attr 方法可正常编译ltp

当前环境信息:
[root@localhost ~]# cat /etc/os-release
NAME="Anolis OS"
VERSION="23"
ID="anolis"
VERSION_ID="23"
PLATFORM_ID="platform:an23"
PRETTY_NAME="Anolis OS 23"
ANSI_COLOR="0;31"
HOME_URL="https://openanolis.cn/"
BUG_REPORT_URL="https://bugzilla.openanolis.cn/"

[root@localhost ~]# uname -r
5.10.134-15.1.an23.aarch64
[root@localhost ~]# rpm -qa |grep glibc
glibc-gconv-extra-2.36-7.an23.aarch64
glibc-langpack-en-2.36-7.an23.aarch64
glibc-common-2.36-7.an23.aarch64
glibc-2.36-7.an23.aarch64
glibc-devel-2.36-7.an23.aarch64
[root@localhost ~]# rpm -qi glibc
Name        : glibc
Version     : 2.36
Release     : 7.an23
Architecture: aarch64
Install Date: Fri 07 Jul 2023 08:28:24 PM CST
Group       : Unspecified
Size        : 9989572
License     : LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL
Signature   : RSA/SHA256, Sun 16 Apr 2023 12:11:13 AM CST, Key ID 619140084873f7c5
Source RPM  : glibc-2.36-7.an23.src.rpm
Build Date  : Sat 15 Apr 2023 02:21:54 PM CST
Build Host  : iZ2zedi3462lmk3h9qy0noZ
Packager    : OpenAnolis Community
Vendor      : OpenAnolis Community
URL         : http://www.gnu.org/software/glibc/
Summary     : The GNU libc libraries
Description :
The glibc package contains standard libraries which are used by
multiple programs on the system.
In order to save disk space and memory, as well as to make upgrading easier,
common system code is kept in one place and shared between programs.
This particular package contains the most important sets of shared libraries:
the standard C library and the standard math library.
Without these two libraries, a Linux system will not function.
Comment 8 gaochang alibaba_cloud_group 2024-01-29 11:59:59 UTC
具体是什么问题,后面贴的信息我看不懂想表达什么
Comment 9 gaochang alibaba_cloud_group 2024-01-29 12:01:04 UTC
ltp 是什么版本, gcc/glibc/util-linux 是什么版本,麻烦补充下
Comment 10 Banana alibaba_cloud_group 2024-02-04 15:57:07 UTC
An23.1 5.10.134-16.2_rc2.an23.aarch64内核版本安装最新版ltp编译过程无此问题