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

Rusty Newton (JIRA) noreply at issues.asterisk.org
Sat Sep 15 15:06:28 CDT 2012


Asterisk compilation doesn't set rpath when --prefix is something other that /usr
---------------------------------------------------------------------------------

                 Key: ASTERISK-20429
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-20429
             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 # DYLD_LIBRARY_PATH on BSD's and OS X
$ /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}
# Disable the Asterisk SSL wrapper
{code:none}
$ ./configure --prefix=/opt/asterisk --disable-asteriskssl
{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