So reading a bit through the comments, I checked on a few things.
- gcc is available for FreeBSD (I installed it)
- I figured out how to force cmake to use it. It gets a slight bit farther.
- I removed -Werror from src/CMakeLists.txt
I am guessing trying to build it with gcc will be more useful than with clang? This is with the pi-hole archive, not the WIP version from freqlabs
My edits to the build.sh script:
# Configure build
mkdir -p cmake
cd cmake
#cmake ..
cmake -DCMAKE_C_COMPILER=/usr/local/bin/gcc ..
# Build the sources
#cmake --build . -- -j $(nproc)
cmake --build . -- -j 2
Now it gets here:
I do not know what sys/prctl.h does, is it in kernel headers?
~/FTL$ bash ./build.sh
-- The C compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/local/bin/gcc
-- Check for working C compiler: /usr/local/bin/gcc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/kgrider/FTL/cmake
Scanning dependencies of target database
[ 1%] Building C object src/database/CMakeFiles/database.dir/common.c.o
In file included from /home/kgrider/FTL/src/database/common.c:11:
/home/kgrider/FTL/src/FTL.h:35:10: fatal error: sys/prctl.h: No such file or directory
35 | #include <sys/prctl.h>
| ^~~~~~~~~~~~~
compilation terminated.
--- src/database/CMakeFiles/database.dir/common.c.o ---
*** [src/database/CMakeFiles/database.dir/common.c.o] Error code 1
make[2]: stopped in /usr/home/kgrider/FTL/cmake
1 error
make[2]: stopped in /usr/home/kgrider/FTL/cmake
--- src/database/CMakeFiles/database.dir/all ---
*** [src/database/CMakeFiles/database.dir/all] Error code 2
make[1]: stopped in /usr/home/kgrider/FTL/cmake
Scanning dependencies of target sqlite3
A failure has been detected in another branch of the parallel make
make[2]: stopped in /usr/home/kgrider/FTL/cmake
--- src/database/CMakeFiles/sqlite3.dir/all ---
*** [src/database/CMakeFiles/sqlite3.dir/all] Error code 2
make[1]: stopped in /usr/home/kgrider/FTL/cmake
2 errors
make[1]: stopped in /usr/home/kgrider/FTL/cmake
*** [all] Error code 2
make: stopped in /usr/home/kgrider/FTL/cmake
1 error
make: stopped in /usr/home/kgrider/FTL/cmake
So I found this:
The headers I got were:
ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/11.3-RELEASE/src.txz
I installed the headers and looked for sys/prctl.h and found nothing like that. I expected it here:
/usr/src/sys/amd64/amd64. I have no idea if this is right or not.