apple / HomeKitADK

Apache License 2.0
2.55k stars 232 forks source link

Compile Error #44

Closed ckilimci closed 4 years ago

ckilimci commented 4 years ago

Hi all,

I am getting a compile error for yocto build:

clang -Wall -Werror -DHAP_ENABLE_DEVELOPMENT_ONLY_CODE=1 -ffunction-sections -fdata-sections -IHAP -IExternal/HTTP -IExternal/JSON -IExternal/Base64 -IPAL -I/include -O0 -g -DHAP_LOG_LEVEL=3 -DHAP_TESTING -IPAL/Linux -IPAL/Linux -DHAP_Debug -c PAL/Linux/HAPPlatformRandomNumber.c -o Output/Linux-x86_64-unknown-linux-gnu/Debug/PAL/Linux/HAPPlatformRandomNumber.o PAL/Linux/HAPPlatformRandomNumber.c:48:44: error: use of undeclared identifier 'GRND_NONBLOCK' const int getrandomFlags = GRND_NONBLOCK; // Use the urandom source and do not block. ^ PAL/Linux/HAPPlatformRandomNumber.c:52:29: error: use of undeclared identifier 'SYS_getrandom' n = syscall(SYS_getrandom, &((uint8_t*) bytes)[o], c, getrandomFlags); ^ 2 errors generated. make[1]: *** [Output/Linux-x86_64-unknown-linux-gnu/Debug/PAL/Linux/HAPPlatformRandomNumber.o] Error 1

I defined dependencies as "clang openssl avahi". I am using following command to build: make TARGET=Linux DOCKER=0 PROTOCOLS=IP apps

What could be the problem?

ghost commented 4 years ago

hi, @ckilimci Is your linux kernel version older than 3.17? GRND_NONBLOCK was introduce in 3.17

https://elixir.bootlin.com/linux/v3.16/ident/GRND_NONBLOCK https://elixir.bootlin.com/linux/v3.17/ident/GRND_NONBLOCK

ckilimci commented 4 years ago

Hi @hao-gao ,

Actually my target machine is 4.9 but the host is 3.13. I guess, there is a problem on path.

Thank you for your time.