gcc: poison default sysroot path

Various pieces of the code assume that the --sysroot option gets passed
into the compiler tools. By having a "sane" default, we don't always
spot when this occurs and this can later show up as breakage in sstate,
or in usage of the external toolchain.

We've long since talked about poisoning the default such that it will
break unless the correct option is specified. This patch does just that.

If this patch causes something to fail to build, it most likely means
the various compiler flags and commands are not correctly being passed
through to the underlying piece of software and that there is a real
problem that needs fixing, its not the fault of this patch.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
rm_work: Speed up rootfs/populate_sdk removal

Commands like bitbake X -c rootfs or bitbake X -c populate_sdk do not
trigger rm_work to clean up the directories afterwards since it
traditionally hooks onto do_build. This change means those two tasks now
clean up after themselves. We use the cleandirs function attribute to
handle this.

[YOCTO #6413]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
glibc: Delete ldconfig when USE_LDCONFIG is not set

This avoids below QA error/warning
/sbin/ldconfig [installed-vs-shipped]

Change-Id: I028b692eefeaa6e0e0e6507ab4108caa29e41e91
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
mklibs: Fix loader for mipsel

Additionally treat ld.so to be searched in sysroot

Change-Id: I8b4acb821d9855a1163c7149bc8e369c7c438856
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
multilib.conf: set MULTILIB_GLOBAL_VARIANTS conditionally

It is not entirely obvious that all reasonable configurations
will have multilib.conf strictly before the file which might
want to set MULTILIB_GLOBAL_VARIANTS. The x86-ish values here
look like reasonable default guesses, but shouldn't override
an explicit setting.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
image.py: Fix error in graph sorting

The graph sorting algorithm for image dependencies does a look for an
occurrence of a searched string instead of comparing the chunk to the
searched string. This leads to the problem that ubifs is recognized as ubi aswell.

This fixes this by splitting up the string into chunks.

Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
wic: Don't allow mkfs to fail silently in partition command

The return code from the mkfs command used by the partition creation
command was being ignored, allowing it to silently fail and leaving
users mystified as to why the resulting filesystem was corrupted.

This became obvious when failures occurred when creating large
e.g. sdk filesystems [YOCTO #6863].

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
wic: Use overhead factor when creating partitions from rootfs directories

When creating partitions sized to given rootfs directories, filesystem
creation could fail in cases where the calculated target partition
size was too small to contain the filesystem created using mkfs.  This
occurred in particular when creating partitions to contain very large
filesystems such as those containing sdk image artifacts.

This same limition is present in the oe-core image creation classes,
which can be readily see by changing IMAGE_OVERHEAD_FACTOR from the
default 1.3 to 1.0 and building a sato-sdk image.

It should be possible to calculate required sizes exactly given the
source rootfs and target filesystem types, but for now, to address the
specific problem users are hitting in such situations, we'll just do
exactly what oe-core does and define and use an IMAGE_OVERHEAD_FACTOR
or 1.3 in those cases.

Fixes [YOCTO #6863].

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
wic: Update the help text to include -D (--debug)

The --debug option is missing from the wic help text; this adds it and
at the same time rearranges the usage into a more logical arrangement.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Revert "wic: set bootimg_dir when using image-name artifacts"

This reverts commit 7ce1dc13f91df70e8a2f420e7c3eba51cbc4bd48.

This patch broke the assumption that a non-null boot_dir means a
user-assigned (-b command-line param) value.

Reverting doesn't break anything, since the case it was added for
doesn't use the boot_dir for anything except debugging anyhow.

Fixes [YOCTO #6290]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
wic: Remove special-case bootimg_dir

The first iterations of wic very shortsightedly catered to two
specific use-cases and added special-purpose params for those cases so
that they could be directly given their corresponding boot artifacts.
(hdddir and staging_data_dir).

As more use-cases are added, it becomes rather obvious that such a
scheme doens't scale, and additionally causes confusion for plugin
writers.

This removes those special cases and states explicitly in the help
text that plugins are responsible for locating their own boot
artifacts.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
wic: Update bootimg-partition to use bootimg_dir

Update bootimg-partition to use bootimg_dir instead of img_deploy_dir,
to match similar usage in other plugins.

As mentioned elsewhere, plugins should use the passed-in value for
bootimg_dir directly if non-null, which corresponds to a user-assigned
value specified via a -b command-line param, and only fetch the value
from bitbake if that value is null.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
autotools: Use make clean for builds not supporting B != S

If the build doesn't support B != S, we can try running "make clean" instead
to try and clean up previous objects if the hash for the task has changed.

This tries to ensure that when variables like ${baselib} change, the changes are
correctly accounted for.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
base.bbclass: Enable using 'make clean' for rebuilds

When something rebuilds say due to ${baselib} changing or some
other key variable, software is often not rebuilt due to the
fact that make detects no dependency change.

By running "make clean" when these changes occur, we can at least try
and ensure the correct rebuilds happen. We use the same checksum check as
autotools to decide if things have changed or not.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
cmake: Try and improve cleaning of builds when B==S

Currently if B==S for a cmake recipe, the build will not reconfigure. This patch adds
code to remove the generated cmake files, meaning cmake will then be forced to regenerate
them. This forces cmake to see configuration changes it may not otherwise see.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
wpa_supplicant: Improve rebuild handling

Due to the split level nature of the wpa_suppliant sources, the standard
clean methods don't work. This change ensures it picks up on changes to
configuration.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
gnu-config: Deal with "make clean" breakage

gnu-config can't cope with a "make clean" so disable that
newly enabled functionality.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hicolor-icon-theme: Deal with "make clean" breakage

hicolor-icon-theme can't cope with a "make clean" so disable that
newly enabled functionality.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
which-2.18: Use foreign strictness to avoid automake errors

Fixed:
Makefile.am: error: required file './ChangeLog' not found

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
elfutils: fix elf_cvt_gnuhash

The 'dest' and 'src' can be same, we need to save the value of src32[2]
before swaping it.

Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>