Check glibc version for a particular gcc compiler

后端 未结 8 1121
既然无缘
既然无缘 2020-11-29 19:13

I have two gcc compilers installed on my system, one is gcc 4.1.2 (default) and the other is gcc 4.4.4. How can I check the libc version used by

相关标签:
8条回答
  • 2020-11-29 19:47

    The easiest way is to use ldd which comes with glibc

    Just run this command ldd --version :

    dina@dina-X450LA:~$ ldd --version
    ldd (Ubuntu GLIBC 2.23-0ubuntu9) 2.23
    Copyright (C) 2016 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.
    

    Their is two additional ways to find out the glibc version:

    1. Check the version of the installed glibc rpm package : this by runing this command

      rpm -q glibc

    2. Check the version of the used libc.so file. This way is a little bit more difficult. You can check it in this link: Linux: Check the glibc version

    0 讨论(0)
  • 2020-11-29 19:52

    You can use strings command to check GLIBC version of compiler. Highest version is applicable.

    ubuntu1604:extra$ strings ./arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc | grep GLIBC
        GLIBC_2.3
        GLIBC_2.8
        GLIBC_2.14
        GLIBC_2.4
        GLIBC_2.11
        GLIBC_2.2.5
        GLIBC_2.3.4
    
    0 讨论(0)
提交回复
热议问题