The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[SOLVED] gcc: installation problem, cannot exec `cc1'

Discussion in 'cPanel Developers' started by JamieW, Jan 26, 2009.

  1. JamieW

    JamieW Member

    Joined:
    May 15, 2006
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Here's something that took me a while to track down, and want to share the solution since I didn't find it anywhere else. I was getting the following error:

    gcc: installation problem, cannot exec `cc1': No such file or directory

    This was happening trying to do a 'make' on a program for an account that was given permissions in the Compiler Tweaks, but still wouldn't work.

    I found a lot of matches on the error on google, and a couple here, but none I checked had the solution.

    Turns out the /usr/lib/gcc-lib/i386-redhat-linux had the 'compiler' group, but gave r/x permissions only to the owner. So I did:

    chmod g+rx /usr/lib/gcc-lib/i386-redhat-linux

    and then everything worked perfectly. So simple, once found.

    To track down the exact folder for you, if different, you'll probably want to use the 'locate' command to find where 'cc1' is on your system, and then use:

    gcc -print-search-dirs

    to verify gcc is looking there (or if you have it in multiple places, to find which is the correct one).

    Then check each part of the path to make sure it either has r/x permissions for everyone, or is in the 'compiler' group and has r/x for the group. If you have to add any permissions, only do it at the group level (not everyone) for security reasons.

    I hope that helps someone else down the road.
     
  2. JamieW

    JamieW Member

    Joined:
    May 15, 2006
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Well, sorta solved. The next day it stopped working again. Looks like the system removed the extra permissions I added to the /usr/lib/gcc-lib/i386-redhat-linux directory. So now it looks like:

    drwx------ 3 root compiler 1024 Feb 25 2003 ./

    Meaning only root would ever be able to use the compiler. How do I permanently fix this?

    I do have the Compilers Tweak set to disable it for unprivileged users, but I also have it set to allow specific users. Is there something I'm missing, or should this be reported as a bug?
     
  3. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Which OS/Linux Distro are you using?
     
  4. milavia

    milavia Registered

    Joined:
    Jul 3, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    I'm not the OP. But I ran into the same thing. Not with the gcc that came with the distro [Centos 5.5], but after having custom installed an older gcc. Probably should have configured the install with more attention, as it didn't install in the dir where the other gcc versions were installed, but in gcc-lib, just as with the OP.

    cpup runs the compilers script, which defines gcc-lib as protected dir, and then goes on to chmod its subdirs to 700.

    I'm only a novice, but I guess solution is to reinstall gcc in another directory? As gcc-lib is probably not intended to contain the actual compiler? Or is the script based on some config file that should have been changed?
     
  5. JamieW

    JamieW Member

    Joined:
    May 15, 2006
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Oh sorry I missed the reply until I saw this new one! I am using:

    cPanel 11.25.0-R46156 - WHM 11.25.0 - X 3.9
    REDHAT 9 i686 virtuozzo

    I'm still having this problem too. I'd just been tweaking it as root everytime I need to use it for another acct.

    'groups' does show the non-root acct is a part of the "compiler" group. But because the
    /usr/lib/gcc-lib/i386-redhat-linux/
    directory has "drwx------ 3 root compiler" permissions, it still doesn't allow the needed access. Simply doing

    chmod g+x /usr/lib/gcc-lib/i386-redhat-linux

    fixes the problem, until the system clears the added flag again. And this is how everything came installed on my cpannel acct.

    Maybe I should set up a crontab to do the chmod every 5 minutes. :)
     
  6. Александръ

    Joined:
    Mar 28, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Has this ever been fixed? Having the same problem... though I was able to work around it by removing -V 2.8.1 from the compiler flags...
     

Share This Page