[asterisk-bugs] [JIRA] Updated: (ASTERISK-20407) Asterisk compilation doesn't set rpath when --prefix is something other that /usr

David M. Lee (JIRA) noreply at issues.asterisk.org
Wed Sep 12 08:20:07 CDT 2012


     [ https://issues.asterisk.org/jira/browse/ASTERISK-20407?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David M. Lee updated ASTERISK-20407:
------------------------------------

    Description: 
When Asterisk is compiled with {{--prefix}} set to something other than {{/usr}}, it fails to startup on Linux.

{code:none}
$ ./configure --prefix=/opt/asterisk
$ make all install
$ /opt/asterisk/sbin/asterisk
/opt/asterisk/sbin/asterisk: error while loading shared libraries: libasteriskssl.so.1: cannot open shared object file: No such file or directory
{code}

This is because the Asterisk build scripts do not to set the {{-rpath}} [linker option|http://linux.die.net/man/1/ld], which would allow the {{asterisk}} executable to automagically find the {{libasteriskssl.so}} shared object. This wasn't a problem before Asterisk 11, because there were no non-system shared objects for Asterisk to link to at startup.

h3. Workarounds

# Specify the linker flag to configure
{code:none}
$ LDFLAGS="-Wl,-rpath,/opt/asterisk/lib" ./configure --prefix=/opt/asterisk
{code}
# Specify {{LD_LIBRARY_PATH}} when launching
{code:none}
$ export LD_LIBRARY_PATH=/opt/asterisk/lib
$ /opt/asterisk/sbin/asterisk
{code}
# Use [{{chrpath}}|http://linux.die.net/man/1/chrpath] to add rpath to the exe after the fact.
{code:none}
$ chrpath -r /opt/asterisk/lib /opt/asterisk/sbin/asterisk
{code}

  was:
When Asterisk is compiled with {{--prefix}} set to something other than {{/usr}}, it fails to startup on Linux.

{code:none}
$ ./configure --prefix=/opt/asterisk
$ make all install
$ /opt/asterisk/sbin/asterisk
/opt/asterisk/sbin/asterisk: error while loading shared libraries: libasteriskssl.so.1: cannot open shared object file: No such file or directory
{code}

This is because the Asterisk build scripts do not to set the {{-rpath}} [linker option|http://linux.die.net/man/1/ld], which would allow the {{asterisk}} executable to automagically find the {{libasteriskssl.so}} shared object. This wasn't a problem before Asterisk 11, because there were no non-system shared objects for Asterisk to link to at startup.

h3. Workarounds

# Specify the linker flag to configure
{code:none}
$ LDFLAGS="-Wl,-rpath=/opt/asterisk/lib" ./configure --prefix=/opt/asterisk
{code}
# Specify {{LD_LIBRARY_PATH}} when launching
{code:none}
$ export LD_LIBRARY_PATH=/opt/asterisk/lib
$ /opt/asterisk/sbin/asterisk
{code}
# Use [{{chrpath}}|http://linux.die.net/man/1/chrpath] to add rpath to the exe after the fact.
{code:none}
$ chrpath -r /opt/asterisk/lib /opt/asterisk/sbin/asterisk
{code}


Comma is more portable than equals. Whatever...

> Asterisk compilation doesn't set rpath when --prefix is something other that /usr
> ---------------------------------------------------------------------------------
>
>                 Key: ASTERISK-20407
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-20407
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Core/BuildSystem
>    Affects Versions: 11.0.0-beta1
>            Reporter: David M. Lee
>            Severity: Minor
>
> When Asterisk is compiled with {{--prefix}} set to something other than {{/usr}}, it fails to startup on Linux.
> {code:none}
> $ ./configure --prefix=/opt/asterisk
> $ make all install
> $ /opt/asterisk/sbin/asterisk
> /opt/asterisk/sbin/asterisk: error while loading shared libraries: libasteriskssl.so.1: cannot open shared object file: No such file or directory
> {code}
> This is because the Asterisk build scripts do not to set the {{-rpath}} [linker option|http://linux.die.net/man/1/ld], which would allow the {{asterisk}} executable to automagically find the {{libasteriskssl.so}} shared object. This wasn't a problem before Asterisk 11, because there were no non-system shared objects for Asterisk to link to at startup.
> h3. Workarounds
> # Specify the linker flag to configure
> {code:none}
> $ LDFLAGS="-Wl,-rpath,/opt/asterisk/lib" ./configure --prefix=/opt/asterisk
> {code}
> # Specify {{LD_LIBRARY_PATH}} when launching
> {code:none}
> $ export LD_LIBRARY_PATH=/opt/asterisk/lib
> $ /opt/asterisk/sbin/asterisk
> {code}
> # Use [{{chrpath}}|http://linux.die.net/man/1/chrpath] to add rpath to the exe after the fact.
> {code:none}
> $ chrpath -r /opt/asterisk/lib /opt/asterisk/sbin/asterisk
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list