Hello, I'm receiving the following error when compiling for arm using poudriere. Adding "--disable-jent-support" in the configure options fixes the problem, but I'm not sure what the security implications are. libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I../src -I../src -I/usr/local/include -O -pipe -fstack-protector-strong -fno-strict-aliasing -std=gnu89 -fvisibility=hidden -fno-delete-null-pointer-checks -Wall -c ./rndjent.c -fPIC -DPIC -o .libs/rndjent.o In file included from ./rndjent.c:86: ./jitterentropy-base.c:53:13: warning: unknown pragma ignored [-Wunknown-pragmas] #pragma GCC optimize ("O0") ^ ./jitterentropy-base.c:60:4: error: "The CPU Jitter random number generator must not be compiled with optimizations. See documentation. Use the compiler switch -O0 for compiling jitterentropy-base.c." #error "The CPU Jitter random number generator must not be compiled with optimizations. See documentation. Use the compiler switch -O0 for compiling jitterentropy-base.c." ^ 1 warning and 1 error generated. *** Error code 1 Stop. make[3]: stopped in /wrkdirs/usr/ports/security/libgcrypt/work/libgcrypt-1.9.2/random *** Error code 1 *** Error code 1 *** Error code 1 Stop. make: stopped in /usr/ports/security/libgcrypt
Can you provide uname -a output please. Also provide output from cc -v or gcc -v if appropriate, please. Is your gcc in base or in $LOCALBASE?
Created attachment 222649 [details] Poudriere log I'm attaching the full error log from poudriere, which I think contains the required information. The host environment is running amd64 (12.2-RELEASE-p3 FreeBSD 12.2-RELEASE-p3 r369178), whereas the build environment is armv6 (12.2-RELEASE-p3 FreeBSD 12.2-RELEASE-p3 1202000 arm) using qemu. Both are using the base compiler (clang version 10.0.1).
Created attachment 223350 [details] poudriere build log Also attaching my build log if it helps.
Can you provide uname -a output please. Also provide output from cc -v or gcc -v if appropriate, please. Is your gcc in base or in $LOCALBASE? Without this information I will be forced to close this ticket.
Created attachment 223351 [details] Try this patch. Try this patch.
The patch doesn't work. What does work is adding "--disable-jent-support" to the configure options in the Makefile. uname -a FreeBSD microserver.pi-greece.eu 12.2-RELEASE-p4 FreeBSD 12.2-RELEASE-p4 r369363 MICROSERVER12 arm cc -v FreeBSD clang version 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611aa2) Target: armv6-unknown-freebsd12.2-gnueabihf Thread model: posix InstalledDir: /usr/bin No gcc
Created attachment 223362 [details] Disable the jitter entropy generator on armv6 Here's a Makefile patch that fixes the compilation problem on armv6.
(In reply to Yani Karydis from comment #7) LGTM.
A commit references this bug: Author: cy Date: Wed Mar 17 16:11:28 UTC 2021 New revision: 568668 URL: https://svnweb.freebsd.org/changeset/ports/568668 Log: security/libgcrypt: Fix armv6 build Armv6 fails to build jitterentropy-base.c without optimization, even though #pragma GCC optimization and #pragma clang optimization are specified. For now brute force disable building the jitter entropy generator on armv6. PR: 253698 Submitted by: yani _ pi-greece.eu Reported by: yani _ pi-greece.eu Changes: head/security/libgcrypt/Makefile
armv7 still gets same error. --- rndjent.lo --- `echo /bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -I../src -I../src -I/usr/local/include -O -pipe -fstack-protector-strong -fno-strict-aliasing -std=gnu89 -fvisibility=hidden -fno-delete-null-pointer-checks -Wall -c ./rndjent.c | sed -e 's/-O\([1-9sg][1-9sg]*\)/-O0/g' -e 's/-Ofast/-O0/g' ` libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I../src -I../src -I/usr/local/include -O -pipe -fstack-protector-strong -fno-strict-aliasing -std=gnu89 -fvisibility=hidden -fno-delete-null-pointer-checks -Wall -c ./rndjent.c -fPIC -DPIC -o .libs/rndjent.o In file included from ./rndjent.c:86: ./jitterentropy-base.c:53:13: warning: unknown pragma ignored [-Wunknown-pragmas] #pragma GCC optimize ("O0") ^ ./jitterentropy-base.c:61:4: error: "The CPU Jitter random number generator must not be compiled with optimizations. See documentation. Use the compiler switch -O0 for compiling jitterentropy-base.c." #error "The CPU Jitter random number generator must not be compiled with optimizations. See documentation. Use the compiler switch -O0 for compiling jitterentropy-base.c." ^ 1 warning and 1 error generated. *** [rndjent.lo] Error code 1
A commit references this bug: Author: cy Date: Sat Mar 27 02:55:45 UTC 2021 New revision: 569290 URL: https://svnweb.freebsd.org/changeset/ports/569290 Log: security/libgcrypt: Fix armv7 build Similar to armv6, armv7 fails to build jitterentropy-base.c without optimization, falling flat on the #pragma GCC optimize statement. Like armv6, avoid building jitterentropy-base.c altogether. PR: 253698 Changes: head/security/libgcrypt/Makefile
This last commit should fix it.