toolchain: fix using external toolchains built with buildroot
The toolchains built with buildroot use specially crafted paths for their
sysroot and prefix. Fix that by asking gcc where it finds a file we
know by relative path to the sysroot.
This has the side effect of greatly simplifying the sysroot detection
in every cases tested so far (BR toolchains, CT-NG toolchains, and
CodeSourcery toolchains).
Fixes bug #851.
Thanks Thomas Petazzoni for the hint and some testings.
Thanks Grant Edwards for the report and the comments.
Signed-off-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>