From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9169 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: MUSL issue while loading C++ lib Date: Thu, 21 Jan 2016 23:48:19 +0100 Message-ID: <20160121224818.GE9621@port70.net> References: <20160121171245.GC9621@port70.net> <20160121200626.GD9621@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1453416514 11834 80.91.229.3 (21 Jan 2016 22:48:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Jan 2016 22:48:34 +0000 (UTC) Cc: musl@lists.openwall.com To: N Jain Original-X-From: musl-return-9182-gllmg-musl=m.gmane.org@lists.openwall.com Thu Jan 21 23:48:33 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 1aMO1p-0003ey-Il for gllmg-musl@m.gmane.org; Thu, 21 Jan 2016 23:48:33 +0100 Original-Received: (qmail 1340 invoked by uid 550); 21 Jan 2016 22:48:31 -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 32763 invoked from network); 21 Jan 2016 22:48:30 -0000 Mail-Followup-To: N Jain , musl@lists.openwall.com Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Xref: news.gmane.org gmane.linux.lib.musl.general:9169 Archived-At: * N Jain [2016-01-21 16:17:36 -0500]: > > > > > i think the musl linker should be able to deal with this :P > > > > > Do you mean linking using "g++" is not right way ? I am trying to find out i meant the musl dynamic linker that loads the .so at runtime, not the static linker you used at compilation. > if I could use "ld" directly but not sure what options to use and how to > pass libs. when in doubt use -v too see what options gcc passes to ld > I am using below commands to compile and link > > gcc -c a.c -o bin/a.o > g++ -c acpp.cpp -o bin/acpp.o > > g++ bin/a.o bin/acpp.o -o a.elf > > While reading about the difference between ld and g++ linking I found g++ > uses ld itself. > Am I missing something ? > i dont think so and i think the linked binary is fine libstdc++.so.6 vs libgcc_s.so.1 has some issues which makes the musl linker fail to find some symbols. i can't help further, you will have to debug it, i'd try to look at dso->strings with gdb and why the find_sym fails or recompile musl with some dprintf added, or try a known working toolchain and compare against it, or wait for other ideas..