aboutgitcodebugslistschat
path: root/Makefile
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-10-19 17:28:18 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-10-20 08:29:30 +0200
commit1a563a0cbd4926d0dfe9065a4fcd8771c5b292cc (patch)
tree13ee3b6da82e5eb53a89bb881ccf3a7092dab9fe /Makefile
parent087b5f4dbb9e3f767a8afbb6c1001c509965940b (diff)
downloadpasst-1a563a0cbd4926d0dfe9065a4fcd8771c5b292cc.tar
passt-1a563a0cbd4926d0dfe9065a4fcd8771c5b292cc.tar.gz
passt-1a563a0cbd4926d0dfe9065a4fcd8771c5b292cc.tar.bz2
passt-1a563a0cbd4926d0dfe9065a4fcd8771c5b292cc.tar.lz
passt-1a563a0cbd4926d0dfe9065a4fcd8771c5b292cc.tar.xz
passt-1a563a0cbd4926d0dfe9065a4fcd8771c5b292cc.tar.zst
passt-1a563a0cbd4926d0dfe9065a4fcd8771c5b292cc.zip
passt: Address gcc 11 warnings
A mix of unchecked return values, a missing permission mask for open(2) with O_CREAT, and some false positives from -Wstringop-overflow and -Wmaybe-uninitialized. Reported-by: Martin Hauke <mardnh@gmx.de> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 14 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index c2077f2..6d11e22 100644
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,20 @@ CFLAGS += -DPAGE_SIZE=$(shell getconf PAGE_SIZE)
CFLAGS += -DNETNS_RUN_DIR=\"/run/netns\"
CFLAGS += -DPASST_AUDIT_ARCH=AUDIT_ARCH_$(shell uname -m | tr [a-z] [A-Z])
+# On gcc 11.2, with -O2 and -flto, tcp_hash() and siphash_20b(), if inlined,
+# seem to be hitting something similar to:
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78993
+# from the pointer arithmetic used from the tcp_tap_handler() path to get the
+# remote connection address.
+ifeq ($(shell $(CC) -dumpversion),11)
+ifneq (,$(filter -flto%,$(CFLAGS)))
+ifneq (,$(filter -O2,$(CFLAGS)))
+ CFLAGS += -DTCP_HASH_NOINLINE
+ CFLAGS += -DSIPHASH_20B_NOINLINE
+endif
+endif
+endif
+
prefix ?= /usr/local
all: passt pasta passt4netns qrap