Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuzzers - explicit C compiler #337

Open
GrosQuildu opened this issue Feb 19, 2020 · 0 comments
Open

Fuzzers - explicit C compiler #337

GrosQuildu opened this issue Feb 19, 2020 · 0 comments

Comments

@GrosQuildu
Copy link
Contributor

GrosQuildu commented Feb 19, 2020

Frontends specifies compiler for c++ code only:

"COMPILER": "afl-clang++"

There are two issues related to that fact:

  1. We strip "++" from the compiler to get compiler name for C code:

    env["CC"] = self.compiler_exe.replace('++', '')
    env["CXX"] = self.compiler_exe
    L.debug("CC=%s and CXX=%s", env['CC'], env['CXX'])

    We should allow frontends to explicitly specify C compiler.

  2. We use only C++ compiler anyway:

    compiler_args: List[str] = ["-std=c++11", self.compile_test] + flags + ["-o", _out_bin] # type: ignore
    compile_cmd = [self.compiler_exe] + compiler_args
    L.debug("Compilation command: %s", compile_cmd)

    We should detect if compiled file is C or C++ and set the compiler accordingly. Unless env vars we set earlier in the code do the job?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant