GCC missing from Solaris 11, and server already deployed (no access to internet)

gccpackage-managementsolaris

I'm having a peculiar problem, where a server has already been deployed, and it's no longer connected to the network.
For it's original purpose, it didn't need any C/C++ compiling tools, and thus they were never installed.

I have checked /usr/sfw/bin, but indeed they are missing from there..

I'm not really familiar with Solaris environment, but I can't seem to find GCC as "installable package" (similar as for example dpkg for debian) for Solaris 11. There seems to be stuff for older Solaris environments though. Is there some way to post-install these tools without using the internet connection and package manager? Is there, for example, a DVD image somewhere that I could use as a source for package manager?

I would like to run a program that I wrote in C++, but I can't compile the code on the my machine as I'm running 64-bit x86 Linux machine.

I have access to older Solaris 8 machine, that is setup OK, and I that I used to create a static binary (used gcc 3.8). The program runs, but there is some strange behavior with string formatting, and it doesn't execute as expected – this behavior is not seen on the Solaris 8 host.

I can copy the libraries from the machine, for example to create a cross compiling environment, but I'm not sure if it's that easy. From dynamically linked file, I see for example that I link against libstdc++, but that's missing from the target machine.

So I wonder if I can create proper cross compiling environment?

Best Answer

/usr/sfw/bin is the bundled gcc path with Solaris 10. On Solaris 11.1, gcc is, when installed, directly available in /usr/bin as a symlink that points to /usr/gcc/<version>/bin/gcc.

There is now an on disk data format for ips packages (.p5p files) but I would suggest to download the whole repository (look for Oracle Solaris 11.1 repository image in the Solaris 11.1 download page) and create your own ips service. See this blog for details. That would allow to install whatever package gcc is dependent on and possibly other packages you might be still missing for your task.

Related Topic