0001-setup.py-do-not-add-invalid-header-locations.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From 3dc31a435b67de2ba3dd3457f0c939e20b58e8de Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Tue, 7 Mar 2017 22:17:06 +0100
  4. Subject: [PATCH] setup.py: do not add invalid header locations
  5. This piece of code incorrectly adds /usr/include to
  6. self.compiler.include_dirs, and results in the following invalid
  7. compilation line:
  8. /home/thomas/projets/buildroot/output/host/usr/bin/arm-none-linux-gnueabi-gcc -fPIC \
  9. -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 \
  10. -pipe -Os -DNDEBUG -g -O3 -Wall -Wstrict-prototypes \
  11. -I/usr/include -I. -IInclude -I./Include \
  12. -I/home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/include \
  13. -I/home/thomas/projets/buildroot/output/build/python-2.7.6/Include \
  14. -I/home/thomas/projets/buildroot/output/build/python-2.7.6 \
  15. -c /home/thomas/projets/buildroot/output/build/python-2.7.6/Modules/mathmodule.c \
  16. -o build/temp.linux2-arm-2.7/home/thomas/projets/buildroot/output/build/python-2.7.6/Modules/mathmodule.o
  17. cc1: warning: include location "/usr/include" is unsafe for cross-compilation [-Wpoison-system-directories]
  18. [...]
  19. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  20. ---
  21. setup.py | 2 +-
  22. 1 file changed, 1 insertion(+), 1 deletion(-)
  23. diff --git a/setup.py b/setup.py
  24. index 54054c2..64001e2 100644
  25. --- a/setup.py
  26. +++ b/setup.py
  27. @@ -496,7 +496,7 @@ class PyBuildExt(build_ext):
  28. for directory in reversed(options.dirs):
  29. add_dir_to_list(dir_list, directory)
  30. - if os.path.normpath(sys.prefix) != '/usr' \
  31. + if False and os.path.normpath(sys.prefix) != '/usr' \
  32. and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
  33. # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
  34. # (PYTHONFRAMEWORK is set) to avoid # linking problems when
  35. --
  36. 2.7.4