Skip to content

Commit

Permalink
new(contrib): add elftoolchain fork readme
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Guerra <[email protected]>
  • Loading branch information
LucaGuerra committed Nov 28, 2024
1 parent 8bfe9dd commit efc198f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions contrib/README.md
Original file line number Diff line number Diff line change
@@ -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()`

0 comments on commit efc198f

Please sign in to comment.