Created attachment 790934 [details] dev-java:jna-5.11.0:20220710-210803.log =dev-java/jna-5.11.0 (and also 5.10.0) fails to build. The relevant snippet from the build log is as follows: native: [exec] x86_64-pc-linux-gnu-gcc -O2 -pipe -march=core2 -mtune=generic -fno-unwind-tables -fno-asynchronous -unwind-tables -fomit-frame-pointer -Wall -Wno-unused -Wno-parentheses -fPIC -O2 -fno-omit-frame-pointer -fno -strict-aliasing -D_REENTRANT -DHAVE_PROTECTION -I"/usr/lib64/icedtea8/jre/../include" -I"/usr/lib64/icedtea8/jre/../include/linux" -I"/var/tmp/portage/dev-java/jna-5.11.0/work/jna-5.11.0/build/headers" -I/include -DJNA _JNI_VERSION='"6.1.3"' -DCHECKSUM='"147a998f0cbc89681a1ae6c0dd121629"' -I/usr/lib64/libffi/include -Wno-unkno wn-warning-option -Werror -Wno-clobbered -Wno-unused-variable -c dispatch.c -o /var/tmp/portage/dev-java/jna-5 .11.0/work/jna-5.11.0/build/native-linux-x86-64/dispatch.o [exec] In file included from dispatch.h:33, [exec] from dispatch.c:30: [exec] dispatch.c: In function ‘dispatch_direct’: [exec] dispatch.c:1795:23: error: ‘alloca’ bound is unknown [-Werror=alloca-larger-than=] [exec] 1795 | args[i] = alloca(data->cif.arg_types[i]->size); [exec] | ^~~~~~ [exec] dispatch.c:1821:23: error: ‘alloca’ bound is unknown [-Werror=alloca-larger-than=] [exec] 1821 | args[i] = alloca(data->cif.arg_types[i]->size); [exec] | ^~~~~~ [exec] dispatch.c: At top level: [exec] cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended t o silence earlier diagnostics [exec] cc1: all warnings being treated as errors [exec] distcc[557] ERROR: compile dispatch.c on localhost failed [exec] make: *** [Makefile:463: /var/tmp/portage/dev-java/jna-5.11.0/work/jna-5.11.0/build/native-linux-x 86-64/dispatch.o] Error 1 BUILD FAILED /var/tmp/portage/dev-java/jna-5.11.0/work/jna-5.11.0/build.xml:791: exec returned: 2 I found https://stackoverflow.com/a/68865783, which claims that in version 5.5.0 this is/was caused by the use of -Werror in the Makefile and the new alloca warning in GCC 10, and that this should be fixed in 5.6.0. My reading of the Makefile suggests that the logic to turn off this warning in $LOC_CC_OPTS isn't working properly, perhaps because it's testing for GCC by testing whether $CC exactly equals "gcc", and when I used sed in post_src_prepare() in /etc/portage/env to add -Wno-alloca-larger-than to the "non-GCC" case, the build succeeded.
Created attachment 790937 [details] emerge-info.txt
There seems to be an upstream bug for compilation with GCC-10 (https://github.com/java-native-access/jna/issues/1244). Upstream already released a patch (https://github.com/java-native-access/jna/pull/1245).
Created attachment 805348 [details, diff] patch based on the suggestion by Jonathan Lovelace
(In reply to ilovekiruna from comment #3) > Created attachment 805348 [details, diff] [details, diff] > patch based on the suggestion by Jonathan Lovelace The patch works
"-Werror" was solved with bug #888813. Closing. If the problem persists, please re-open.