[OE-core] [PATCH 0/8] Fix BUILD_* family of variables

Jérémy Rosen jeremy.rosen at smile.fr
Tue Aug 23 07:25:21 UTC 2016


The BUILD_* family of variables allow the user to specify the name of the host
compiler to use at build time. This feature is particularly important for long
term maintainance. Future versions of gcc might not be compatible with old
yocto distributions and we can't assume that "gcc" is the correct name for the
compiler.

This problem is already an issue with Jethro which can't be compiled on a
machine wher gcc-6 is the default compiler. pkgconfig-native will refuse to
compile because it uses -Werror and gcc-6 has new warnings compared to gcc-5

This patch serie fixes multiple hard-coded references to gcc in various recipes
and build infrastructure

This patch was tested by building core-image-minimal for qemu-x86_64 with a
directory with the following content added to the PATH

 g++ -> /bin/false
 gcc -> /bin/false
 myg++ -> /usr/bin/g++
 mygcc -> /usr/bin/gcc

And the following variables added to local.conf

export BUILD_CC = "mygcc"
export BUILD_CXX = "myg++"
export BUILD_CPP = "mygcc -E"
export BUILD_CCLD = "mygcc"

---

All the patches haven't been pushed upstream yet, but I would be interested on
feedback on the actual work.

It would also be interesting to modify yocto's builders to use the BUILD_*
variable in order to have some early warning wrt gcc polution in recipes, but
seeing the various recipes I had to patch, I would expect such a change to
trigger a high number of build failures.

Jérémy Rosen (8):
  [autotools] export CCLD_FOR_BUILD
  [cross] export CC family from BUILD_* for cross compilers
  [rpm] force a configure before make distclean
  [linux-yocto] allow overriding compiler name in KConfig
  [linux-libc-headers] allow overriding compiler name in KConfig
  [busybox] allow overriding compiler name in KConfig
  [sanity] fix hardcoded references to gcc
  [glibc] remove hard-coded reference to gcc -E

 meta/classes/autotools.bbclass                                                                                            |  2 ++
 meta/classes/cross.bbclass                                                                                                | 12 ++++++++++++
 meta/classes/sanity.bbclass                                                                                               | 14 +++++++-------
 meta/recipes-core/busybox/busybox.inc                                                                                     |  5 +++++
 meta/recipes-core/busybox/busybox/0001-Allow-overriding-of-host-compiler-names.patch                                      | 27 +++++++++++++++++++++++++++
 meta/recipes-core/glibc/glibc/0001-locale-fix-hard-coded-reference-to-gcc-E.patch                                         | 23 +++++++++++++++++++++++
 meta/recipes-core/glibc/glibc_2.24.bb                                                                                     |  6 ++----
 meta/recipes-devtools/rpm/rpm_5.4.16.bb                                                                                   |  2 +-
 meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc                                                             |  7 ++++++-
 meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-Allow-overriding-host-compiler-name-from-environment.patch | 32 ++++++++++++++++++++++++++++++++
 meta/recipes-kernel/linux/linux-yocto.inc                                                                                 |  4 ++++
 meta/recipes-kernel/linux/linux-yocto/0001-Allow-overriding-host-compiler-name-from-environment.patch                     | 32 ++++++++++++++++++++++++++++++++
 12 files changed, 153 insertions(+), 13 deletions(-)
 create mode 100644 meta/recipes-core/busybox/busybox/0001-Allow-overriding-of-host-compiler-names.patch
 create mode 100644 meta/recipes-core/glibc/glibc/0001-locale-fix-hard-coded-reference-to-gcc-E.patch
 create mode 100644 meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-Allow-overriding-host-compiler-name-from-environment.patch
 create mode 100644 meta/recipes-kernel/linux/linux-yocto/0001-Allow-overriding-host-compiler-name-from-environment.patch

-- 
git-series 0.8.9


More information about the Openembedded-core mailing list