how to install gcc-3-runtime on solaris 11

Bvm 18
Bvm 18 used Ask the Experts™
on
I want to install gcc-3-runtime on solaris 11. But, always fails.

$pkg install gcc-3-runtime
No updates necessary for this image.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
David FavorFractional CTO
Distinguished Expert 2018

Commented:
gcc3... whew, so very old...

Current gcc-7.4 + gcc-8.3 are latest stable versions.

To install gcc3 runtime libraries, you'll likely have to build this yourself.

Big Tip: You must be super careful to avoid commingling any custom built gcc code with system level code. If you accidentally do a make install, without correctly pointing your output directory hierarchy to non-system directories, you will destroy your machine.

Logins will fail. Reboot will fail. A full obliteration install will be required to recover.

Be very careful.

If your gcc3 dependent code has no Solaris-isms (only calls C + C++ libraries), then likely best to spin up Linux + do all this sort of work inside an LXD container, so if you destroy the container, you'll have no effect on your machine level install.

Tip: If you have code dependent on gcc3, then there must not be any Solaris-isms in the code, because after you get gcc working, you'll then have to install any referenced Solaris libraries matching the API versions of the App code with the gcc3 dependency.

EOL (end of life) for gcc3 was in the 2004-2005 time frame, so there will be many shared object versioning changes over a 14+ year span.

So... building gcc3 will likely only be your first step.

Suggestion: Before you invest a massive amount of time building gcc3, explore your App code using ldd + make sure your App code makes no reference to any Solaris libraries. If any references are made, best make sure you can find copies of these libraries as your first step.

Author

Commented:
Thanks David Favor.

This is prerequisite for our product installation. Actually, C++ binaries use 4..8.x compiler. I already installed "pkg install gcc" which was installed gcc 7.x versions. What is right version of gcc runtime for this kind of installations. Tried to install gcc-4-runtime, failed.
Fractional CTO
Distinguished Expert 2018
Commented:
Consider these items for you to work out.

1) You can only install the version of gcc that matches all compiled code on your system.

2) This means if you do pkg install gcc + get gcc-7.x then that's the only version of gcc you can install using the package system.

3) To install any non gcc-7.x version, you'll have to build the alternative gcc from scratch.

4) You will never be able to install any other version of gcc using the normal package system, because if you did, then all the runtime libraries would overwrite the gcc-7 libraries + your machine would instantly die.

Refer back to my previous comments. You first must use ldd (or equivalent) to locate all your old Solaris libraries + then build gcc-3 or gcc-4 or whatever version, in some custom location. They you'll either relink your executable to directory paths where all this non-standard code lives or wrap your old code in a startup script which points $LD_LIBRARY_PATH to where your non-standard libraries live.

Summary: There is no simple way to do this. To get this working will take a large amount of effort.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial