title: Undefined reference error linking gssapi in Alpine
body: <p>While trying to build the following mini test program in Alpine 3.12, the linker refuses to find symbols in the supplied library. Same works fine in Centos 8.</p>
  <pre class="lang-c prettyprint-override"><code>#include &lt;string.h&gt;
  #include &lt;gssapi/gssapi.h&gt;
  
  int main(int argc, char *argv[])
  {
      OM_uint32 major_status, minor_status;
      gss_OID_set gss_mech_set;
      int i;
  
      static gss_OID_desc _gss_mech_spnego = {6, (void *)&quot;\x2b\x06\x01\x05\x05\x02&quot;};
      gss_OID gss_mech_spnego = &amp;_gss_mech_spnego;
  
      major_status = gss_indicate_mechs(&amp;minor_status, &amp;gss_mech_set);
  
      for (i = 0; i &lt; gss_mech_set-&gt;count; i++)
      {
          if (!memcmp(gss_mech_set-&gt;elements[i].elements, gss_mech_spnego-&gt;elements, gss_mech_set-&gt;elements[i].length))
          {
              return 0;
          }
      }
  
      return 1;
  }
  
  </code></pre>
  <pre><code>$ gcc -o test -lgssapi test.c
  /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /tmp/ccdnkIOh.o: in function `main':
  test.c:(.text+0x38): undefined reference to `gss_indicate_mechs'
  collect2: error: ld returned 1 exit status
  
  </code></pre>
  <pre><code>$ objdump -T /usr/lib/libgssapi.so | grep gss_indicate_mechs
  0000000000020afb g    DF .text  00000000000000db  HEIMDAL_GSS_2.0 gss_indicate_mechs
  00000000000242c8 g    DF .text  0000000000000180  HEIMDAL_GSS_2.0 gss_indicate_mechs_by_attrs
  </code></pre>
  <p>APKs installed</p>
  <pre><code>alpine-sdk
  heimdal
  heimdal-dev
  
  </code></pre>
  <p>What am I missing?</p>