[PATCH] urngd: fixes compilation with glibc

Rafał Miłecki rafal at milecki.pl
Wed Sep 27 13:08:14 PDT 2023


On 16.09.2023 05:55, Chukun Pan wrote:
> When compiling with glibc it will result in error:
> 1. #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
> Fix this by compiling with optimization (-O2) by default.
> 
> 2. jitterentropy-base.c:(.text+0x39f8): undefined reference to `pthread_join'
> Fix this by always linking pthread.

Others already said we can't switch to -O2, I'll just add some references.

At some point jitterentropy-library switched from -O0 to -O2:
3130cd99d7fa ("replace LSFR with SHA-3 256")
https://github.com/smuellerDD/jitterentropy-library/commit/3130cd99d7fa308c00cc2c4be6c5aa20c002be56

That was however explicitly changed back later with the:
20184e97af8f ("Compile Jitter RNG without optimizations")
https://github.com/smuellerDD/jitterentropy-library/commit/20184e97af8f227cc0787c4155ff4f3b2b7f1fe3

Also jitterentropy-rngd uses -O0:
f1bc39ae713a ("use -O0")
https://github.com/smuellerDD/jitterentropy-rngd/commit/f1bc39ae713a253077b0c47b4a1ad53f32bbfce0



More information about the openwrt-devel mailing list