2
1

0009-src-modules-rlm_python-fix-build-with-Ofast.patch 2.5 KB

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