Skip to content

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

@ebourg

Description

@ebourg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions