clamav-bytecode-compiler
clamav-bytecode-compiler copied to clipboard
Clang 16 upgrade
It would be good to update the example pass code to use the new style, as well. In https://github.com/Cisco-Talos/clamav-bytecode-compiler/tree/main/example
We should update the CMakeLists.txt / add the new CMakeLists.txt for the object library and shared library. And change all the #include " to #include <. Etc.
There are still a handful of places where I see #include "llvm instead of #include <llvm:
- ifacegen.cpp (broken module, due for overhaul and migration to clamav repo. But it couldn't hurt to switch to the other
#includestyle.) - HelloWorld.cpp (dated, need to update example)
- ClamBCPreserveABIs.cpp (some commented out, some not. Can we deleted the commented ones?)
- ClamBCRegAlloc.cpp (commented out headers. Perhaps delete)
- libclambcc/Common/ClamBCModule.h (delete file?)
- libclambcc/Common/ClamBCRegAlloc.cpp (delete file?)
There are a bunch of #if 0-blocks and it may be time to remove them.
Looks like the github workflow also needs to be updated to use clang-16 from clang-8: https://github.com/Cisco-Talos/clamav-bytecode-compiler/actions/runs/7480532064/job/20360149066 https://github.com/Cisco-Talos/clamav-bytecode-compiler/blob/Clang-16-Upgrade/.github/workflows/cmake.yml#L143
To get the clang-format test to pass, we should also upgrade this to use clang-format-16 with the latest version of the github actions plugin, which will be v4.11.0: https://github.com/Cisco-Talos/clamav-bytecode-compiler/blob/Clang-16-Upgrade/.github/workflows/clang-format.yml#L29-L31
All of the CI tests are failing:
- cmake build is failing because the selected OS doesn't have clang-16. We could install from https://apt.llvm.org/ to ensure it is available.
- clang-format-16 is failing, because it expects a space between
//or/*and comment bodies. - jenkins is failing with some network error in the freebsd 12.1 jail. Possibly because jails/iocage is janky. If Judge is indeed moving us to use Docker for sigmanager, perhaps we can abandon freebsd in the test-bcc pipeline and test our Docker image instead.
All of the CI tests are failing:
- cmake build is failing because the selected OS doesn't have clang-16. We could install from https://apt.llvm.org/ to ensure it is available.
- clang-format-16 is failing, because it expects a space between
//or/*and comment bodies.- jenkins is failing with some network error in the freebsd 12.1 jail. Possibly because jails/iocage is janky. If Judge is indeed moving us to use Docker for sigmanager, perhaps we can abandon freebsd in the test-bcc pipeline and test our Docker image instead.
clam-format was using clang-format-12. I fixed it and re-formatted, so the formatting errors should go away.
I just added a commit that restructures the libclambcc directory and CMakeLists.txt to have all opt-passes' source code (and thus build objects) located in the same directory instead of subdirectories.
This fixes the unit tests, because they rely on LD_LIBRARY_PATH to specify a directory where the opt-pass libs are located.
I think you should also delete the
Dockerfile. We now maintain that in theclamav-dockerrepo, and having one here confuses things.
Since I made a commit to fix the unit tests, I snuck in this change as well, deleting the Dockerfile.
To test the docker build, will need to grab the Dockerfile from the clamav-docker repo. I'll put in a PR for that in a moment. I have that working as well.
Here's the clamav-docker PR: https://github.com/Cisco-Talos/clamav-docker/pull/42
The clang-format-16 check failed