kmod: disable --gc-sections ld option when building for xtensa

This is a workaround for the following ld issue exhibited by --gc-sections
option, until a proper fix for binutils is ready:

ld: BFD (GNU Binutils) 2.22 internal error, aborting at elf32-xtensa.c line 3374 in elf_xtensa_finish_dynamic_sections

Fixes:

  http://autobuild.buildroot.org/results/97d/97d4c96d6f6cdc1ed4007456f4ab70be9dfa41b5/

Suggested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
python: rework python symlinks installation

This change adds a patch to python disabling the installation of the
python and python-config symlinks.

This allows Buildroot to control these symlinks' installation:

* the python symlink should be unconditionally installed in the target
  tree, and the python-config symlink in the staging tree, since it is
  only built and installed in the target tree if the user selected it;

* the python and python-config symlinks should only be installed in
  the host tree when python(2) is the selection of the user for the
  target.
  Otherwise, when python3 is selected for the target, the host-python
  may be required to built some packages. In such cases, the python
  symlink should points to python3 (so should the python-config
  symlink) to reflect the staging/target tree.

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
python3: rework python symlinks installation

This patch reworks the way python3 and python3-config symlink are
installed.

Buildroot wants to control these symlinks' installation:

* the python3 symlink should be unconditionally installed in the target
  tree, and the python3-config symlink in the staging tree, since it is
  the only python package built and installed in the target tree if the
  user selected it;

* the python3 and python3-config symlinks should only be installed in
  the host tree when python3 is the selection of the user for the
  target.

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
pkg-python: support host-python dependency different from the python in the target

Some packages need a host-python interpreter with a version different
from the one installed in the target to run some build scripts (eg.
scons requires python2 to run, so build any kind of packages even if
the python interpreter selected for the target is python3).

In such cases, we need to add the right host-python dependency to the
package using the host-python-package infrastructure, and we also want
to invoke the right host python interpreter during the build steps.

This patch add a *_FORCE_HOST_PYTHON variable that can be set either
to 'python2' or 'python3'. This variable can be set by any package
using the host-python-package infrastructure can set to force the
python interpreter for the build. This variable also takes care of
setting the right host-python dependency.

This *_FORCE_HOST_PYTHON variable only affects packages using the
host-python-package infrastructure.

If some configure/build/install commands are overloaded in the *.mk
file, the right python interpreter should be explicitly called.

If the package define some tool variable (eg.: SCONS), the variable
should explicitly called the right python interpreter.

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
scons: force host-python dependency to be python2

Scons build-system needs python2 as interpreter (it does not support
python3 yet).

So, we need to force the host dependency to get the python2 interperter
built and available in the host tree to be able to build host-scons
itself and to build scons-based packages, whatever is the python
interpreter for the target.

This patch also makes sure scons will in be called using the right
python interpreter when invoked via $(SCONS).

Fixes:
  http://autobuild.buildroot.net/results/11e6c8c8d79d56ed43daf52e6d6dc80847709926/

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
python-m2crypto: requires host-python2

Acording to its homepage [1], m2crypto does not support python3 yet.

So, this patch forces building the host m2crypto module for pyhton2.

[1] https://pypi.python.org/pypi/M2Crypto

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
crda: override python interperter

During its build, crda calls a python script importing m2crypto module
which requires python2 interpreter.

So, we have a build dependency against host-python.

Also, we make sure this python script is interpreted using the right
python interpreter; we add a patch allowing to enforce this and
explicitly set it.

Fixes:
  http://autobuild.buildroot.net/results/a1e/a1e53d66d3962fd5431e7601937b071a0a3c2084/

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>