018-fix-add-gcc-paths-logic.patch 1.1 KB

123456789101112131415161718192021222324252627
  1. Override system locale and set to default when adding gcc paths
  2. Forces the use of the default locale in the function
  3. add_gcc_paths, which is called when cross compiling to add the
  4. include and library paths. This is necessary because otherwise
  5. the gcc output is localized and the output parsing fails, which
  6. results in no paths added and detect_modules not able to find
  7. any system library (eg. libz, libssl, etc.)
  8. [Thomas: patch taken from https://bugs.python.org/issue23767.]
  9. Signed-off-by: Samuel Cabrero <samuelcabrero@gmail.com>
  10. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  11. Index: b/setup.py
  12. ===================================================================
  13. --- a/setup.py
  14. +++ b/setup.py
  15. @@ -414,7 +414,7 @@
  16. tmpfile = os.path.join(self.build_temp, 'gccpaths')
  17. if not os.path.exists(self.build_temp):
  18. os.makedirs(self.build_temp)
  19. - ret = os.system('%s -E -v - </dev/null 2>%s 1>/dev/null' % (gcc, tmpfile))
  20. + ret = os.system('LC_ALL=C %s -E -v - </dev/null 2>%s 1>/dev/null' % (gcc, tmpfile))
  21. is_gcc = False
  22. in_incdirs = False
  23. inc_dirs = []