This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, NLS] try to search relative dir
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Zhenqiang Chen <zhenqiang dot chen at linaro dot org>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 25 Jul 2014 17:52:33 +0000
- Subject: Re: [PATCH, NLS] try to search relative dir
- Authentication-results: sourceware.org; auth=none
- References: <CACgzC7DbSrSaLR7+PAqu+ADdoHvRZkQZBxdw8haEgTF-Rr2hmQ at mail dot gmail dot com>
On Mon, 7 Jul 2014, Zhenqiang Chen wrote:
> The patch tries to search relative dir "../share/locale" from gcc.
> Although it can not cover all cases, I think it can cover most cases.
That's not how to use make_relative_prefix. You want e.g.
make_relative_prefix (argv, standard_bindir_prefix, LOCALEDIR). And
it's wrong to search the configured directory first; only the relocated
directory should be used (see PR 17621, fixed in 2006).
Your patch only seems to address the "gcc" driver, not other programs that
may also use translated messages. The issue would appear to apply to all
programs using gcc_init_libintl. Now, programs such as cc1 aren't run
from bindir but from libexecsubdir, so you'll need to look at
GCC_EXEC_PREFIX there rather than using argv and the corresponding
configure-time bindir. Look at what incpath.c does to construct a
suitable argument to make_relative_prefix.
The relevant information for relocation will also need passing to cpplib
so that its call to bindtextdomain also gets a relocated path.
Joseph S. Myers