Closed EliaGeretto closed 5 years ago
Apparently the fix for my local machine does not pass CI. I will figure it out.
The last commit specifies that the compiler should be clang
when using the pre-compiled version of LLVM. In this way, the CI build is fixed.
Thanks for your contribution, EliaGeretto.
The compilation of an LLVM pass should be made with the same compiler used to build LLVM itself. The build system should not force
clang
since most Linux distribution build LLVM usingg++
and thusllvm-config --cxxflags
may be incompatible withclang
. In that case,g++
should be used for the pass as well.
Agree.
The last commit specifies that the compiler should be clang when using the pre-compiled version of LLVM. In this way, the CI build is fixed.
However, if we export CC to clang by committing https://github.com/AngoraFuzzer/Angora/pull/58/commits/c8521266403d3f506d981a3e5f96788f7fc2b427 , it becomes using clang to compile the passes the same as before.
I merged it to dev branches now. And I will try to fix the CI in another way.
What you said is true, but c852126 sets the default compiler only when llvm-config
is not found in PATH
, which is true for CI but not true if one is using a precompiled version of LLVM. In that case, the compiler will remain g++
. If instead one is using the version downloaded from the LLVM website, he needs to use clang
anyway, because that is the compiler used to compile that one.
This solution, however, is really fragile since the compiler can be changed in a subsequent build. Have you ever considered switching the build system for the LLVM passes to CMake? That would probably make things a little bit more robust.
Cmake is a better choice. I plan to migrate to it from makefile in the future.
The generation of
version.config
does not work on Linux since, by default,echo
does not interpret backslash escapes. The same file should also not be recorded by the VCS, since it is generated during the build process.The compilation of an LLVM pass should be made with the same compiler used to build LLVM itself. The build system should not force
clang
since most Linux distribution build LLVM usingg++
and thusllvm-config --cxxflags
may be incompatible withclang
. In that case,g++
should be used for the pass as well.The last commit adds
stdarg.h
sinceva_list
is used without including the correct header.