runfalk / synology-wireguard

WireGuard support for some Synology NAS drives
MIT License
943 stars 132 forks source link

Compile error on DSM 7.2 armada38x #179

Closed fabiov64 closed 11 months ago

fabiov64 commented 1 year ago

I tried to compile for DSM 7.2 and armada38x. No problem in compiling for 7.1. Here the error on ratelimiter.c source:

/source/WireGuard/wireguard-linux-compat-1.0.20220627/src/ratelimiter.c:25:8: error: unknown type name 'hsiphash_key_t' 25 | static hsiphash_key_t key; | ^~~~~~ /source/WireGuard/wireguard-linux-compat-1.0.20220627/src/ratelimiter.c: In function 'wg_ratelimiter_allow': /source/WireGuard/wireguard-linux-compat-1.0.20220627/src/ratelimiter.c:109:36: error: implicit declaration of function 'hsiphash_2u32'; did you mean 'siphash_2u32'? [-Werror=implicit-function-declaration] 109 | bucket = &table_v4[hsiphash_2u32(net_word, ip, &key) & | ^~~~~ | siphash_2u32 /source/WireGuard/wireguard-linux-compat-1.0.20220627/src/ratelimiter.c:116:36: error: implicit declaration of function 'hsiphash_3u32'; did you mean 'siphash_3u32'? [-Werror=implicit-function-declaration] 116 | bucket = &table_v6[hsiphash_3u32(net_word, ip >> 32, ip, &key) & | ^~~~~ | siphash_3u32 cc1: some warnings being treated as errors scripts/Makefile.build:312: recipe for target '/source/WireGuard/wireguard-linux-compat-1.0.20220627/src/ratelimiter.o' failed make[3]: *** [/source/WireGuard/wireguard-linux-compat-1.0.20220627/src/ratelimiter.o] Error 1

Adiiiii88 commented 1 year ago

Hi. I have the same error with avoton arch: /source/WireGuard/wireguard-linux-compat-1.0.20220627/src/ratelimiter.c:25:8: error: unknown type name 'hsiphash_key_t' 25 | static hsiphash_key_t key; | ^~~~~~ /source/WireGuard/wireguard-linux-compat-1.0.20220627/src/ratelimiter.c: In function 'wg_ratelimiter_allow': /source/WireGuard/wireguard-linux-compat-1.0.20220627/src/ratelimiter.c:109:36: error: implicit declaration of function 'hsiphash_2u32'; did you mean 'siphash_2u32'? [-Werror=implicit-function-declaration] 109 | bucket = &table_v4[hsiphash_2u32(net_word, ip, &key) & | ^~~~~ | siphash_2u32 /source/WireGuard/wireguard-linux-compat-1.0.20220627/src/ratelimiter.c:116:36: error: implicit declaration of function 'hsiphash_3u32'; did you mean 'siphash_3u32'? [-Werror=implicit-function-declaration] 116 | bucket = &table_v6[hsiphash_3u32(net_word, ip >> 32, ip, &key) & | ^~~~~ | siphash_3u32 cc1: some warnings being treated as errors scripts/Makefile.build:308: recipe for target '/source/WireGuard/wireguard-linux-compat-1.0.20220627/src/ratelimiter.o' failed make[3]: [/source/WireGuard/wireguard-linux-compat-1.0.20220627/src/ratelimiter.o] Error 1 Makefile:1229: recipe for target 'module/source/WireGuard/wireguard-linux-compat-1.0.20220627/src' failed make[2]: [module/source/WireGuard/wireguard-linux-compat-1.0.20220627/src] Error 2 Makefile:26: recipe for target 'module' failed make[1]: [module] Error 2 make[1]: Leaving directory '/source/WireGuard/wireguard-linux-compat-1.0.20220627/src' Makefile:72: recipe for target 'wireguard-linux-compat-1.0.20220627/src/wireguard.ko' failed make: [wireguard-linux-compat-1.0.20220627/src/wireguard.ko] Error 2 [Error] Build project fail! Time cost: 00:00:10 [Build-->WireGuard] [INFO] Build WireGuard finished!

----------------- Time cost statistics ----------------- Time cost: 00:00:10 [Build-->WireGuard]

######################################################## Error(s) occurred on project "WireGuard" ######################################################## 1 projects, 1 failed, 0 blocked.

[Error] Check [/logs/error.build] for fixing errors. Install log

cat: /build_env/ds.avoton-7.2/logs.install: No such file or directory

false commented 1 year ago

any update for avoton ?

false commented 12 months ago

I had a look and it was fairly easy to fix, it is fixed on my fork : https://github.com/false/synology-wireguard should also work for armada38x, even though i didn't test

edit : avoton fix commit, https://github.com/false/synology-wireguard/commit/a2acdaa91c5946178c5b8b09a44f525b5eb01a0a

fabiov64 commented 12 months ago

@false : your patch is not working as is for armada38x, but following the same approach I was able to compile. For armada38x the build.sh file must be changed adding after row 84 the following:

if [ -f "$build_env/usr/local/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/usr/lib/modules/DSM-$DSM_VER/build/include/linux/siphash.h" ]; then echo "[i] Existing include linux/siphash.h -> rm" rm "$build_env/usr/local/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/usr/lib/modules/DSM-$DSM_VER/build/include/linux/siphash.h" fi

Thanks a lot for your suggestion