From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18162 invoked by alias); 9 Feb 2005 16:59:34 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 18035 invoked by uid 48); 9 Feb 2005 16:59:31 -0000 Date: Wed, 09 Feb 2005 20:59:00 -0000 From: "bryanh at giraffe-data dot com" To: gcc-bugs@gcc.gnu.org Message-ID: <20050209165927.19856.bryanh@giraffe-data.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug driver/19856] New: GCC_EXEC_PREFIX used wrong X-Bugzilla-Reason: CC X-SW-Source: 2005-02/txt/msg00697.txt.bz2 List-Id: GCC_EXEC_PREFIX behavior doesn't match the manual or reason and several ways. The manual says GCC_EXEC_PREFIX is a prefix for the program name, which means 'gcc' should look for 'cc1' as GCC_EXEC_PREFIX/cc1. But Strace indicates that 'gcc' looks at GCC_EXEC_PREFIX/MACHINE/VERSION/../../../.. MACHINE/bin/MACHINE/VERSION/cc1. This is a rather strange path. The manual says gcc looks using GCC_EXEC_PREFIX first, and then the usual places. That would be normal. For me, it looks in a bunch of places unrelated to GCC_EXEC_PREFIX, then the path described above, then gives up. The "bunch of places" mentioned above starts with something that is apparently based on the path by which 'gcc' was invoked, but has too many .. in it: MY_GCC_INSTALL_DIRECTORY/lib/../../lbiexec/gcc/MACHINE/VERSION/cc1. On the other hand, if I don't set GCC_EXEC_PREFIX, it properly looks at MY_GCC_INSTALL_DIRECTORY/bin/../libexec/gcc/MACHINE/VERSION/cc1. The manual says GCC_EXEC_PREFIX is used for finding subprograms and linker files, but it is apparently also used for the specs file -- GCC_EXEC_PREFIX/MACHINE/VERSION/specs . The manual says the default for GCC_EXEC_PREFIX is PREFIX/lib/gcc . But it also says when GCC_EXEC_PREFIX is not set, gcc searches based on the pathname with which it was invoked. The latter matches what the program does for me. (For clarity, I have written the above as if gcc add a slash after GCC_EXEC_PREFIX; as documented, it doesn't). Note that in these experiments, I built gcc with PREFIX = nonexistent directory to ensure no built-in path gets used. Finally, if someone works on the manual section, I highly recommend moving the environment variable section out of the "Gcc Command Options" section. It doesn't fit there; I had a hard time finding it. -- Summary: GCC_EXEC_PREFIX used wrong Product: gcc Version: 3.4.3 Status: UNCONFIRMED Severity: normal Priority: P2 Component: driver AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: bryanh at giraffe-data dot com CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19856