On 31 January 2011 01:20, Gerald Pfeifer <ger...@pfeifer.com> wrote: > On Fri, 28 Jan 2011, Ian Lance Taylor wrote: >> Some archealogy turned up this as the reason canonicalization was >> inserted: >> >> http://gcc.gnu.org/ml/gcc/2003-02/msg01121.html >> http://gcc.gnu.org/ml/gcc-patches/2003-02/msg01697.html >> >> Also relevant here is http://gcc.gnu.org/PR29931 . > > I am quite sure that the current behavior where one can have a symlink > point to an installation of GCC anywhere else (outside of any path even) > has been in place for quite a bit longer than 2003.
Thanks for the notes and archaeology. My guess is that because it's easier, symlinking a single gcc binary is more common than symlinking a complete gcc tree. > On Sat, 29 Jan 2011, Dave Korn wrote: >> I think the case which is particularly common is the alternatives >> system, which has a chain of symlinks finally pointing to a real gcc. >> (That works just fine with the current default, AFAIK, although that >> may be only because the real gcc is in $PATH?) > > Nope, only the symlink(s) need to be in the path. And indeed this > usecase that you and also Joseph describe is how I've been using it > for many years. > > Given that this has een default behavior for so long (more than a > decade from what I can tell), I'd recommend not changing it. That would be as good a reason as any for not changing it. Thanks for the clarification. The patch in http://gcc.gnu.org/PR29931 uses... heuristics to detect if the gcc driver is a single symlink or part of a symlink farm (Florian Weimer's suggestion above). The patch has never been fully accepted, though; any known reason? I believe it will handle the two main use cases reliably. Combining it with -[no-]canonical-prefixes flags as overrides would cover all cases unambiguously. If heuristics aren't deemed reliable enough, another option is to set a default with a -no-canonical-prefixes-default configure flag. Less flexible because it's baked in to gcc, but simpler. On balance the PR29931 patch approach with -[no-]canonical-prefixes overrides seems to me like it will lead to least trouble in future. It also closes a long-standing gcc PR. Any dissent? Other options? Thanks. -- Google UK Limited | Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W 9TQ | Registered in England Number: 3977902