2
1

001-remove-host-header-path.patch 1.8 KB

123456789101112131415161718192021222324252627282930313233343536
  1. setup.py: do not add invalid header locations
  2. This piece of code incorrectly adds /usr/include to
  3. self.compiler.include_dirs, and results in the following invalid
  4. compilation line:
  5. /home/thomas/projets/buildroot/output/host/usr/bin/arm-none-linux-gnueabi-gcc
  6. -fPIC -Wno-unused-result -Werror=declaration-after-statement -DNDEBUG -g
  7. -O3 -Wall -Wstrict-prototypes -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
  8. -D_FILE_OFFSET_BITS=64 -pipe -Os
  9. -I./Include -I/usr/include -I. -IInclude
  10. -I/home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/include
  11. -I/home/thomas/projets/buildroot/output/build/python3-3.4.0b1/Include
  12. -I/home/thomas/projets/buildroot/output/build/python3-3.4.0b1
  13. -c /home/thomas/projets/buildroot/output/build/python3-3.4.0b1/Modules/_struct.c
  14. -o build/temp.linux-arm-3.4/home/thomas/projets/buildroot/output/build/python3-3.4.0b1/Modules/_struct.o
  15. cc1: warning: include location "/usr/include" is unsafe for cross-compilation [-Wpoison-system-directories]
  16. The -I/usr/include is wrong when cross compiling, so we disable adding
  17. INCLUDEDIR and LIBDIR from the host when cross compiling.
  18. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  19. Index: b/setup.py
  20. ===================================================================
  21. --- a/setup.py
  22. +++ b/setup.py
  23. @@ -493,7 +493,8 @@
  24. add_dir_to_list(dir_list, directory)
  25. if os.path.normpath(sys.base_prefix) != '/usr' \
  26. - and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
  27. + and not sysconfig.get_config_var('PYTHONFRAMEWORK') \
  28. + and not cross_compiling:
  29. # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
  30. # (PYTHONFRAMEWORK is set) to avoid # linking problems when
  31. # building a framework with different architectures than