title: musl fails to link libc.a into shared library
body: <p>I have a C99 shared library that I want to link in a few statically static libraries (via <code>--whole-archive</code>). <strong>Note</strong>: All the static libs are built with <code>-fPIC</code></p>
  
  <p>I also would like to build a universal linux binary and thus have decided to use musl. When I try to link in the static <code>libc.a</code> from musl I get the following error:</p>
  
  <pre><code># Building shared library tgt/Linux-x86_64/mylib/lib/mylib.so
  /root/mylib/./tgt/Linux-x86_64/libmusl/bin/musl-gcc -Wl,-whole-archive -L./tgt/Linux-x86_64/libmusl/lib -L./tgt/Linux-x86_64/libz/lib -L./tgt/Linux-x86_64/libssl/lib -L./tgt/Linux-x86_64/libsasl/lib -L./tgt/Linux-x86_64/librdkafka/lib -L./tgt/Linux-x86_64/libcurl/lib -L./tgt/Linux-x86_64/libgjalloc/lib -L./tgt/Linux-x86_64/libavro/lib -L./tgt/Linux-x86_64/libunwind/lib -l:libc.a -l:libpthread.a -l:libz.a -l:libssl.a -l:libcrypto.a -l:libsasl2.a -l:libm.a -l:librt.a -l:libcrypt.a -l:libunwind-x86_64.a -l:librdkafka.a -l:libcurl.a -l:libgjalloc.a -l:libavro.a -Wl,-no-whole-archive -shared -fPIC -o tgt/Linux-x86_64/mylib/lib/mylib.so ./tgt/Linux-x86_64/mylib/obj/myfile.o ./tgt/Linux-x86_64/mylib/obj/myotherfile.o ./tgt/Linux-x86_64/mylib/obj/cJSON.o
  /usr/bin/ld: ./tgt/Linux-x86_64/libmusl/lib/libc.a(exit.lo): relocation R_X86_64_PC32 against undefined hidden symbol `__fini_array_start' can not be used when making a shared object
  /usr/bin/ld: final link failed: Bad value
  collect2: error: ld returned 1 exit status
  make: *** [tgt/Linux-x86_64/mylib/lib/mylib.so] Error 1
  </code></pre>
  
  <p>My musl build looks like:</p>
  
  <pre><code>cd mystatic_libs_build_dir/musl; \
  ./configure CFLAGS='-fPIC' \
  --enable-shared \
  --enable-static \
  --prefix=/root/mylib/tgt/Linux-x86_64/libmusl; \
  make; make install;
  # libmusl is available
  </code></pre>