Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don’t set RUNPATH if it is the system search path - CMAKE_SKIP_RPATH #1245

Closed
heitbaum opened this issue Jan 8, 2022 · 2 comments
Closed

Comments

@heitbaum
Copy link

heitbaum commented Jan 8, 2022

The following libevent commit forces RPATH ce8be23 on Linux.

With the cleanup of RPATH/RUNPATH in - LibreELEC/LibreELEC.tv#6094 - we are cleaning up incorrect and unnecessary RPATH/RUNPATH, we have used the CMAKE_SKIP_RPATH build option but given that libevent.so is in the system search path - the RUNPATH is unnecessary.

reading:

Suggest that RUNPATH can still be used when installing, but only if it's not a system directory (as per the wiki) so that it is not necessary to use CMAKE_SKIP_RPATH

 # readelf --dynamic /usr/lib/libevent.so | grep '\['
 Addr: 0x000000000005fd48  Offset: 0x04fd48  Link to section: [ 2] '.dynstr'
  NEEDED            Shared library: [libc.so.6]
  SONAME            Library soname: [libevent-2.1.so.7]
  RUNPATH           Library runpath: [/usr/lib]
# LD_LIBRARY_PATH= LD_DEBUG=libs ldd -v /usr/lib/libevent.so 
    190127:     find library=libm.so.6 [0]; searching
    190127:      search cache=/etc/ld.so.cache
    190127:      search path=/usr/lib/tls/aarch64:/usr/lib/tls:/usr/lib/aarch64:/usr/lib                (system search path)
    190127:       trying file=/usr/lib/tls/aarch64/libm.so.6
    190127:       trying file=/usr/lib/tls/libm.so.6
    190127:       trying file=/usr/lib/aarch64/libm.so.6
    190127:       trying file=/usr/lib/libm.so.6
    190127:     
    190127:     find library=libc.so.6 [0]; searching
    190127:      search cache=/etc/ld.so.cache
    190127:      search path=/usr/lib           (system search path)
    190127:       trying file=/usr/lib/libc.so.6
    190127:     
    190127:     
    190127:     calling init: /lib/ld-linux-aarch64.so.1
    190127:     
    190127:     
    190127:     calling init: /usr/lib/libc.so.6
    190127:     
    190127:     
    190127:     calling init: /usr/lib/libm.so.6
    190127:     
    190127:     
    190127:     initialize program: /bin/bash
    190127:     
    190127:     
    190127:     transferring control: /bin/bash
    190127:     
ldd: $warning: you do not have execution permission for `/usr/lib/libevent.so'
    190131:     find library=libc.so.6 [0]; searching
    190131:      search path=/usr/lib/tls/aarch64:/usr/lib/tls:/usr/lib/aarch64:/usr/lib                (system search path)
    190131:       trying file=/usr/lib/tls/aarch64/libc.so.6
    190131:       trying file=/usr/lib/tls/libc.so.6
    190131:       trying file=/usr/lib/aarch64/libc.so.6
    190131:       trying file=/usr/lib/libc.so.6
    190131:     
        linux-vdso.so.1 (0x0000ffffbb324000)
        libc.so.6 => /usr/lib/libc.so.6 (0x0000ffffbb10d000)
        /usr/lib/ld-linux-aarch64.so.1 (0x0000ffffbb2f4000)

        Version information:
        /usr/lib/libevent.so:
                libc.so.6 (GLIBC_2.17) => /usr/lib/libc.so.6
                libc.so.6 (GLIBC_2.25) => /usr/lib/libc.so.6
                libc.so.6 (GLIBC_2.33) => /usr/lib/libc.so.6
        /usr/lib/libc.so.6:
                ld-linux-aarch64.so.1 (GLIBC_PRIVATE) => /usr/lib/ld-linux-aarch64.so.1
                ld-linux-aarch64.so.1 (GLIBC_2.17) => /usr/lib/ld-linux-aarch64.so.1
@azat azat closed this as completed in 6d09efe Jan 15, 2022
@azat
Copy link
Member

azat commented Jan 15, 2022

Thanks for the detailed report, fixed (Now RPATH will not be installed for when libevent is installed into system wide directories).

@heitbaum
Copy link
Author

Hi @azat - tested the patch in our build tree. Works as expected 👍. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants