Utility for figuring out which compiler and compiler version was used for compiling an executable file for Linux (in the ELF format).
With Go 1.17 or later:
go install github.com/xyproto/cdetect@latest
$ cdetect /bin/sh
GCC 8.1.1
$ cdetect /usr/bin/ls
GCC 8.2.0
$ cdetect testdata/rust_hello
Rust 1.27.0-nightly
$ cdetect go
Go 1.11.2
- Supports detection of compiler name and version if an executable was built with one of these compilers:
- GCC
- Clang
- FPC
- OCaml
- Go
- TCC (compiler name only, TCC does not store the version number in the executables)
- Rust (for stripped executables, only the compiler name and GCC version used for linking)
- GHC
- Works even with stripped executables.
- Should work for recent versions of all of the above compilers. Executables produced with old versions of the compilers may need more testing.
- Update dependencies
- Change the license from MIT to BSD-3
- Add support for executables built with GCC 8 for 32-bit PowerPC.
- Add detection of compiler name and version from executables built with
ghc
(Haskell).
- Refactor out code to the ainur module.
- Better support for 32-bit PowerPC ELF files.
- Fix an issue with version detection for Rust.
- Add support for detecting executables compiled with Rust.
- Will now look for the given filename in PATH, if not found.
- Add support for detecting executables compiled with Clang or TCC.
- Fix issue #1, detection of executables compiled with GCC on Void Linux.
- Rename the utility to
cdetect
.
- Support for detecting various compilers and compiler version numbers.
- Version: 0.6.0
- Author: Alexander F. Rødseth <xyproto@archlinux.org>
- License: BSD-3