This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, NLS] try to search relative dir


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[0], 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[0] 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
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]