beaglebone black ::/lib/arm-linux-gnueabihf/libm.so.6:版本`glibc_2.29’找不到(./thermadc要求)

发布于 2025-02-12 15:57:27 字数 9400 浏览 0 评论 0原文

我一直在尝试了解为Beaglebone Black执行交叉构建的Eclipse文件的问题,该文件采用ADC值,转换读取值并输出转换后的温度值(使用'log''''''' '还将其添加到项目的交联设置中)到终端屏幕上。

我可以成功编译并构建Eclipse文件并将其传输到Beaglebone Black,但是当我尝试执行(文件名是ThermAdc)时,我会收到以下错误:

debian@beaglebone:~$ ./thermADC 
./thermADC: /lib/arm-linux-gnueabihf/libm.so.6: version `GLIBC_2.29' not found (required by ./thermADC)

我尝试在网上搜索错误,并找到了类似的错误他人面临的问题,但没有任何答案或方法可以解决这个问题(或者首先根本没有解决方案)。

由于该错误指出了GLIBC版本2.29,因此我在BBB上检查了GLIBC版本,结果:

debian@beaglebone:~$ ldd --version ldd
ldd (Debian GLIBC 2.28-10+deb10u1) 2.28
Copyright (C) 2018 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.
Written by Roland McGrath and Ulrich Drepper.

以上显示了BBB上当前可用的GLIBC版本是2.28版,而不是“ 2.29”,而不是需要解释的'2.29'错误。

