Re: moving gcc from the installation path: is it allowed?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Feb 07, 2009 at 08:50:35PM -0500, Maurizio Vitale wrote:
> Michael Meissner <meissner@xxxxxxxxxxxxxxxxxx> writes:
> 
> > As long as you move the whole tree, and execute the compiler via a full
> > pathname, it should work (and are not running under VMS).  Here the code in
> > gcc.c that does this:
> >
> 
> Thanks a lot. Do you know if this is the relevant ChangeLog entry?
> 
>     2006-11-13  Carlos O'Donell  <carlos@xxxxxxxxxxxxxxxx>
>                 Mark Mitchell  <mark@xxxxxxxxxxxxxxxx>
> 
>             * gcc.c: Organize search path variables into $prefix relative,
>             and well-known native. Add comments.
>             (add_sysrooted_prefix): Add comment.
>             (process_command): If !gcc_exec_prefix add $prefix based paths.
>             If *cross_compile == '0', add native well-known paths.
>             Assert tooldir_base_prefix is always relative.
>             (main): If print_search_dirs, and if gcc_exec_prefix is set,
>             use this value for 'install:' path.
>             * Makefile.in: Add GCC_EXEC_PREFIX to generated site.exp.
> 
> I certainly remember a time when paths were hardcoded in gcc's binary
> and I need to figure out which versions of GCC can be safely moved
> around. In my industry people are still using unbelivably old versions
> of gcc. Don't ask. My industry is where people design processors and
> other chips so that people can run newer versions of gcc :-)

While that modified the search somewhat, I wrote the original relative path
support much earlier when I worked at Cygnus Solutions:

Mon Nov  8 14:16:57 1999  Michael Meissner  <meissner@xxxxxxxxxx>

	* invoke.texi (Environment Variables): Document relative path
	lookup.
	* gcc.c (DIR_UP): If not defined, define as "..".
	(standard_bindir_prefix): New static, holds target location to
	install binaries.
	(split_directories): New function to split a filename into
	component directories.
	(free_split_directories): New function, release memory allocated
	by split_directories.
	(make_relative_prefix): New function, make a relative pathname if
	the compiler is not in the expected location.
	(process_command): If GCC_EXEC_PREFIX was not specified, see if we
	can figure out an appropriate prefix from argv[0].
	* Makefile.in (DRIVER_DEFINES): Use unlibsubdir in definition of
	STANDARD_STARTFILE_PREFIX and TOOLDIR_BASE_PREFIX.  Define
	STANDARD_BINDIR_PREFIX.

and:

Fri Mar 27 16:04:49 1998  Michael Meissner  <meissner@xxxxxxxxxx>

	* gcc.c (set_std_prefix): Add declaration.
	(process_command): If GCC_EXEC_PREFIX is set, remove /lib/gcc-lib/
	suffix, and update the standard prefix prefix.c uses.

	* prefix.c (std_prefix): New global to hold default prefix value.
	(get_key_value): Change to use std_prefix instead of PREFIX.
	(translate_name): Likewise.
	(update_path): Likewise.
	(get_key_value): Release allocated scratch storage.
	(set_std_prefix): New function to reset the standard prefix.


-- 
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@xxxxxxxxxxxxxxxxxx

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux