1From 963edf3f87d34e274885d9cc448651d8a1601a6f Mon Sep 17 00:00:00 2001 2From: Fabrice Fontaine <fontaine.fabrice@gmail.com> 3Date: Thu, 11 Jan 2024 17:38:41 +0100 4Subject: [PATCH] src/modules/rlm_python: fix build with -Ofast 5 6Stripping logic wrongly translates -Ofast into ast resulting in the 7following build failure: 8 9configure: /home/fabrice/buildroot/output/host/powerpc64-buildroot-linux-gnu/sysroot/usr/bin/python3-config's cflags were "-I/home/fabrice/buildroot/output/host/powerpc64-buildroot-linux-gnu/sysroot/usr/include/python3.11 -I/home/fabrice/buildroot/output/host/powerpc64-buildroot-linux-gnu/sysroot/usr/include/python3.11 -Wsign-compare -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Ofast -g0 -D_FORTIFY_SOURCE=2 -DNDEBUG -g -fwrapv -O3 -Wall" 10configure: Sanitized cflags were " -isystem/home/fabrice/buildroot/output/host/powerpc64-buildroot-linux-gnu/sysroot/usr/include/python3.11 -isystem/home/fabrice/buildroot/output/host/powerpc64-buildroot-linux-gnu/sysroot/usr/include/python3.11 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 ast -D_FORTIFY_SOURCE=2 -fwrapv " 11 12[...] 13 14powerpc64-buildroot-linux-gnu-gcc.br_real: error: ast: linker input file not found: No such file or directory 15 16Fixes: 17 - http://autobuild.buildroot.org/results/904c43241b99a8d848c1891cb5af132a291311b4 18 19Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> 20Upstream: https://github.com/FreeRADIUS/freeradius-server/pull/5263 21--- 22 src/modules/rlm_python/configure.ac | 4 ++-- 23 1 file changed, 2 insertions(+), 2 deletions(-) 24 25diff --git a/src/modules/rlm_python3/configure.ac b/src/modules/rlm_python3/configure.ac 26index e2f74574fb..ee30b324d9 100644 27--- a/src/modules/rlm_python3/configure.ac 28+++ b/src/modules/rlm_python3/configure.ac 29@@ -59,7 +59,7 @@ else 30 31 dnl # Convert -I to -isystem to get rid of warnings about issues in Python headers 32 dnl # Strip -systemroot 33- dnl # Strip optimisation flags (-O[0-9]?). We decide our optimisation level, not python. 34+ dnl # Strip optimisation flags (-O[0-9|fast]?). We decide our optimisation level, not python. 35 dnl # -D_FORTIFY_SOURCE needs -O. 36 dnl # Strip debug symbol flags (-g[0-9]?). We decide on debugging symbols, not python 37 dnl # Strip -W*, we decide what warnings are important 38@@ -73,7 +73,7 @@ else 39 mod_cflags=`echo " $python_cflags" | sed -e '\ 40 s/ -I/ -isystem/g;\ 41 s/ -isysroot[[ =]]\{0,1\}[[^-]]*/ /g;\ 42- s/ -O[[^[[:blank:]]]]*/ /g;\ 43+ s/ -O[[^[[:blank:]]*]]*/ /g;\ 44 s/ -Wp,-D_FORTIFY_SOURCE=[[[:digit:]]]/ /g;\ 45 s/ -g[[^ ]]*/ /g;\ 46 s/ -W[[^ ]]*/ /g;\ 47-- 482.43.0 49 50