然后,我搜索了如何使用2.29版升级或安装GLIBC,并遇到此 blogpost ,并按照以下指示进行了尝试:

  1. 下载glibc-2.29包装tar来自gnu.org(sudo wget http://ftp.gnu.org/gnu/glibc/glibc-2.29.tar.gz )进入/usr/local/。
  2. 将包装解压缩到GLIBC-2.29文件夹。
  3. 执行./configure命令 - (sudo ./glibc-2.29/configure -prefix =/usr -disable-profile -enable-add-ons -with-headers -with-headers =/usr/ussr/include -with-with-binutils =/usr/bin),结果如下:
checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
checking for gcc... gcc
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for readelf... readelf
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ can link programs... yes
checking for sysdeps preconfigure fragments... aarch64 alpha arm configure: Found compiler is configured for armv7
csky hppa i386 m68k microblaze mips nios2 powerpc riscv s390 sh sparc x86_64 
checking for use of fpu sysdeps directories... yes
checking for -fstack-protector... yes
checking for -fstack-protector-strong... yes
checking for -fstack-protector-all... yes
checking for assembler and linker STT_GNU_IFUNC support... yes
checking for gcc attribute ifunc support... yes
checking whether the linker supports textrels along with ifunc... yes
checking if compiler warns about alias for function with incompatible types... yes
checking sysdep dirs... sysdeps/unix/sysv/linux/arm sysdeps/arm/nptl sysdeps/unix/sysv/linux sysdeps/nptl sysdeps/pthread sysdeps/gnu sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix/arm sysdeps/unix sysdeps/posix sysdeps/arm/armv7/multiarch sysdeps/arm/armv7 sysdeps/arm/armv6t2 sysdeps/arm/armv6 sysdeps/arm sysdeps/wordsize-32 sysdeps/ieee754/flt-32 sysdeps/ieee754/dbl-64 sysdeps/ieee754 sysdeps/generic
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether /usr/bin/as is GNU as... yes
checking whether /usr/bin/ld is GNU ld... yes
checking for /usr/bin/as... /usr/bin/as
checking version of /usr/bin/as... 2.31.1, ok
checking for /usr/bin/ld... /usr/bin/ld
checking version of /usr/bin/ld... 2.31.1, ok
checking for gnumake... no
checking for gmake... no
checking for make... make
checking version of make... 4.2.1, ok
checking for gnumsgfmt... no
checking for gmsgfmt... no
checking for msgfmt... msgfmt
checking version of msgfmt... 0.19.8.1, ok
checking for makeinfo... makeinfo
checking version of makeinfo... 6.5, ok
checking for sed... sed
checking version of sed... 4.7, ok
checking for gawk... gawk
checking version of gawk... 4.2.1, ok
checking for bison... bison
checking version of bison... 3.3.2, ok
checking if gcc -B/usr/bin/ is sufficient to build libc... yes
checking for nm... nm
checking for python3... python3
checking version of python3... 3.7.3, ok
checking LD_LIBRARY_PATH variable... ok
checking for bash... /bin/bash
checking for perl... /usr/bin/perl
checking for install-info... no
checking for .set assembler directive... yes
checking linker support for protected data symbol... yes
checking linker support for INSERT in linker script... yes
checking for broken __attribute__((alias()))... no
checking whether to put _rtld_local into .sdata section... no
checking whether to use .ctors/.dtors header and trailer... no
checking for libunwind-support in compiler... no
checking whether --noexecstack is desirable for .S files... yes
checking for -z combreloc... yes
checking for linker that supports -z execstack... yes
checking for linker that supports --no-dynamic-linker... yes
checking for -static-pie... yes
checking for -fpie... yes
checking for --hash-style option... yes
checking for sufficient default -shared layout... no
checking for GLOB_DAT reloc... yes
checking linker output format... elf32-littlearm
checking for -fno-toplevel-reorder -fno-section-anchors... yes
checking for -mtls-dialect=gnu2... yes
checking whether cc puts quotes around section names... no
checking for __builtin_memset... no
checking for redirection of built-in functions... yes
checking for compiler option to disable generation of FMA instructions... -ffp-contract=off
checking if gcc -B/usr/bin/ accepts -fno-tree-loop-distribute-patterns with __attribute__ ((__optimize__))... yes
checking for libgd... no
checking for is_selinux_enabled in -lselinux... no
checking for _FORTIFY_SOURCE predefine... no
checking whether the linker provides working __ehdr_start... yes
checking for __builtin_trap with no external dependencies... yes
checking whether the C++ compiler supports thread_local... yes
running configure fragment for sysdeps/unix/sysv/linux
checking installed Linux kernel header files... 3.2.0 or later
checking for kernel header at least 3.2.0... ok
checking for symlinks in /usr/include... ok
running configure fragment for sysdeps/gnu
running configure fragment for sysdeps/arm
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking whether the compiler is using the ARM hard-float ABI... yes
checking whether PC-relative relocs in movw/movt work properly... yes
checking whether TPOFF relocs with addends are assembled correctly... yes
checking whether -fPIC is default... yes
checking whether -fPIE is default... yes
configure: creating ./config.status
config.status: creating config.make
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing default commands

这使我相信配置步骤是完成没有任何错误的(某些软件包没有任何错误的警告在先前的系统中安装在系统上,请尝试配置,因此在执行干净的构建之前,在BBB上安装了这些软件包)。 4。下一步是在/usr/local/Directory中执行“ make”命令,这是我面对问题的地方:

../sysdeps/unix/sysv/linux/sys/syscall.h:24:10: **fatal error:** asm/unistd.h: No such file or directory
 #include <asm/unistd.h>
          ^~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
  File "../scripts/gen-as-const.py", line 120, in <module>
    main()
  File "../scripts/gen-as-const.py", line 116, in main
    consts = glibcextract.compute_c_consts(sym_data, args.cc)
  File "/usr/local/glibc-2.29/scripts/glibcextract.py", line 62, in compute_c_consts
    subprocess.check_call(cmd, shell=True)
  File "/usr/lib/python3.7/subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'gcc -B/usr/bin/ -std=gnu11 -fgnu89-inline  -g -O2 -Wall -Wwrite-strings -Wundef -Werror -fmerge-all-constants -frounding-math -fno-stack-protector -Wstrict-prototypes -Wold-style-definition -fmath-errno     -ftls-model=initial-exec      -I../include -I/usr/local/csu  -I/usr/local/include -I/usr/local  -I../sysdeps/unix/sysv/linux/arm  -I../sysdeps/arm/nptl  -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread  -I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv  -I../sysdeps/unix/arm  -I../sysdeps/unix  -I../sysdeps/posix  -I../sysdeps/arm/armv7/multiarch  -I../sysdeps/arm/armv7  -I../sysdeps/arm/armv6t2  -I../sysdeps/arm/armv6  -I../sysdeps/arm/include -I../sysdeps/arm  -I../sysdeps/wordsize-32  -I../sysdeps/ieee754/flt-32  -I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754  -I../sysdeps/generic  -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/arm-linux-gnueabihf/8/include -isystem /usr/lib/gcc/arm-linux-gnueabihf/8/include-fixed -isystem /usr/include  -D_LIBC_REENTRANT -include /usr/local/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h       -DTOP_NAMESPACE=glibc -DGEN_AS_CONST_HEADERS            -MD -MP -MF /usr/local/rtld-global-offsets.h.dT         -MT '/usr/local/rtld-global-offsets.h.d /usr/local/rtld-global-offsets.h' -S -o /tmp/tmpqm_0ze7l/test.s -x c - < /tmp/tmpqm_0ze7l/test.c' returned non-zero exit status 1.
make[2]: *** [../Makerules:271: /usr/local/rtld-global-offsets.h] Error 1
make[2]: Leaving directory '/usr/local/glibc-2.29/csu'
make[1]: *** [Makefile:258: csu/subdir_lib] Error 2
make[1]: Leaving directory '/usr/local/glibc-2.29'
make: *** [Makefile:9: all] Error 2

有人可以帮助您解决可能导致此问题的原因吗?

谢谢,问候, Yash

I have been trying to understand what is going wrong in executing a cross-built eclipse file for Beaglebone black, which takes the ADC values, converts the read value and outputs the converted temperature values (uses 'log' function, so math lib 'm' was also added to the cross-linker settings to the project) onto the terminal screen.

I can successfully compile and build the eclipse file and transfer it to the Beaglebone black, but when i try to execute (the file name is thermADC), i get the following error:

debian@beaglebone:~$ ./thermADC 
./thermADC: /lib/arm-linux-gnueabihf/libm.so.6: version `GLIBC_2.29' not found (required by ./thermADC)

I tried searching up the error on the web, and found similar issues faced by others, but none of the answers or approaches helped solve the issue (or didn't have a solution at all in the first place).

Since the error pointed out to a GLIBC version 2.29 not found, i checked the glibc version on my BBB and the result:

debian@beaglebone:~$ ldd --version ldd
ldd (Debian GLIBC 2.28-10+deb10u1) 2.28
Copyright (C) 2018 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.
Written by Roland McGrath and Ulrich Drepper.

The above shows that the GLIBC currently available on the BBB is of version 2.28 and not '2.29' as required which would explain the error.

Then i searched for how to upgrade or install glibc with version 2.29 and came across this blogpost and tried as instructed as follows:

  1. Downloaded the glibc-2.29 package tar from gnu.org ( sudo wget http://ftp.gnu.org/gnu/glibc/glibc-2.29.tar.gz ) into /usr/local/.
  2. Unzipped the package to a glibc-2.29 folder.
  3. Executed the ./configure command -- ( sudo ./glibc-2.29/configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin ) and the result is as follows:
checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
checking for gcc... gcc
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for readelf... readelf
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ can link programs... yes
checking for sysdeps preconfigure fragments... aarch64 alpha arm configure: Found compiler is configured for armv7
csky hppa i386 m68k microblaze mips nios2 powerpc riscv s390 sh sparc x86_64 
checking for use of fpu sysdeps directories... yes
checking for -fstack-protector... yes
checking for -fstack-protector-strong... yes
checking for -fstack-protector-all... yes
checking for assembler and linker STT_GNU_IFUNC support... yes
checking for gcc attribute ifunc support... yes
checking whether the linker supports textrels along with ifunc... yes
checking if compiler warns about alias for function with incompatible types... yes
checking sysdep dirs... sysdeps/unix/sysv/linux/arm sysdeps/arm/nptl sysdeps/unix/sysv/linux sysdeps/nptl sysdeps/pthread sysdeps/gnu sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix/arm sysdeps/unix sysdeps/posix sysdeps/arm/armv7/multiarch sysdeps/arm/armv7 sysdeps/arm/armv6t2 sysdeps/arm/armv6 sysdeps/arm sysdeps/wordsize-32 sysdeps/ieee754/flt-32 sysdeps/ieee754/dbl-64 sysdeps/ieee754 sysdeps/generic
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether /usr/bin/as is GNU as... yes
checking whether /usr/bin/ld is GNU ld... yes
checking for /usr/bin/as... /usr/bin/as
checking version of /usr/bin/as... 2.31.1, ok
checking for /usr/bin/ld... /usr/bin/ld
checking version of /usr/bin/ld... 2.31.1, ok
checking for gnumake... no
checking for gmake... no
checking for make... make
checking version of make... 4.2.1, ok
checking for gnumsgfmt... no
checking for gmsgfmt... no
checking for msgfmt... msgfmt
checking version of msgfmt... 0.19.8.1, ok
checking for makeinfo... makeinfo
checking version of makeinfo... 6.5, ok
checking for sed... sed
checking version of sed... 4.7, ok
checking for gawk... gawk
checking version of gawk... 4.2.1, ok
checking for bison... bison
checking version of bison... 3.3.2, ok
checking if gcc -B/usr/bin/ is sufficient to build libc... yes
checking for nm... nm
checking for python3... python3
checking version of python3... 3.7.3, ok
checking LD_LIBRARY_PATH variable... ok
checking for bash... /bin/bash
checking for perl... /usr/bin/perl
checking for install-info... no
checking for .set assembler directive... yes
checking linker support for protected data symbol... yes
checking linker support for INSERT in linker script... yes
checking for broken __attribute__((alias()))... no
checking whether to put _rtld_local into .sdata section... no
checking whether to use .ctors/.dtors header and trailer... no
checking for libunwind-support in compiler... no
checking whether --noexecstack is desirable for .S files... yes
checking for -z combreloc... yes
checking for linker that supports -z execstack... yes
checking for linker that supports --no-dynamic-linker... yes
checking for -static-pie... yes
checking for -fpie... yes
checking for --hash-style option... yes
checking for sufficient default -shared layout... no
checking for GLOB_DAT reloc... yes
checking linker output format... elf32-littlearm
checking for -fno-toplevel-reorder -fno-section-anchors... yes
checking for -mtls-dialect=gnu2... yes
checking whether cc puts quotes around section names... no
checking for __builtin_memset... no
checking for redirection of built-in functions... yes
checking for compiler option to disable generation of FMA instructions... -ffp-contract=off
checking if gcc -B/usr/bin/ accepts -fno-tree-loop-distribute-patterns with __attribute__ ((__optimize__))... yes
checking for libgd... no
checking for is_selinux_enabled in -lselinux... no
checking for _FORTIFY_SOURCE predefine... no
checking whether the linker provides working __ehdr_start... yes
checking for __builtin_trap with no external dependencies... yes
checking whether the C++ compiler supports thread_local... yes
running configure fragment for sysdeps/unix/sysv/linux
checking installed Linux kernel header files... 3.2.0 or later
checking for kernel header at least 3.2.0... ok
checking for symlinks in /usr/include... ok
running configure fragment for sysdeps/gnu
running configure fragment for sysdeps/arm
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking whether the compiler is using the ARM hard-float ABI... yes
checking whether PC-relative relocs in movw/movt work properly... yes
checking whether TPOFF relocs with addends are assembled correctly... yes
checking whether -fPIC is default... yes
checking whether -fPIE is default... yes
configure: creating ./config.status
config.status: creating config.make
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing default commands

which makes me believe that the configure step is done without any errors (there were few warnings of some of the packages not being installed on the system in a previous try to configure, so installed those said packages on BBB before performing a clean build).
4. Next step is to execute the "make" command in the /usr/local/ directory and this is where i am facing the issue as follows:

../sysdeps/unix/sysv/linux/sys/syscall.h:24:10: **fatal error:** asm/unistd.h: No such file or directory
 #include <asm/unistd.h>
          ^~~~~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):
  File "../scripts/gen-as-const.py", line 120, in <module>
    main()
  File "../scripts/gen-as-const.py", line 116, in main
    consts = glibcextract.compute_c_consts(sym_data, args.cc)
  File "/usr/local/glibc-2.29/scripts/glibcextract.py", line 62, in compute_c_consts
    subprocess.check_call(cmd, shell=True)
  File "/usr/lib/python3.7/subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'gcc -B/usr/bin/ -std=gnu11 -fgnu89-inline  -g -O2 -Wall -Wwrite-strings -Wundef -Werror -fmerge-all-constants -frounding-math -fno-stack-protector -Wstrict-prototypes -Wold-style-definition -fmath-errno     -ftls-model=initial-exec      -I../include -I/usr/local/csu  -I/usr/local/include -I/usr/local  -I../sysdeps/unix/sysv/linux/arm  -I../sysdeps/arm/nptl  -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread  -I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv  -I../sysdeps/unix/arm  -I../sysdeps/unix  -I../sysdeps/posix  -I../sysdeps/arm/armv7/multiarch  -I../sysdeps/arm/armv7  -I../sysdeps/arm/armv6t2  -I../sysdeps/arm/armv6  -I../sysdeps/arm/include -I../sysdeps/arm  -I../sysdeps/wordsize-32  -I../sysdeps/ieee754/flt-32  -I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754  -I../sysdeps/generic  -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/arm-linux-gnueabihf/8/include -isystem /usr/lib/gcc/arm-linux-gnueabihf/8/include-fixed -isystem /usr/include  -D_LIBC_REENTRANT -include /usr/local/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h       -DTOP_NAMESPACE=glibc -DGEN_AS_CONST_HEADERS            -MD -MP -MF /usr/local/rtld-global-offsets.h.dT         -MT '/usr/local/rtld-global-offsets.h.d /usr/local/rtld-global-offsets.h' -S -o /tmp/tmpqm_0ze7l/test.s -x c - < /tmp/tmpqm_0ze7l/test.c' returned non-zero exit status 1.
make[2]: *** [../Makerules:271: /usr/local/rtld-global-offsets.h] Error 1
make[2]: Leaving directory '/usr/local/glibc-2.29/csu'
make[1]: *** [Makefile:258: csu/subdir_lib] Error 2
make[1]: Leaving directory '/usr/local/glibc-2.29'
make: *** [Makefile:9: all] Error 2

Can someone please help with what might be causing this issue?

Thanks and Regards,
Yash

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一曲琵琶半遮面シ 2025-02-19 15:57:27

我在Beaglebone论坛的帮助下弄清楚了这个问题,这主要是由于主机和目标之间的GLIBC版本(或任何其他LIB)的不匹配引起的。

通过使用最新的Debian Bullseye(GliBC_2.31)发行版而不是Debian Buster(Glibc_2.28)发行版来解决此特定,或者替代方案是使用GLIBC高于目标GliBC版本的主机。

为了更好地理解问题,解决方案的链接是: https://forum.beagleboard.org/t/lib-arm-marm-linux-gnueabihf-libm-so-so-so-6-version-glibc-29-not-not-found-required--thermadc/32341

I figured out the issue with the help of the beaglebone forum, and it is mainly caused by the mismatch of the versions of GLIBC (or any other lib for that matter) between the host and target.

This particular was solved by using the latest Debian Bullseye (GLIBC_2.31) distro instead of the Debian Buster (GLIBC_2.28) distro or the alternate was to use a host machine with GLIBC higher than the target GLIBC version.

For a better understanding of the problem, the link to the solution is: https://forum.beagleboard.org/t/lib-arm-linux-gnueabihf-libm-so-6-version-glibc-2-29-not-found-required-by-thermadc/32341

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文