3 Replies Latest reply: Nov 2, 2012 6:25 PM by BrianVandenberg RSS

    Compiler driver (cc/CC) attempting to execute ccfe from wrong location

    BrianVandenberg
      This is in a Solaris environment running Sun Studio 12.2. IT was doing some work on the network mounts, after which we began experiencing this problem. We tried replacing the existing SS installation with a clean copy, but the problem wasn't resolved.

      Here's a list of symptoms and related info:

      * Ran cc/CC: no error message; silently generates a return code of '2'.
      * Ran again with -v parameter: it's attempting to run ${SUNSTUDIO_DIR}/ bin /ccfe instead of ${SUNSTUDIO_DIR}/ prod/bin /ccfe

      I've engineered the build so LD_LIBRARY_PATH is empty, and PATH only has +/usr/bin+ in it. Furthermore, the user's environment is almost entirely stripped of environment variables before the build executes, so there couldn't possibly be anything in the environment interfering with the build.

      Having said that, I will clarify a point: everything was working fine until IT started mucking with network mounts. After they were done, our SS installation was missing so they either re-installed or pulled a copy from the old mount locations.

      What controls the paths cc/CC will use to execute tools like ccfe ?

      -Brian
        • 1. Re: Compiler driver (cc/CC) attempting to execute ccfe from wrong location
          BrianVandenberg
          We've found a solution.

          +/etc/defaults+ was either missing the following variable definitions, or they were set to inappropriate values; I don't know what it was set to when it was failing, but currently these variables & values are set as defaults and the compiler works fine now:

          LANG=C
          LC_CTYPE=C
          LC_COLLATE=C
          LC_TIME=C
          LC_NUMERIC=C
          LC_MONETARY=C
          LC_MESSAGES=C

          After changing +/etc/defaults+, the server was rebooted and everything is working again. It's possible just rebooting the server fixed it, but I guess we'll never know.

          -Brian
          • 2. Re: Compiler driver (cc/CC) attempting to execute ccfe from wrong location
            Steve.Clamage-Oracle
            The driver determines its own location, then finds other components relative to that location. In particular, the real cc and CC programs are in prod/bin, with symbolic links to them in the top-level bin directory that is normally on your path. I suspect that when the installation was restored, it was not done in a way that preserved the exact directory structure that the drivers depend on. Or possibly there are network mount points within the Studio installation directory, which would cause problems. The top-level installation directory, the one that looks like this:
            % ls
            LEGAL         contrib       lib           prod
            READMEs       examples      man           uninstall.sh
            bin           include       netbeans
            should not have any internal mount points.

            The best solution is to remove the existing installation entirely and re-install. If the original installation was done via packages, use the uninstaller to remove the packages before reinstalling.
            • 3. Re: Compiler driver (cc/CC) attempting to execute ccfe from wrong location
              BrianVandenberg
              The person that did the installation said "I just took the tar file we downloaded and un-tarred it. I didn't do anything beyond that." He also did not run the install script.

              -Brian