Here is what I did: $ export GCC_EXEC_PREFIX=/my_prefix/lib/gcc/ $ gcc --print-search-dirs install: /opt/gnu/gnat/lib/gcc/sparc-sun-solaris2.8/3.4.4/
programs: = /libexec/gcc/sparc-sun-solaris2.8/3.4.4/: /libexec/gcc/: /opt/gnu/gnat/libexec/gcc/sparc-sun-solaris2.8/3.4.4/ libraries: = /my_prefix/lib/gcc/sparc-sun-solaris2.8/3.4.4/: /my_prefix/lib/gcc/: /opt/gnu/gnat/lib/gcc/sparc-sun-solaris2.8/3.4.4/ here I would expect gcc to search first in /my_prefix/libexec/gcc/... for programs looking at gcc.c it looks like the problem is coming from the following line: gcc_libexec_prefix = make_relative_prefix (gcc_exec_prefix, standard_exec_prefix, standard_libexec_prefix); The problem is that make_relative_prefix is expecting a program name as first argument. But the gcc_exec_prefix is a directory. So that's why /my_prefix/ is removed when computing gcc_libexec_prefix... Besides this I think that since 3.4.x series GCC_EXEC_PREFIX is quite useless indeed it is quite hard to redefine the location where cc1 is found (gcc will always append something like ../../libexec/gcc). I think it would be better to define another variable called GCC_LIB_PREFIX. GCC_EXEC_PREFIX will have <gcc_location>/../libexec/gcc as default value and GCC_LIB_PREFIX will have <gcc_location>/../lib/gcc as default value. -- Summary: GCC_EXEC_PREFIX mechanism is broken Product: gcc Version: 3.4.4 Status: UNCONFIRMED Severity: normal Priority: P2 Component: driver AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: roche at adacore dot com CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: *-*-* GCC host triplet: *-*-* GCC target triplet: *-*-* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21553