Hello community,
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 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:
- 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/.
- Unzipped the package to a glibc-2.29 folder.
- 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