Wind River Support Network


LIN5-21251 : include location "/usr/include/python2.7" is unsafe for cross-compilation [-Wpoison-system-directories]

Created: Mar 8, 2016    Updated: Oct 19, 2018
Resolved Date: Mar 10, 2016
Found In Version:
Fix Version:
Severity: Standard
Applicable for: Wind River Linux 5
Component/s: Build & Config


The libxml2-nativesdk recipe fails at the do_compile phase if the libpython2.7-dev is installed on the host
Ubuntu machine.

See the attached log file for details. The failure is related to the presence of the libpython2.7 headers
in /usr/include/python2.7 and elsewhere in /usr/include:
cc1: warning: include location "/usr/include/python2.7" is unsafe for cross-compilation [-Wpoison-system-directories]
In file included from /usr/include/python2.7/Python.h:8:0,
from ./libxml_wrap.h:1,
from ./types.c:9:
/usr/include/python2.7/pyconfig.h:3:51: fatal error: x86_64-linux-gnu/python2.7/pyconfig.h: No such file or directory
compilation terminated.

Also attached is a simple script to demonstrate the failure ( NOTE: The script uses several
directories in your $HOME directory: prj, SSTATE_CACHE, GCC_CACHE. The compile phase of libxml2-nativesdk will
fail if libpython2.7-dev is installed and succeed if it is not installed.

Steps to Reproduce

Set your $WORK to your workspace, set ${WRL_INSTALL} to your product installation directory and then run the following script:
mkdir ${WORK}/prj
cd ${WORK}/prj

${WRL_INSTALL}/wrlinux-5/wrlinux/configure \
--enable-parallel-pkgbuilds=10 \
--enable-jobs=10 \
--enable-board=intel-atom \
--enable-build=production \
--enable-ccache=yes \
--with-ccache-dir=${WORK}/GCC_CACHE \
--with-sstate-dir=${WORK}/SSTATE \
--enable-kernel=preempt-rt \
--enable-rootfs=glibc-core \
--enable-buildhist=yes \
--enable-reconfig \
cd build
make libxml2-nativesdk.compile
If you run this build script on a host without libpython2.7-dev installed, then no failure would be seen (as expected).
However if you install the host package in question
$ sudo apt-get install python2.7-dev
and then try to re-run the script, then it would fail at the configure stage:

Summary: 1 task failed:
virtual:nativesdk:Lx5/prj/layers/oe-core/meta/recipes-core/libxml/, do_configure 

Other Downloads

Live chat