GLIBC version not found
Bug Description
I am trying to check a cross-compiled code, but I keep getting an error for each file:
pkg-config: /opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/lib/libc.so.6: version `GLIBC_2.34' not found (required by /home/pierre/.local/lib/python3.10/site-packages/codechecker_analyzer/ld_logger/lib/ldlogger.so)
The cross compiler is generated by Yocto, on dunfell branch, with version 3.1.16 (I updated it to the latest available version, thinking it was on my side), it is for a 32bits ARM target. The compiler is arm-poky-linux-gnueabi-gcc (GCC) 9.3.0. I used to work with CodeChecker on an older code, with an older cross-compiler (yocto 2.3.1, arm-poky-linux-gnueabi-gcc version 6.3.0) and it worked (and still works, I checked)
I manually checked the GLIBC version in the .so and the higher one is GLIBC_2.30.
CodeChecker version
[INFO 2022-06-16 11:27] - CodeChecker analyzer version:
---------------------------------------------------------------
Kind | Version
---------------------------------------------------------------
Base package version | 6.19.1
Package build date | 2022-03-18T16:12
Git commit ID (hash) | 9fa0f9817f6e91eda2a9202e0a3bf5006accdc8c
Git tag information | 6.19.1
---------------------------------------------------------------
[INFO 2022-06-16 11:27] - CodeChecker web version:
------------------------------------------------------------------------------
Kind | Version
------------------------------------------------------------------------------
Base package version | 6.19.1
Package build date | 2022-03-18T16:12
Git commit ID (hash) | 9fa0f9817f6e91eda2a9202e0a3bf5006accdc8c
Git tag information | 6.19.1
Server supported Thrift API version | 6.47
Client Thrift API version | 6.47
------------------------------------------------------------------------------
To Reproduce
I simply run the command to setup the compilation database (with an environment source
source /opt/poky/3.1.16/environment-setup-cortexa9t2hf-neon-poky-linux-gnueabi
CodeChecker log --output .codechecker/compile_commands.json --build make
Expected behaviour I expected a sucessful build, but the build fails, the compile_commands.json is an empty array.
Desktop
- OS: Fedora 35
- Browser: Opera/Firefox
- Version: 88.0.4412.40/101.0
Additional context
Debug output:
CodeChecker log --output compile_commands.json --build make --verbose debug
[DEBUG][2022-06-16 11:53:01] {system} [4111723] <139846275783552> - analyzer_context.py:82 __get_package_config() - Reading config: /home/pierre/.local/share/codechecker/config/config.json
[DEBUG][2022-06-16 11:53:01] {system} [4111723] <139846275783552> - analyzer_context.py:89 __get_package_config() - {'environment_variables': {'env_path': 'PATH', 'env_ld_lib_path': 'LD_LIBRARY_PATH', 'cc_logger_bin': 'CC_LOGGER_BIN', 'cc_logger_file': 'CC_LOGGER_FILE', 'cc_logger_compiles': 'CC_LOGGER_GCC_LIKE', 'ld_preload': 'LD_PRELOAD', 'codechecker_workspace': 'CODECHECKER_WORKSPACE'}}
[DEBUG][2022-06-16 11:53:01] {system} [4111723] <139846275783552> - analyzer_context.py:97 __get_package_layout() - Reading config: /home/pierre/.local/share/codechecker/config/package_layout.json
[INFO][2022-06-16 11:53:01] {buildlogger} [4111723] <139846275783552> - build_manager.py:61 perform_build_command() - Starting build...
[INFO][2022-06-16 11:53:01] {buildlogger} [4111723] <139846275783552> - build_manager.py:82 perform_build_command() - Using CodeChecker ld-logger.
[DEBUG_ANALYZER][2022-06-16 11:53:01] {buildlogger} [4111723] <139846275783552> - build_manager.py:137 perform_build_command() - environ({'SHELL': '/bin/zsh', 'SESSION_MANAGER': 'local/unix:@/tmp/.ICE-unix/2764,unix/unix:/tmp/.ICE-unix/2764', 'HISTCONTROL': 'ignoredups', 'XDG_MENU_PREFIX': 'gnome-', 'HOSTNAME': 'twiga-be-12', 'HISTSIZE': '50000', 'SSH_AUTH_SOCK': '/run/user/1000/keyring/ssh', 'XMODIFIERS': '@im=ibus', 'DESKTOP_SESSION': 'gnome-xorg', 'SSH_AGENT_PID': '2708', 'EDITOR': '/usr/bin/nano', 'PWD': '/home/pierre/workdir/apps/2005_/ymodem', 'XDG_SESSION_DESKTOP': 'gnome-xorg', 'LOGNAME': 'pierre', 'XDG_SESSION_TYPE': 'x11', 'QTLIB': '/usr/lib64/qt-3.3/lib', 'SYSTEMD_EXEC_PID': '207145', 'XAUTHORITY': '/run/user/1000/gdm/Xauthority', 'GJS_DEBUG_TOPICS': 'JS ERROR;JS LOG', 'WINDOWPATH': '2', 'GDM_LANG': 'fr_FR.UTF-8', 'HOME': '/home/pierre', 'USERNAME': 'pierre', 'LANG': 'fr_FR.UTF-8', 'XDG_CURRENT_DESKTOP': 'GNOME', 'INVOCATION_ID': '7ff5402b4acf4b08b7d437e7d26fd668', 'MANAGERPID': '2529', 'QTINC': '/usr/lib64/qt-3.3/include', 'GJS_DEBUG_OUTPUT': 'stderr', 'MOZ_GMP_PATH': '/usr/lib64/mozilla/plugins/gmp-gmpopenh264/system-installed', 'XDG_SESSION_CLASS': 'user', 'LESSOPEN': '||/usr/bin/lesspipe.sh %s', 'USER': 'pierre', 'DISPLAY': ':0', 'SHLVL': '1', 'QT_IM_MODULE': 'ibus', 'XDG_RUNTIME_DIR': '/run/user/1000', 'QTDIR': '/usr/lib64/qt-3.3', 'DEBUGINFOD_URLS': 'https://debuginfod.fedoraproject.org/ ', 'which_declare': 'typeset -f', 'KDEDIRS': '/usr', 'JOURNAL_STREAM': '8:645372', 'XDG_DATA_DIRS': '/home/pierre/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop', 'PATH': '/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/bin:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/sbin:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/bin:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/sbin:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/bin/../x86_64-pokysdk-linux/bin:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-musl:/opt/poky/2.3.1/sysroots/i686-pokysdk-linux/usr/bin:/opt/poky/2.3.1/sysroots/i686-pokysdk-linux/usr/sbin:/opt/poky/2.3.1/sysroots/i686-pokysdk-linux/bin:/opt/poky/2.3.1/sysroots/i686-pokysdk-linux/sbin:/opt/poky/2.3.1/sysroots/i686-pokysdk-linux/usr/bin/../i686-pokysdk-linux/bin:/opt/poky/2.3.1/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi:/opt/poky/2.3.1/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-uclibc:/opt/poky/2.3.1/sysroots/i686-pokysdk-linux/usr/bin/arm-poky-linux-musl:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/bin:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/sbin:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/bin:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/sbin:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/bin/../x86_64-pokysdk-linux/bin:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-musl:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/bin:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/sbin:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/bin:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/sbin:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/bin/../x86_64-pokysdk-linux/bin:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-musl:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/bin:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/sbin:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/bin:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/sbin:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/bin/../x86_64-pokysdk-linux/bin:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi:/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-musl:/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/var/lib/snapd/snap/bin:/home/pierre/bin:/home/pierre/bin', 'GDMSESSION': 'gnome-xorg', 'DBUS_SESSION_BUS_ADDRESS': 'unix:path=/run/user/1000/bus', 'MAIL': '/var/spool/mail/pierre', 'GIO_LAUNCHED_DESKTOP_FILE_PID': '212655', 'GIO_LAUNCHED_DESKTOP_FILE': '/usr/share/applications/code.desktop', 'OLDPWD': '/home/pierre/workdir/apps/2005_/ymodem', 'CHROME_DESKTOP': 'code-url-handler.desktop', 'ORIGINAL_XDG_CURRENT_DESKTOP': 'GNOME', 'GDK_BACKEND': 'x11', 'NO_AT_BRIDGE': '1', 'ZSH': '/home/pierre/.oh-my-zsh', 'PAGER': 'less', 'LESS': '-R', 'LSCOLORS': 'Gxfxcxdxbxegedabagacad', 'P9K_SSH': '0', '_': '/usr/bin/CodeChecker', 'TERM_PROGRAM': 'vscode', 'TERM_PROGRAM_VERSION': '1.68.0', 'COLORTERM': 'truecolor', 'VSCODE_GIT_IPC_HANDLE': '/run/user/1000/vscode-git-702d0b34dc.sock', 'VSCODE_GIT_ASKPASS_NODE': '/usr/share/code/code', 'VSCODE_GIT_ASKPASS_EXTRA_ARGS': '--ms-enable-electron-run-as-node', 'VSCODE_GIT_ASKPASS_MAIN': '/usr/share/code/resources/app/extensions/git/dist/askpass-main.js', 'GIT_ASKPASS': '/usr/share/code/resources/app/extensions/git/dist/askpass.sh', 'TERM': 'xterm-256color', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.m4a=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.oga=01;36:*.opus=01;36:*.spx=01;36:*.xspf=01;36:', 'P9K_TTY': 'old', '_P9K_TTY': '/dev/pts/5', 'SDKTARGETSYSROOT': '/opt/poky/3.1.16/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi', 'PKG_CONFIG_SYSROOT_DIR': '/opt/poky/3.1.16/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi', 'PKG_CONFIG_PATH': '/opt/poky/3.1.16/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi/usr/lib/pkgconfig:/opt/poky/3.1.16/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi/usr/share/pkgconfig', 'CONFIG_SITE': '/opt/poky/3.1.16/site-config-cortexa9t2hf-neon-poky-linux-gnueabi', 'OECORE_NATIVE_SYSROOT': '/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux', 'OECORE_TARGET_SYSROOT': '/opt/poky/3.1.16/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi', 'OECORE_ACLOCAL_OPTS': '-I /opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/share/aclocal', 'OECORE_BASELIB': 'lib', 'OECORE_TARGET_ARCH': 'arm', 'OECORE_TARGET_OS': 'linux-gnueabi', 'CC': 'arm-poky-linux-gnueabi-gcc -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/poky/3.1.16/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi', 'CXX': 'arm-poky-linux-gnueabi-g++ -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/poky/3.1.16/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi', 'CPP': 'arm-poky-linux-gnueabi-gcc -E -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/poky/3.1.16/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi', 'AS': 'arm-poky-linux-gnueabi-as ', 'LD': 'arm-poky-linux-gnueabi-ld --sysroot=/opt/poky/3.1.16/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi', 'GDB': 'arm-poky-linux-gnueabi-gdb', 'STRIP': 'arm-poky-linux-gnueabi-strip', 'RANLIB': 'arm-poky-linux-gnueabi-ranlib', 'OBJCOPY': 'arm-poky-linux-gnueabi-objcopy', 'OBJDUMP': 'arm-poky-linux-gnueabi-objdump', 'READELF': 'arm-poky-linux-gnueabi-readelf', 'AR': 'arm-poky-linux-gnueabi-ar', 'NM': 'arm-poky-linux-gnueabi-nm', 'M4': 'm4', 'TARGET_PREFIX': 'arm-poky-linux-gnueabi-', 'CONFIGURE_FLAGS': '--target=arm-poky-linux-gnueabi --host=arm-poky-linux-gnueabi --build=x86_64-linux --with-libtool-sysroot=/opt/poky/3.1.16/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi', 'CFLAGS': ' -O2 -pipe -g -feliminate-unused-debug-types ', 'CXXFLAGS': ' -O2 -pipe -g -feliminate-unused-debug-types ', 'LDFLAGS': '-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now', 'CPPFLAGS': '', 'KCFLAGS': '--sysroot=/opt/poky/3.1.16/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi', 'OECORE_DISTRO_VERSION': '3.1.16', 'OECORE_SDK_VERSION': '3.1.16', 'ARCH': 'arm', 'CROSS_COMPILE': 'arm-poky-linux-gnueabi-', 'OE_CMAKE_TOOLCHAIN_FILE': '/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig.cmake', 'OE_CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX': '', 'OPENSSL_CONF': '/opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/usr/lib/ssl-1.1/openssl.cnf', 'CC_LIB_DIR': '/home/pierre/.local/lib/python3.10/site-packages', 'CC_DATA_FILES_DIR': '/home/pierre/.local/share/codechecker', 'CC_LOGGER_BIN': 'ld_logger', 'LD_PRELOAD': 'ldlogger.so', 'LD_LIBRARY_PATH': '/home/pierre/.local/lib/python3.10/site-packages/codechecker_analyzer/ld_logger/lib', 'CC_LOGGER_FILE': '/home/pierre/workdir/apps/2005_/ymodem/compile_commands.json', 'CC_LOGGER_GCC_LIKE': 'gcc:g++:clang:clang++:cc:c++', 'CC_LOGGER_DEBUG_FILE': '/home/pierre/workdir/apps/2005_/ymodem/codechecker.logger.debug'})
rm -f *.so* xymodem.o
[RM] Clean temporary objects
arm-poky-linux-gnueabi-gcc -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/poky/3.1.16/sysroots/cortexa9t2hf-neon-poky-linux-gnueabi -o xymodem.o -c xymodem.c -O2 -pipe -g -feliminate-unused-debug-types -O2 -g -Wall -Wextra -Iinc/
arm-poky-linux-gnueabi-gcc: /opt/poky/3.1.16/sysroots/x86_64-pokysdk-linux/lib/libc.so.6: version `GLIBC_2.34' not found (required by /home/pierre/.local/lib/python3.10/site-packages/codechecker_analyzer/ld_logger/lib/ldlogger.so)
make: *** [Makefile:20 : xymodem.o] Erreur 1
[INFO][2022-06-16 11:53:01] {buildlogger} [4111723] <139846275783552> - build_manager.py:145 perform_build_command() - Build failed.
[INFO][2022-06-16 11:53:01] {buildlogger} [4111723] <139846275783552> - build_manager.py:155 perform_build_command() - The debug log file is: /home/pierre/workdir/apps/2005_/ymodem/codechecker.logger.debug
Have you tried setting the LD_PRELOAD or LD_LIBRARY_PATH envvars to let the CodeChecker (thus the ldlogger.so) to find the suitable glibc shared library?
ldlogger was build for x86_64 right? It should be able to run on that platform if the library paths are correct.
Alternatively, you can use other solutions for acquiring the compile_commands.json. e.g. CMake has an option for this, and I'm expecting that most sophisticated build generators also have something similar.
Alternatively, you can also try the build your application for x86_64. The majority of the bugreports would remain the same anyway.