From 917a1a92d342646bbc54444c8c7eb9626a821fa3 Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Wed, 2 Feb 2022 11:37:03 +0000 Subject: [PATCH] Fix build with GCC 12 Signed-off-by: Radostin Stoyanov --- criu.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/criu.spec b/criu.spec index b053156..275939b 100644 --- a/criu.spec +++ b/criu.spec @@ -385,6 +385,11 @@ This script can help to workaround the so called "PID mismatch" problem. # that is fixed, disable LTO. %define _lto_cflags %{nil} +# With GCC 12 the build fails with: +# Unexpected undefined symbol: `strlen'. External symbol in PIE? +# '-ffreestanding' makes the compilation work with GCC 12. +CFLAGS+=" -ffreestanding " + # %{?_smp_mflags} does not work # -fstack-protector breaks build CFLAGS+=`echo %{optflags} | sed -e 's,-fstack-protector\S*,,g'` make V=1 WERROR=0 PREFIX=%{_prefix} RUNDIR=/run/criu PYTHON=%{py_binary}