Portions of http://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg26013.html are not upstreamed yet. So lets keep missing pieces. Upstream-Status: Pending Signed-off-by: Khem Raj Index: gcc-4.8.1/gcc/configure.ac =================================================================== --- gcc-4.8.1.orig/gcc/configure.ac 2013-07-15 15:55:49.488399132 -0700 +++ gcc-4.8.1/gcc/configure.ac 2013-07-15 16:02:31.772406679 -0700 @@ -148,7 +148,9 @@ if test "${with_sysroot+set}" = set; then gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'` if test "${gcc_gxx_without_sysroot}"; then - gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" + if test x${with_sysroot} != x/; then + gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" + fi gcc_gxx_include_dir_add_sysroot=1 fi fi Index: gcc-4.8.1/gcc/configure =================================================================== --- gcc-4.8.1.orig/gcc/configure 2013-07-15 15:55:49.472399132 -0700 +++ gcc-4.8.1/gcc/configure 2013-07-15 16:02:31.780406680 -0700 @@ -3325,7 +3325,9 @@ if test "${with_sysroot+set}" = set; then gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'` if test "${gcc_gxx_without_sysroot}"; then - gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" + if test x${with_sysroot} != x/; then + gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" + fi gcc_gxx_include_dir_add_sysroot=1 fi fi