6

I am looking for alternative of install_name_tool of MAC in CentOS. Exactly I want to build MySQL on non default location. Also the shared libraries of the mysql binary should be on non default location and properly linked.

I wasnt able to link shared libraries libssl & libcrypto to the mysqld binary.

[user@localhost mysql]$ ldd /usr/local/mysql/bin/mysqld
        linux-gate.so.1 =>  (0x00186000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x008e2000)
        libz.so.1 => /lib/libz.so.1 (0x0097f000)
        librt.so.1 => /lib/librt.so.1 (0x00912000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x00c70000)
        libdl.so.2 => /lib/libdl.so.2 (0x00727000)
        libssl.so.1.0.0 => not found
        libcrypto.so.1.0.0 => not found
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00a7e000)
        libm.so.6 => /lib/libm.so.6 (0x008b0000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00a70000)
        libc.so.6 => /lib/libc.so.6 (0x00755000)
        /lib/ld-linux.so.2 (0x00731000)

I am sure that openssl is installed in /usr/local/extra directory as i also installed apache perfectly, which is currently working, my configure command is :

cmake . -LH -DCMAKE_INCLUDE_PATH=/usr/local/extra/include -DCMAKE_LIBRARY_PATH=/usr/local/extra/lib -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/var -DSYSCONFDIR=/usr/local/mysql/etc -DMYSQL_UNIX_ADDR=/usr/local/mysql/tmp/mysql.sock -DCURSES_LIBRARY=/usr/local/extra/lib/libncurses.so.5 -DCURSES_INCLUDE_PATH=/usr/local/extra/include -DWITH_SSL=yes -DWITH_ZLIB=system

While configuring it also shows :

-- checking for module 'openssl'
--   found openssl, version 0.9.8e-rhel5
-- Found OpenSSL: /usr/local/extra/lib/libssl.so;/usr/local/extra/lib/libcrypto.so (found version "1..")

Can any one suggest me a tool to link shared libraries to the binary.

  • Linux paths are so f**k'd up. After 30+ years they still cannot get it right. RPATHs, SONAMEs, and now some Elf TAGS. Why the hell don't they make the common case "just work"? It appears to be a classic problem of allowing engineers to drive requirements. The engineers took a 1% case and displaced a 95% case. The 1% case should be doing something special, not the common case. Its classic engineering failures. Thank god they are not designing automobiles and airplanes. – user56041 Sep 5 '17 at 12:58
4

The PatchELF utility might be useful. Otherwise, see the ldconfig man page, and the file: /etc/ld.so.conf

  • Hi. Thanks, adding path to ld.so.conf worked. But it was affecting my PC in some way which I couldn't recognize. Like my gedit stopped working after that, etc. Also this fix would work only for my PC. I want to use same binaries on other machine. There I wont be able to edit the ld.so.conf file. I will try PathELF now, but is there any other way to fix this ? Thanks a tonne. – John D Nov 29 '11 at 13:55
  • PatchELF is exactly what i needed. Again thanks a tonne. – John D Nov 29 '11 at 14:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.