mailing list of musl libc
 help / color / mirror / code / Atom feed
* Regarding whole-archive linking libc.a into a shared lib
@ 2016-07-14  9:52 Jason Ramapuram
  2016-07-14 10:17 ` Aidan Hobson Sayers
  0 siblings, 1 reply; 5+ messages in thread
From: Jason Ramapuram @ 2016-07-14  9:52 UTC (permalink / raw)
  To: musl; +Cc: Jason Ramapuram

[-- Attachment #1: Type: text/plain, Size: 1299 bytes --]

Hello there,

Is it at all possible to link musl's libc.a statically into a shared lib?
After a lot of trying I either get relocation errors (when using musl-gcc
built on say centos7) as such (
http://stackoverflow.com/questions/38251344/musl-fails-to-link-libc-a-into-shared-library)
or hidden symbols not being defined like below (when using Alpine linux) :

/home/buildozer/aports/main/musll/src/musl-1.1.12/src/ldso/x86_64/tlsdesc.s:36:
undefined reference to `__tls_get_new'
/usr/lib/gcc/x86_64-alpine-linux-musl/5.3.0/../../../../x86_64-alpine-linux-musl/bin/ld:
tgt/Linux-x86_64/mylib/lib/mylib.so: hidden symbol `__tls_get_new’ isn't
defined
/usr/lib/gcc/x86_64-alpine-linux-musl/5.3.0/../../../../x86_64-alpine-linux-musl/bin/ld:
final link failed: Bad value
collect2: error: ld returned 1 exit status
Makefile:58: recipe for target ‘tgt/Linux-x86_64/mulib/lib/mylib.so’ failed
make: *** [tgt/Linux-x86_64/mylib/lib/mylib.so] Error 1

I understand this might conflict when someone tries to link against this
and libc.so from a binary, however would it be possible somehow to mangle
all the libc calls internally inside the shared lib? Is there a tool that
would be able to do this? It would be really nice to have a portable shared
lib that has libc built in.

[-- Attachment #2: Type: text/html, Size: 1628 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-07-14 15:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-14  9:52 Regarding whole-archive linking libc.a into a shared lib Jason Ramapuram
2016-07-14 10:17 ` Aidan Hobson Sayers
2016-07-14 10:49   ` Jason Ramapuram
2016-07-14 11:43     ` Szabolcs Nagy
2016-07-14 15:07     ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).