From efc198f1d33afe02321e2a9437054c4cf9f75a29 Mon Sep 17 00:00:00 2001 From: Luca Guerra Date: Thu, 28 Nov 2024 16:09:33 +0000 Subject: [PATCH] new(contrib): add elftoolchain fork readme Signed-off-by: Luca Guerra --- contrib/README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 contrib/README.md diff --git a/contrib/README.md b/contrib/README.md new file mode 100644 index 0000000000..d265fbe51f --- /dev/null +++ b/contrib/README.md @@ -0,0 +1,25 @@ +# Contrib directory + +This directory contains forks of some projects that may not be included as-is and require custom patches. + +## Elftoolchain + +This is the version of Elftoolchain (https://sourceforge.net/projects/elftoolchain/) that is used to satisfy the `libelf` requirement of the Falco libraries and its dependent `libbpf`. + +This is how this fork was created: + +* We downloaded the code from https://sourceforge.net/projects/elftoolchain/ +* We precompiled the autogenerated files by running: + +```sh +cd common/sys +m4 -I$(pwd) -D SRCDIR=$(pwd) elfdefinitions.m4 > elfdefinitions.h +cd ../../libelf +m4 -D SRCDIR=$(pwd) libelf_fsize.m4 > libelf_fsize.c +m4 -D SRCDIR=$(pwd) libelf_msize.m4 > libelf_msize.c +m4 -D SRCDIR=$(pwd) libelf_convert.m4 > libelf_convert.c +``` + +* We wrote `CMakeLists.txt` and `libelf/CMakeLists.txt` to enable CMake to build `libelf` +* We added compatibility patches `elf.h`, `gelf_getnote.c`, `gelf_versym.c` and modified `gelf.h`, `libelf.h` to make this flavor of libelf work with libbpf +* This way, a new target `elf` is built and can be linked via `target_link_libraries()`