From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10318 Path: news.gmane.org!not-for-mail From: Jason Ramapuram Newsgroups: gmane.linux.lib.musl.general Subject: Regarding whole-archive linking libc.a into a shared lib Date: Thu, 14 Jul 2016 11:52:29 +0200 Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114a9208cbfe60053795756e X-Trace: ger.gmane.org 1468490649 24576 80.91.229.3 (14 Jul 2016 10:04:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Jul 2016 10:04:09 +0000 (UTC) Cc: Jason Ramapuram To: musl@lists.openwall.com Original-X-From: musl-return-10331-gllmg-musl=m.gmane.org@lists.openwall.com Thu Jul 14 12:03:59 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1bNdUs-0001Av-JT for gllmg-musl@m.gmane.org; Thu, 14 Jul 2016 12:03:58 +0200 Original-Received: (qmail 8140 invoked by uid 550); 14 Jul 2016 10:03:55 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 3457 invoked from network); 14 Jul 2016 09:52:41 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:cc; bh=q+pwg9/2keQtLM+1aQg5Yu12Ym1+gYmuuJ7rDrKdxSA=; b=oJ3t4rmYqOfsuCEzaTIfUGvRlzntcpzAwxMDrnkVdGSN9CV6aFcuS5hCqW4YxREuj1 ITtpbZRIebpaSO86CTAzswYZUwvbu266KPrJMvmKd97kQ74AyNf2EKy1xLUzTFJtEBgH IXJHKLEeGXFfLuq2RyBeLtWNYIynO4Es55Y4/5++ISqJRbiBslVjZjL3OrZJKMLPuKJn RG1D5PflpqHY1D/7HJxEQRBaD5sRwdlGGAwzdQHSWQnzS7AcWfC7PovKt2P7gvLg9tcG BeqmYDyKfcbLxGacVR1tSGwujwcwVjQauCig5xpbAzVqP/alIpM0NOdP0XVCsVrd6rKX 0Ujw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=q+pwg9/2keQtLM+1aQg5Yu12Ym1+gYmuuJ7rDrKdxSA=; b=GBbGY7p/fdsbkfJOMLGnoQhNVCjBy7CId9zFrcEt46UIQzJTY1/zBNKNDYuDKqWgxV tCFd2uxC/NvQHOpF+OG/It1mpBWe72BtijiqLsL0cn6g0n3equrVo8eqQFcUVoXf5rfC zpH4T5zc9Mef/obeWorYnGKmH9twemKoPnz3Tk6RQuHUThvSFnKD5kKwfbpQinnq+r1W ZKjd0n9ngWj91wMWzGtL8Q+t1P+dp8hnAnuTIGxOj+0hArSZBmHl7h7v65k753Oz0wBe RyFflBZt7IeGJJ5yD4vhMUuARTAIelt3oG2Jl5cauaiK/eTRt3ebOPxov3Nua+8e7YNm EdPg== X-Gm-Message-State: ALyK8tL34UJ804bSIsidr9H6UdkediMkss0dqxmJ8wuNCxZA05QQGpEKb3+DC/+7gTMvhdptHN4HcRlF+CibGQ== X-Received: by 10.36.120.199 with SMTP id p190mr2359435itc.7.1468489949509; Thu, 14 Jul 2016 02:52:29 -0700 (PDT) Xref: news.gmane.org gmane.linux.lib.musl.general:10318 Archived-At: --001a114a9208cbfe60053795756e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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=E2=80=99 = 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 =E2=80=98tgt/Linux-x86_64/mulib/lib/mylib.so= =E2=80=99 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. --001a114a9208cbfe60053795756e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Hello there,

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

/home/buildozer/aports/main/musll/src/musl-1.1.12/src/ldso/x86_6= 4/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=E2=80=99= 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
collect= 2: error: ld returned 1 exit status
Makefile:58: recipe for target =E2= =80=98tgt/Linux-x86_64/mulib/lib/mylib.so=E2=80=99 failed
make: *** [tgt= /Linux-x86_64/mylib/lib/mylib.so] Error 1

I understand this might conflic= t when someone tries to link against this and libc.so from a binary, howeve= r would it be possible somehow to mangle all the libc calls internally insi= de 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.=


--001a114a9208cbfe60053795756e--