Hi, The print-sysroot-suffix.sh script that can be used (via the t-sysroot-suffix makefile fragment) to auto-generate the SYSROOT_SUFFIX_SPEC macro for non-trivial multilib setups does not take into account the MULTILIB_REUSE target fragment variable. I'm not sure of a way to demonstrate how this causes problems with a vanilla tree, but consider the attached patch (arm-sysroot-mlib-arrangement-1.diff) intended to create a compiler with three multilibs: .; (little-endian, soft float) be;@mbig-endian (big-endian, soft float) vfp;@mfloat-abi=softfp (little-endian, hardware FP) Notice that we are not building a multilib for the be+vfp combination. Instead we use the MULTILIB_REUSE macro to make that combination fall back to using just the soft-float big-endian multilib: MULTILIB_REUSE = mbig-endian=mbig-endian/mfloat-abi.softfp But now, compiling code will fail with errors such as: $ arm-none-linux-gnueabi-gcc hello.c -mbig-endian -mfloat-abi=softfp \ -o hello ../arm-none-linux-gnueabi/bin/ld: /path/to/install/arm-none-linux-gnueabi/libc/usr/lib/libc.a(s_signbit.o): compiled for a little endian system and target is big endian Invoking the compiler with -print-sysroot vs. -print-multi-directory illustrates the problem: $ arm-none-linux-gnueabi-gcc hello.c -mbig-endian -mfloat-abi=softfp \ -print-sysroot /path/to/install/arm-none-linux-gnueabi/libc $ arm-none-linux-gnueabi-gcc hello.c -mbig-endian -mfloat-abi=softfp \ -print-multi-directory be What we wanted was for the first command to give the same result that invoking without -mfloat-abi=softfp does (which was the purpose of the MULTILIB_REUSE setting): $ arm-none-linux-gnueabi-gcc hello.c -mbig-endian -print-sysroot /path/to/install/arm-none-linux-gnueabi/libc/be but, that doesn't work at present. The attached patch fixes that: it's based on a part of CodeSourcery's earlier MULTILIB_ALIASES support (by Paul Brook originally, I think -- I don't think it ever made it upstream, but it worked quite similarly to MULTILIB_REUSE, that did), and allows the above multilib arrangement to work correctly. OK for mainline? (The ARM bits are for reference only and are not meant to be committed, of course.) Thanks, Julian ChangeLog gcc/ * config/print-sysroot-suffix.sh: Handle MULTILIB_REUSE settings. * config/t-sysroot-suffix (sysroot-suffix.h): Pass MULTILIB_REUSE to print-sysroot-suffix.sh script.