GithubHelp home page GithubHelp logo

xyproto / cdetect Goto Github PK

View Code? Open in Web Editor NEW
27.0 4.0 1.0 1.92 MB

:microscope: Detect which compiler and compiler version a Linux executable (in the ELF format) was compiled with

License: BSD 3-Clause "New" or "Revised" License

Go 89.91% Shell 10.09%
utility gcc fpc ocaml detect go elf linux clang tcc

cdetect's Introduction

🔬 CDetect

Utility for figuring out which compiler and compiler version was used for compiling an executable file for Linux (in the ELF format).

Installation

With Go 1.17 or later:

go install github.com/xyproto/cdetect@latest

Example usage

$ 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

Features and limitations

  • 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.

Distro Packages

Packaging status

Changelog

0.5.4 to 0.6.0

  • Update dependencies
  • Change the license from MIT to BSD-3

0.5.3 to 0.5.4

  • Add support for executables built with GCC 8 for 32-bit PowerPC.

0.5.2 to 0.5.3

  • Add detection of compiler name and version from executables built with ghc (Haskell).

0.5.1 to 0.5.2

  • Refactor out code to the ainur module.
  • Better support for 32-bit PowerPC ELF files.

0.5 to 0.5.1

  • Fix an issue with version detection for Rust.

0.4 to 0.5

  • Add support for detecting executables compiled with Rust.
  • Will now look for the given filename in PATH, if not found.

0.3 to 0.4

  • Add support for detecting executables compiled with Clang or TCC.

0.2 to 0.3

  • Fix issue #1, detection of executables compiled with GCC on Void Linux.

0.1 to 0.2

  • Rename the utility to cdetect.

0.1

  • Support for detecting various compilers and compiler version numbers.

General info

cdetect's People

Contributors

xyproto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

wxywang89

cdetect's Issues

cdetect detects wrong version

Hi @xyproto !

I managed to create a package for Void linux, see PR #9176.

But there's a problem: we use GCC 7.2.0, but cdetect wrongly detects version 6.3.0 instead.

How is that possible ??

Thank you!

Downloading and building issue

I want to checkout but after that what are the steps to generate cDetect utility . Please provide step by step procedure to generate cDetect utility after cloning from git. The command i found in the README ( go get -u github.com/xyproto/cdetect ) file executed but unable to get the cDetect utility . I am trying on ubuntu 18.04 64 bit

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.