Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure with GCC 10 ('alloca' bound is unknown) #1244

Closed
ebourg opened this issue Aug 6, 2020 · 2 comments
Closed

Build failure with GCC 10 ('alloca' bound is unknown) #1244

ebourg opened this issue Aug 6, 2020 · 2 comments

Comments

@ebourg
Copy link
Contributor

ebourg commented Aug 6, 2020

Hi,

When building JNA 5.6 on Debian (sid) the build failed with the following error:

native:
     [exec] make[2]: Entering directory '/build/libjna-java-5.6.0/native'
     [exec] gcc -m64 -W -Wall -Wno-unused -Wno-parentheses -fPIC  -O2 -fno-omit-frame-pointer -fno-strict-aliasing  -D_REENTRANT -DHAVE_PROTECTION -I"/usr/lib/jvm/java-11-openjdk-amd64/include" -I"/usr/lib/jvm/java-11-openjdk-amd64/include/linux" -I"/build/libjna-java-5.6.0/build/headers" -I/include -DJNA_JNI_VERSION='"6.1.0"' -DCHECKSUM='""'  -Wno-unknown-warning-option -Werror -Wno-clobbered -Wno-unused-variable -c dispatch.c -o /build/libjna-java-5.6.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:1770:23: error: 'alloca' bound is unknown [-Werror=alloca-larger-than=]
     [exec]  1770 |             args[i] = alloca(data->cif.arg_types[i]->size);
     [exec]       |                       ^~~~~~
     [exec] dispatch.c:1796:23: error: 'alloca' bound is unknown [-Werror=alloca-larger-than=]
     [exec]  1796 |             args[i] = alloca(data->cif.arg_types[i]->size);
     [exec]       |                       ^~~~~~
     [exec] make[2]: Leaving directory '/build/libjna-java-5.6.0/native'
     [exec] dispatch.c: At top level:
     [exec] cc1: note: unrecognized command-line option '-Wno-unknown-warning-option' may have been intended to silence earlier diagnostics
     [exec] cc1: all warnings being treated as errors
     [exec] make[2]: *** [Makefile:430: /build/libjna-java-5.6.0/build/native-linux-x86-64/dispatch.o] Error 1

I'm not sure but I suspect the error appeared when switching to GCC 10.

@matthiasblaesing
Copy link
Member

You are right. I checked debian testing vs. unstable and indeed gcc is the core component, that was updated and caused the test failure. While the release notes of gcc10 do not report a change in the -Wall behaviour, I assume alloca-larger-than was added to the list of warnings activated by default.

The patch in #1245 surpresses the warning on GCC.

@matthiasblaesing
Copy link
Member

Fix was merged to master - the patch itself should apply cleanly to 5.6.0 so feel free to extract it to fix the FTBS bug on debian.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants