buildrootschalter/toolchain
Yann E. MORIN 2c1dc32647 toolchain/external: fix wrapper by not passing conflicting flags
In our wrapper, we forcibly add the -march=, -mcpu= and-mtune= flags
to the actual compiler, this in an attempt to always generate correct
and optimised code for the target.

But in some cases, the caller knows better than we do, and passes its
own set, or subset of those flags. In this case, some may conflict with
the ones we pass. The most prominent offender being the Linux kernel.

For example, on the ARM Raspberry Pi, the Linux kernel will set the
-march=armv6 flag and no -mcpu= flag, but we pass -mcpu=arm1176jzf-s,
which conflicts:

    drivers/scsi/scsi_trace.c:1:0: warning: switch -mcpu=arm1176jzf-s
    conflicts with -march=armv6 switch

(and so for all the files the kernel compiles, pretty messy)
(note: arm1176jzf-s is not an armv6, it is an armv6zk. Yeah...)

To avoid this situation, we scan our commandline for any occurence of
the possibly conflicting flags. If none is found, then we add our owns.
If any is found, then we don't add any of our owns.

The idea behind this is that we trust the caller to know better than
we do what it is doing. Since the biggest, and sole so far, offender
is the Linux kernel, then this is a rather safe bet.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-01-09 21:17:35 +01:00
..
toolchain package: remove the empty trailing line(s) 2014-01-04 10:39:29 +01:00
toolchain-buildroot toolchain: enable microblaze toolchain 2013-12-06 22:46:44 +01:00
toolchain-external toolchain/external: fix wrapper by not passing conflicting flags 2014-01-09 21:17:35 +01:00
Config.in toolchain: enable microblaze toolchain 2013-12-06 22:46:44 +01:00
helpers.mk toolchain: Allow ld64.so linker 2013-12-03 13:11:27 +01:00
toolchain-common.in toolchain-crosstool-ng: remove support 2013-10-06 20:50:41 +02:00