From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5047 Path: news.gmane.org!not-for-mail From: Timo Teras Newsgroups: gmane.linux.lib.musl.general Subject: Re: Minimal asterisk compilation Date: Sun, 4 May 2014 12:55:41 +0300 Message-ID: <20140504125541.58602273@vostro> References: <5365EAD6.504@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1399197360 20761 80.91.229.3 (4 May 2014 09:56:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 4 May 2014 09:56:00 +0000 (UTC) Cc: lancethepants@gmail.com To: musl@lists.openwall.com Original-X-From: musl-return-5051-gllmg-musl=m.gmane.org@lists.openwall.com Sun May 04 11:55:56 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Wgt9E-0003jq-Kq for gllmg-musl@plane.gmane.org; Sun, 04 May 2014 11:55:52 +0200 Original-Received: (qmail 25944 invoked by uid 550); 4 May 2014 09:55:50 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 25932 invoked from network); 4 May 2014 09:55:50 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=FdO6eYdRZvlRud63zDrNHxRHSVhaaAVWf6HyDQUazfg=; b=M61YlQSOHYyGsH/qOwU95wstHxSWroachyoyvTNdknSeFpdhLh9Gku+ApTOIRGgFTs x45ySPDQd2AS/acwlPjtiirhs7FjqMcIppQuGwLMD/Xwv6HqS1ktaiGJ1GUxlR9MbQdO Ay2aWKPoepF3IHQaAvJj2qT5s72SIm/SN4zh7xizA9BaFljtnWDwbgyPfIc5WHxVzlGp mRhMU+8T3BZWhbwIllYErAHYsXzWMnu9uiaVCo39gfA+eoj2lfYzVci7T3/FbLC9LpIl 5iUqCstqDopb2zQMqW7U35ZD8vGXTjf/mNWWAB9MhuUQoJfNj+kMUh52uKjIqSGWMSKA OMJA== X-Received: by 10.152.8.7 with SMTP id n7mr7040968laa.22.1399197339263; Sun, 04 May 2014 02:55:39 -0700 (PDT) Original-Sender: =?UTF-8?Q?Timo_Ter=C3=A4s?= In-Reply-To: <5365EAD6.504@gmail.com> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; i486-alpine-linux-musl) Xref: news.gmane.org gmane.linux.lib.musl.general:5047 Archived-At: On Sun, 04 May 2014 01:23:02 -0600 Lance Fredrickson wrote: > Musl has caught my eye, and I've compiled various one-off binaries, > but wanted to compile a minimal asterisk setup for an embedded mipsel > device (router). > > I've put my code here. > https://github.com/lancethepants/asterisk-embedded-musl > Sorry, I do things hacky. > > I later moved over libc.so, and created ld-musl-mipsel.so.1 > > All the binaries I've compiled so far work fine, but the modules in > asterisk have issues. > One example is > > # /opt/asterisk/bin/ldd ./codec_ulaw.so /opt/asterisk/bin/ldd > (0x55550000) libc.so => /opt/asterisk/bin/ldd (0x55550000) > Error relocating ./codec_ulaw.so: ast_format_set: symbol not found > Error relocating ./codec_ulaw.so: __ast_mulaw: symbol not found > Error relocating ./codec_ulaw.so: ast_unregister_file_version: symbol > not found > Error relocating ./codec_ulaw.so: ast_module_unregister: symbol not > found Error relocating ./codec_ulaw.so: __ast_lin2mu: symbol not found > Error relocating ./codec_ulaw.so: ast_unregister_translator: symbol > not found > Error relocating ./codec_ulaw.so: __ast_register_translator: symbol > not found > Error relocating ./codec_ulaw.so: ast_register_file_version: symbol > not found > Error relocating ./codec_ulaw.so: ast_module_register: symbol not > found Those are symbols from the main 'asterisk' binary that the modules use. ldd cannot resolve them because it does not know about the main asterisk binary anything. The modules should work just fine in case asterisk loads them. > This happens for each module. The symbols look to be inside when > looking at them with the readelf command. This breaks the all of > asterisk. I tried throwing in -fPIC in the LDFLAGS but did nothing. > In order to get it compile at all, I grabbed some patches from here. > https://github.com/uggedal/aports/blob/master/main/asterisk/musl-glob-compat.patch > and also did some cheating throwing in a cdefs file from the same > repo mentioned, and some sed commands to fix some PTHREAD stuff. > I thought I was home free once it compiled, but I can't figure out > why the modules won't work. Maybe there's something simple I'm > overlooking. Any suggestions are appreciated. Just try running them. I think ldd will give similar errors even with glibc. - Timo