0

I know that in Solaris 10 Sun now Oracle don't provide static version of C library i.e libC.a but I check that same thing is not possible using Sun Studio either, I was under impression that C library are provided by Compiler just like Visual Studio provides C runtime libraries.

So is on Solaris C libray is provided by system only and there is no way to get static version of libC.a compatible on Solaris 10? Thanks

anonymous
  • 1,920
  • 2
  • 20
  • 30
  • Careful - `libC` is the C++ standard library, `libc` is the C standard library. Both come with the OS on Solaris, not with the Studio compilers. – alanc Sep 27 '13 at 06:15
  • Why do you want a *static* version of a system library, particularly libc? If you use a static library, then you are forever welded to that particular version and your maintenance costs jump. – James McPherson Feb 04 '14 at 03:38

1 Answers1

1

Not sure you can find one. This is "by design" - while the stdlib API are stable, the internals change between releases of the OS, so they force everyone to link dynamically to avoid breakages.

Using dynamic version in theory keeps your executables portable across different Solaris releases (but it is not guaranteed).

If you really want to have a completely self-contained executable, you probably should use GCC with its own stdlib.

Alexander L. Belikoff
  • 5,698
  • 1
  • 25
  • 31
  • gcc has not its own stdlib on Solaris. – jlliagre Sep 26 '13 at 20:43
  • Err... I actually meant glibc. – Alexander L. Belikoff Sep 26 '13 at 21:02
  • 1
    Which is what I infer you meant. There is no glibc port for Solaris. gcc on this platform uses the bundled libc which is only provided as a shared library for the reasons you state. Your third paragraph describes something that cannot be done, especially from Solaris 10 onward. – jlliagre Sep 26 '13 at 21:47
  • Perhaps was it GNU/kOpenSolaris ? There hasn't been any other glibc port attempts I'm aware of. (http://csclub.uwaterloo.ca/~dtbartle/opensolaris/) – jlliagre Sep 26 '13 at 22:03