how to install gcc-3-runtime on solaris 11

I want to install gcc-3-runtime on solaris 11. But, always fails.

$pkg install gcc-3-runtime
No updates necessary for this image.
Bvm 18Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David FavorLinux/LXD/WordPress/Hosting SavantCommented:
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.
Bvm 18Author 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.
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Installation

From novice to tech pro — start learning today.