Message ID | 20130619132033.GQ2336@tucnak.redhat.com |
---|---|
State | New |
Headers | show |
On Wed, Jun 19, 2013 at 03:20:33PM +0200, Jakub Jelinek wrote: > Hi! > > If say /usr/bin/gcc-ar doesn't find /usr/<target>/bin/ar (and a few others), > it gives up unless CROSS_DIRECTORY_STRUCTURE, while e.g. collect2 looks for > ld, nm etc. in $PATH. The collect2.c snippet is: Looks good. Thanks for fixing. -Andi
Am 19.06.2013 15:20, schrieb Jakub Jelinek: > Here is so far untested attempt to do that in gcc-{ar,nm,ranlib} too, ok if > bootstrap/regtest passes and testing shows it works (for 4.8 too, in 4.7 it > worked)? works for me, checked with a 4.8 native build and install. Matthias
--- gcc/gcc-ar.c.jj 2013-01-11 09:02:55.000000000 +0100 +++ gcc/gcc-ar.c 2013-06-19 15:09:08.314935157 +0200 @@ -147,21 +147,17 @@ main(int ac, char **av) exe_name = find_a_file (&target_path, PERSONALITY); if (!exe_name) { + const char *real_exe_name = PERSONALITY; #ifdef CROSS_DIRECTORY_STRUCTURE - const char *cross_exe_name; - - cross_exe_name = concat (target_machine, "-", PERSONALITY, NULL); - exe_name = find_a_file (&path, cross_exe_name); + real_exe_name = concat (target_machine, "-", PERSONALITY, NULL); +#endif + exe_name = find_a_file (&path, real_exe_name); if (!exe_name) { fprintf (stderr, "%s: Cannot find binary '%s'\n", av[0], - cross_exe_name); + real_exe_name); exit (1); } -#else - fprintf (stderr, "%s: Cannot find binary '%s'\n", av[0], PERSONALITY); - exit (1); -#endif } /* Create new command line with plugin */