Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer builds Arch 6.12.1 - unaligned.h #237

Open
jayray-git opened this issue Dec 4, 2024 · 1 comment
Open

No longer builds Arch 6.12.1 - unaligned.h #237

jayray-git opened this issue Dec 4, 2024 · 1 comment

Comments

@jayray-git
Copy link

jayray-git commented Dec 4, 2024

Getting the following build error that is fixable:
Compiling 2.6-17-g0eb2092-dirty for kernel 6.12.1-arch1-1
make -C /lib/modules/6.12.1-arch1-1/build M=/root/ipt-netflow modules
make[1]: Entering directory '/usr/lib/modules/6.12.1-arch1-1/build'
CC [M] /root/ipt-netflow/ipt_NETFLOW.o
/root/ipt-netflow/ipt_NETFLOW.c:71:10: fatal error: asm/unaligned.h: No such file or directory
71 | #include <asm/unaligned.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [scripts/Makefile.build:229: /root/ipt-netflow/ipt_NETFLOW.o] Error 1
make[2]: *** [/usr/lib/modules/6.12.1-arch1-1/build/Makefile:1936: /root/ipt-netflow] Error 2
make[1]: *** [Makefile:224: __sub-make] Error 2
make[1]: Leaving directory '/usr/lib/modules/6.12.1-arch1-1/build'
make: *** [Makefile:27: ipt_NETFLOW.ko] Error 2
Compiling 2.6-17-g0eb2092-dirty for kernel 6.12.1-arch1-1
make -C /lib/modules/6.12.1-arch1-1/build M=/root/ipt-netflow modules
make[1]: Entering directory '/usr/lib/modules/6.12.1-arch1-1/build'
CC [M] /root/ipt-netflow/ipt_NETFLOW.o
/root/ipt-netflow/ipt_NETFLOW.c:71:10: fatal error: asm/unaligned.h: No such file or directory
71 | #include <asm/unaligned.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [scripts/Makefile.build:229: /root/ipt-netflow/ipt_NETFLOW.o] Error 1
make[2]: *** [/usr/lib/modules/6.12.1-arch1-1/build/Makefile:1936: /root/ipt-netflow] Error 2
make[1]: *** [Makefile:224: __sub-make] Error 2
make[1]: Leaving directory '/usr/lib/modules/6.12.1-arch1-1/build'
make: *** [Makefile:27: ipt_NETFLOW.ko] Error 2

#change the following:
< #include <asm/unaligned.h>

#include <linux/unaligned.h>

Then the build error is this array:
Compiling 2.6-17-g0eb2092-dirty for kernel 6.12.1-arch1-1
make -C /lib/modules/6.12.1-arch1-1/build M=/root/ipt-netflow modules
make[1]: Entering directory '/usr/lib/modules/6.12.1-arch1-1/build'
CC [M] /root/ipt-netflow/ipt_NETFLOW.o
In file included from /root/ipt-netflow/ipt_NETFLOW.c:77:
/root/ipt-netflow/compat.h:219:15: warning: no previous prototype for 'timeval_to_jiffies' [-Wmissing-prototypes]
219 | unsigned long timeval_to_jiffies(const struct timeval *tv)
| ^~~~~~~~~~~~~~~~~~
/root/ipt-netflow/compat.h:384:20: warning: no previous prototype for 'compat_hex_to_bin' [-Wmissing-prototypes]
384 | #define hex_to_bin compat_hex_to_bin
| ^~~~~~~~~~~~~~~~~
/root/ipt-netflow/compat.h:386:5: note: in expansion of macro 'hex_to_bin'
386 | int hex_to_bin(char ch)
| ^~~~~~~~~~
/root/ipt-netflow/compat.h:716:20: warning: no previous prototype for 'strtoul' [-Wmissing-prototypes]
716 | unsigned long long strtoul(const char *cp, char **endp, unsigned int base)
| ^~~~~~~
/root/ipt-netflow/ipt_NETFLOW.c:3538:20: error: conflicting types for 'put_unaligned_be24'; have 'void(u32, unsigned char *)' {aka 'void(unsigned int, unsigned char *)'}
3538 | static inline void put_unaligned_be24(u32 val, unsigned char *p)
| ^~~~~~~~~~~~~~~~~~
In file included from ./include/linux/etherdevice.h:24,
from /root/ipt-netflow/ipt_NETFLOW.c:38:
./include/linux/unaligned.h:103:20: note: previous definition of 'put_unaligned_be24' with type 'void(const u32, void *)' {aka 'void(const unsigned int, void *)'}
103 | static inline void put_unaligned_be24(const u32 val, void *p)
| ^~~~~~~~~~~~~~~~~~
make[3]: *** [scripts/Makefile.build:229: /root/ipt-netflow/ipt_NETFLOW.o] Error 1
make[2]: *** [/usr/lib/modules/6.12.1-arch1-1/build/Makefile:1936: /root/ipt-netflow] Error 2
make[1]: *** [Makefile:224: __sub-make] Error 2
make[1]: Leaving directory '/usr/lib/modules/6.12.1-arch1-1/build'
make: *** [Makefile:27: ipt_NETFLOW.ko] Error 2

Anyone want to give me a hand in fixing this?
error: conflicting types for 'put_unaligned_be24'; have 'void(u32, unsigned char *)' {aka 'void(unsigned int, unsigned char *)'}

@kalamlacki
Copy link

kalamlacki commented Dec 21, 2024

Hello,

You had a good idea to replace asm/unaligned.h to linux/unaligned.h but it is not enough.
When I also added:

#define HAVE_PUT_UNALIGNED_BE24

before

#endif /* COMPAT_NETFLOW_H */

in compat.h

I was able to compile ipt-netflow module on debian sid with kernel 6.12.5 for amd64 architecture
but this was after applying 230.patch file patch from:
https://aur.archlinux.org/ipt_netflow.git/

This preprocessor constant should be generated by make and saved in compat_def.h but somehow it is not that is why we need workaround in compat.h

Best regards,
Łukasz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants