Skip to content
Snippets Groups Projects
Commit c09ec0d4 authored by Dimitri Ledkov's avatar Dimitri Ledkov Committed by Emmanuel Bourg
Browse files

Fix FTBFS with gcc-10 due to warning that cannot be checked correctly (Closes: #966889)

parent 870ad0e0
No related branches found
Tags debian/5.5.0-1.1
No related merge requests found
libjna-java (5.5.0-1.1) unstable; urgency=medium
* Non-maintainer upload.
* Fix FTBFS with gcc-10 due to warning that cannot be checked
correctly. Closes: #966889
-- Dimitri John Ledkov <xnox@ubuntu.com> Mon, 24 Aug 2020 11:53:52 +0100
libjna-java (5.5.0-1) unstable; urgency=medium
* Team upload.
......
From 96c5df1d4d5985b31ddd8d5953d849ab64002f1d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Matthias=20Bl=C3=A4sing?= <mblaesing@doppel-helix.eu>
Date: Sun, 9 Aug 2020 13:08:06 +0200
Subject: [PATCH] Fix build error on GCC 10 caused by alloca bound warnings
Since GCC 10 warnings for unbounded alloca calls are turned on by
default. The size of the allocation comes from the java side of the
bindings and thus appears to be unchecked on the native side.
---
CHANGES.md | 2 +-
native/Makefile | 10 ++++++++--
2 files changed, 9 insertions(+), 3 deletions(-)
Index: libjna-java-5.5.0/native/Makefile
===================================================================
--- libjna-java-5.5.0.orig/native/Makefile
+++ libjna-java-5.5.0/native/Makefile
@@ -321,7 +321,7 @@ endif
endif
# CC_OPTS only applied to objects build for jnidispatch, not for libffi
-# -Wno-unknown-warning-option
+# -Wno-unknown-warning-option
# => Suppress warning for unknown warnings
# -Werror => Treat warnings as errors
# -Wno-clobbered => Silence GCC warning about clobbered automatic variables.
@@ -329,6 +329,12 @@ endif
# that implements "protected" mode. In that case an exception
# is raised and the value of the potentially clobbered
# variables is ignored.
+# -Wno-alloca-larger-than => Silence warnings about unbounded alloca calls in
+# the dispatch logic. GCC tries to assert, that the size of
+# the allocated memory is bounded and thus a check for the
+# variable needs to be inplace. For the JNA case, the size
+# comes from the Java side, so checks are not visible on the
+# C side and thus can't be checked there.
#
# Enable this only on GCC versions, that can work with it. It is assumed, that
# GCC version 4.X is the lower bound. That version is problematic, as it
@@ -337,7 +343,7 @@ ifeq ($(CC),gcc)
GCC_MAJOR_VERSION = $(shell gcc -dumpversion | cut -f 1 -d '.')
ifneq ($(GCC_MAJOR_VERSION),4)
ifneq ($(GCC_MAJOR_VERSION),3)
- LOC_CC_OPTS=-Wno-unknown-warning-option -Werror -Wno-clobbered -Wno-unused-variable
+ LOC_CC_OPTS=-Wno-unknown-warning-option -Werror -Wno-clobbered -Wno-unused-variable -Wno-alloca-larger-than
endif
endif
else
......@@ -5,3 +5,4 @@
10-disable-full-jar.patch
14-rename-native-library.patch
18-build-directory-in-soname.patch
96c5df1d4d5985b31ddd8d5953d849ab64002f1d.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment