Linux Find Out GNU gcc Compiler Version Used To Compile Running Kernel

To find out the version of the GCC compiler that was used to compile the running Linux kernel, you can use the gcc -v command. This command will display information about the version of GCC that is currently installed on your system, as well as any other components that are used during the build process, such as the linker. (https://www.utahcnacenters.com/)

Here’s how to do it:

  1. Open a terminal window.
  2. Type the following command and press Enter:
    gcc -v

The output of this command will include information about the version of GCC that is installed on your system. For example:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 10.2.0-7ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --with-as=/usr/bin/x86_64-linux-gnu-as --with-ld=/usr/bin/x86_64-linux-gnu-ld --program-suffix=-10 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 10.2.0 (Ubuntu 10.2.0-7ubuntu1~20.04)

You can use this information to determine which version of GCC was used to compile the running kernel. The kernel version can be determined using the uname -r command. You can then compare the version of GCC reported by the gcc -v command with the version required by the running kernel, which can usually be found in the release

Leave a Comment