Open WhyNotHugo opened 1 year ago
So I understand the issue: both files being included define struct ethhdr
. However, both of them defined other types which are used, so removing either of them is not an option.
I tired hacking around this with this horrible patch:
diff --git a/daemon/io.c b/daemon/io.c
index 42688f5..b41e8fb 100644
--- a/daemon/io.c
+++ b/daemon/io.c
@@ -25,7 +25,10 @@
#include <net/if.h>
#include <sys/ioctl.h>
#ifndef __APPLE__
-#include <linux/if_tun.h>
+/* #include <linux/if_tun.h> */
+#define IFF_NO_PI 0x1000
+#define IFF_TAP 0x0002
+#define TUNSETIFF _IOW('T', 202, int)
#else
#include <sys/sys_domain.h>
#include <sys/kern_control.h>
But build now fails with another unrelated error:
> make
[ 5%] Built target radiotap
[ 51%] Built target awdl
[ 64%] Built target owl
[ 67%] Building CXX object googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
In file included from /home/hugo/clones/github.com/seemoo-lab/owl/googletest/googletest/src/gtest-all.cc:42:
/home/hugo/clones/github.com/seemoo-lab/owl/googletest/googletest/src/gtest-death-test.cc: In function 'bool testing::internal::StackGrowsDown()':
/home/hugo/clones/github.com/seemoo-lab/owl/googletest/googletest/src/gtest-death-test.cc:1301:24: error: 'dummy' may be used uninitialized [-Werror=maybe-uninitialized]
1301 | StackLowerThanAddress(&dummy, &result);
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/hugo/clones/github.com/seemoo-lab/owl/googletest/googletest/src/gtest-death-test.cc:1290:13: note: by argument 1 of type 'const void*' to 'void testing::internal::StackLowerThanAddress(const void*, bool*)' declared here
1290 | static void StackLowerThanAddress(const void* ptr, bool* result) {
| ^~~~~~~~~~~~~~~~~~~~~
/home/hugo/clones/github.com/seemoo-lab/owl/googletest/googletest/src/gtest-death-test.cc:1299:7: note: 'dummy' declared here
1299 | int dummy;
| ^~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [googletest/googletest/CMakeFiles/gtest.dir/build.make:76: googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:322: googletest/googletest/CMakeFiles/gtest.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
Thanks to your "horrible" patch I was able to compile owl on Alpine successfully. I didn't get any further errors. You could also try to update googletest as described in issue #50
Thanks for the pointer to https://github.com/seemoo-lab/owl/issues/50. I've submitted https://github.com/seemoo-lab/owl/issues/80 which fixes that other issue.
I'm still unsure what to do about this patch of mine, it doesn't seem clean enough to include on the project, but I also can't think of any cleaner approach.
I'm building on Alpine Linux. I installed the following dependencies (based on the hints in the README):
The
make
step of the build process fails with: