Project

General

Profile

Bug #9684

Transform GCC_ROOT->GNUC_ROOT

Added by Robert Mustacchi over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Category:
tools - gate/build tools
Start date:
2018-07-28
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

Today, we use the environment variable GCC_ROOT to indicate where to find the root of a GCC installation. While testing on support for multiple shadows, I discovered that the GCC_ROOT environment variable causes gcc to change the compiler search path that it uses to find where it executes from. For example, take a look at the following:

$ /home/rm/src/gcc7/proto.strap/usr/gcc/7/bin/gcc -c tmp.c
$ export GCC_ROOT=/home/rm/src/gcc7/proto.strap/usr/gcc/4
$ /home/rm/src/gcc7/proto.strap/usr/gcc/7/bin/gcc -c tmp.c
gcc: error trying to exec 'cc1': execvp: No such file or directory

When I look at the specs, the major thing that changes is the internal
search path in the presence. Here's the search path without GCC_ROOT set:

COMPILER_PATH=/home/rm/src/gcc7/proto.strap/usr/gcc/7/bin/../libexec/gcc/i386-pc-solaris2.11/7.3.0/:/home/rm/src/gcc7/proto.strap/usr/gcc/7/bin/../libexec/gcc/:/usr/ccs/bin/

But with it set:

COMPILER_PATH=/home/rm/src/gcc7/proto.strap/usr/gcc/4/libexec/gcc/:/usr/ccs/bin/

Based on this, and that the gcc source code admits that it uses GCC_ROOT as a special value, we probably shouldn't use it in our Makefiles.

History

#1

Updated by Robert Mustacchi over 1 year ago

It was suggested by Rich that we could maybe use GNUC_ROOT instead.

#2

Updated by Electric Monk over 1 year ago

  • Status changed from New to Closed
  • % Done changed from 20 to 100

git commit 7ed546340881b42865171ddfa1a6167b289faae3

commit  7ed546340881b42865171ddfa1a6167b289faae3
Author: Robert Mustacchi <rm@joyent.com>
Date:   2018-08-27T15:12:59.000Z

    9684 Transform GCC_ROOT->GNUC_ROOT
    Reviewed by: Toomas Some <tsoome@me.com>
    Reviewed by: Yuri Pankov <yuripv@yuripv.net>
    Reviewed by: John Levon <john.levon@joyent.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF