title: Solaris 32 bit - build shared object using gcc
body: <p>I am trying to crate a shared object (.so) using gcc version 3.4.3 for Solaris 32 bit system. I was googling for flags required to create a shared object for solaris. In some of the posts , I see that "-shared" flag  not used. Instead "-G" flag is used. I had an impression that "-G" flag is same as "-g", but it seems that "-G" is equivalent to "-shared". Am I correct?</p>
  
  <p>The reason being that with SLES10 x86_64 systems, "-shared" flag was required to build .so. </p>
  
  <p>I tried following:-</p>
  
  <pre><code>LIB=-L/lib -L/usr/local/lib -L/usr/lib
  gcc -m32 -G -fPIC -o myapi.so.1 myapi.o $(LIB)
  </code></pre>
  
  <p>Do I need to change above to:-</p>
  
  <pre><code>gcc -m32 -shared -fPIC -o myapi.so.1 myapi.o $(LIB)
  </code></pre>
  
  <p><strong>Update1</strong>
  Helpful suggestion from 
  @user562374 to use -shared flag.</p>
  
  <p>If the shared object built using -shared is deployed on solaris machine using different compiler and if it is "statically" linked, will it cause any issues? When I say "statically" linked .so, I mean shared object is linked in make file rather then using "dlsym".</p>