I'm using buildroot to create packages that are binary compatible with the default rootfs provides in my Patriot Corza NAS. As such, I'm unable to upgrade to a newer toolchain that supports --sysroot. The attached patch updates package/Makefile.in, ext-tool.mk and various package .mks to allow buildroot to be built with an external toolchain that does not use --sysroot (gcc-3.4.6, in my case). The use of --sysroot is now controlled by the BR2_TOOLCHAIN_EXTERNAL_SYSROOT option. Most of the other changes just involve passing TARGET_CONFIGURE_ENV to the configure or make calls for each package. There's also a change to override the broken getline detection in sed when using an external glibc toolchain.
Created attachment 1291 [details] v1.0
Thanks for this patch. In the past, we tried to handle toolchains not supporting --sysroot, but that proved to be very difficult with packages such as the Gtk stack or Qt. See for example the thread at http://lists.busybox.net/pipermail/buildroot/2008-November/023870.html or http://lists.busybox.net/pipermail/buildroot/2008-December/024147.html. Does your patch works when compiling Qt, for example ?
I have not systematically tested every package in the tree. I only tested the ones needed for the Corza packages. However, I just tried Qt and it built fine.
This is more an enhancement request than a real bug.
Two years later, sysroot capable toolchains are much more common, and we definitely don't want to add the complexity to add non-sysrooted toolchains into Buildroot.