* Minimal asterisk compilation
@ 2014-05-04 7:23 Lance Fredrickson
2014-05-04 9:55 ` Timo Teras
0 siblings, 1 reply; 3+ messages in thread
From: Lance Fredrickson @ 2014-05-04 7:23 UTC (permalink / raw)
To: musl
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
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.
cheers,
Lance
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Minimal asterisk compilation
2014-05-04 7:23 Minimal asterisk compilation Lance Fredrickson
@ 2014-05-04 9:55 ` Timo Teras
2014-05-04 11:50 ` Rich Felker
0 siblings, 1 reply; 3+ messages in thread
From: Timo Teras @ 2014-05-04 9:55 UTC (permalink / raw)
To: musl; +Cc: lancethepants
On Sun, 04 May 2014 01:23:02 -0600
Lance Fredrickson <lancethepants@gmail.com> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Minimal asterisk compilation
2014-05-04 9:55 ` Timo Teras
@ 2014-05-04 11:50 ` Rich Felker
0 siblings, 0 replies; 3+ messages in thread
From: Rich Felker @ 2014-05-04 11:50 UTC (permalink / raw)
To: musl; +Cc: lancethepants
On Sun, May 04, 2014 at 12:55:41PM +0300, Timo Teras wrote:
> On Sun, 04 May 2014 01:23:02 -0600
> Lance Fredrickson <lancethepants@gmail.com> 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.
If that's the case, the problem is most likely that -rdynamic is
missing from the LDFLAGS. No idea why the build system would have
omitted it...
Rich
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-05-04 11:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-04 7:23 Minimal asterisk compilation Lance Fredrickson
2014-05-04 9:55 ` Timo Teras
2014-05-04 11:50 ` 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).