From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16454 invoked by alias); 2 May 2012 19:40:13 -0000 Received: (qmail 16352 invoked by uid 22791); 2 May 2012 19:40:11 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 May 2012 19:39:58 +0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug plugins/53126] gcc-4.7.0 error "gcc-ar: Cannot find plugin" Date: Wed, 02 May 2012 19:40:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: plugins X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-05/txt/msg00167.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53126 --- Comment #3 from Jakub Jelinek 2012-05-02 19:39:11 UTC --- Created attachment 27290 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27290 gcc48-pr53126.patch Ugh, what gcc-ar does isn't even remotely matching to what gcc does. If GCC_EXEC_PREFIX isn't in the environment, then it will gcc_libexec_prefix = get_relative_prefix (decoded_options[0].arg, standard_bindir_prefix, standard_libexec_prefix); and when it is there, it will: /* make_relative_prefix requires a program name, but GCC_EXEC_PREFIX is typically a directory name with a trailing / (which is ignored by make_relative_prefix), so append a program name. */ char *tmp_prefix = concat (gcc_exec_prefix, "gcc", NULL); gcc_libexec_prefix = get_relative_prefix (tmp_prefix, standard_exec_prefix, standard_libexec_prefix); /* The path is unrelocated, so fallback to the original setting. */ if (!gcc_libexec_prefix) gcc_libexec_prefix = standard_libexec_prefix; Even if GCC_EXEC_PREFIX isn't in the environment, and gcc_libexec_prefix is NULL after this, we end up doing /* If we don't know where the toolchain has been installed, use the configured-in locations. */ if (!gcc_exec_prefix) { #ifndef OS2 add_prefix (&exec_prefixes, standard_libexec_prefix, "GCC", PREFIX_PRIORITY_LAST, 1, 0); add_prefix (&exec_prefixes, standard_libexec_prefix, "BINUTILS", PREFIX_PRIORITY_LAST, 2, 0); ... so I'd say what this patch does brings it at least a little bit closer to what gcc driver does. Having make_relative_prefix return NULL is actually the common case where the compiler is installed where it has been configured.