2
1

0005-src-modules-rlm_python-fix-build-with-Ofast.patch 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. [Dario: make the patch to be applied with fuzz factor 0]
  16. Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
  17. ---
  18. src/modules/rlm_python3/configure.ac | 4 ++--
  19. 1 file changed, 2 insertions(+), 2 deletions(-)
  20. diff --git a/src/modules/rlm_python3/configure.ac b/src/modules/rlm_python3/configure.ac
  21. index e2f74574fb..ee30b324d9 100644
  22. --- a/src/modules/rlm_python3/configure.ac
  23. +++ b/src/modules/rlm_python3/configure.ac
  24. @@ -44,7 +44,7 @@ else
  25. dnl # Convert -I to -isystem to get rid of warnings about issues in Python headers
  26. dnl # Strip -systemroot
  27. - dnl # Strip optimisation flags (-O[0-9]?). We decide our optimisation level, not python.
  28. + dnl # Strip optimisation flags (-O[0-9|fast]?). We decide our optimisation level, not python.
  29. dnl # -D_FORTIFY_SOURCE needs -O.
  30. dnl # Strip debug symbol flags (-g[0-9]?). We decide on debugging symbols, not python
  31. dnl # Strip -W*, we decide what warnings are important
  32. @@ -56,7 +56,7 @@ else
  33. mod_cflags=`echo " $python3_cflags" | sed -e '\
  34. s/ -I/ -isystem/g;\
  35. s/ -isysroot[[ =]]\{0,1\}[[^-]]*/ /g;\
  36. - s/ -O[[^[[:blank:]]]]*/ /g;\
  37. + s/ -O[[^[[:blank:]]*]]*/ /g;\
  38. s/ -Wp,-D_FORTIFY_SOURCE=[[[:digit:]]]/ /g;\
  39. s/ -g[[^ ]]*/ /g;\
  40. s/ -W[[^ ]]*/ /g;\
  41. --
  42. 2.43.0