rpath

Is there a way to inspect the current rpath on Linux?

核能气质少年 提交于 2019-11-27 02:52:16
I'm aware that it is possible to use readelf -d <elf> | grep RPATH to inspect a given binary from the shell, but is it possible to do this within a process? Something like (my completely made up system call): /* get a copy of current rpath into buffer */ sys_get_current_rpath(&buffer); I'm trying to diagnose some suspect SO linking issues in our codebase, and would like to inspect the RPATH this way if possible (I'd rather not have to spawn an external script). Employed Russian #include <stdio.h> #include <elf.h> #include <link.h> int main() { const ElfW(Dyn) *dyn = _DYNAMIC; const ElfW(Dyn)

rpath=$ORIGIN not having desired effect?

我的梦境 提交于 2019-11-27 01:07:08
问题 I've got a binary "CeeloPartyServer" that needs to find libFoundation.so at runtime, on a FreeBSD machine. They're both in the same directory. I compile (on another platform, using a cross compiler) CeeloPartyServer using linker flag "-rpath=$ORIGIN". > readelf -d CeeloPartyServer |grep -i rpath 0x0000000f (RPATH) Library rpath: [$ORIGIN] > ls CeeloPartyServer Contents Foundation.framework libFoundation.so > ./CeeloPartyServer /libexec/ld-elf.so.1: Shared object "libFoundation.so" not found,

Is there a Windows/MSVC equivalent to the -rpath linker flag?

会有一股神秘感。 提交于 2019-11-27 00:34:49
问题 On Linux/GCC I can use the -rpath flag to change an executables search path for shared libraries without tempering with environment variables. Can this also be accomplished on Windows? As far as I know, dlls are always searched in the executable's directory and in PATH. My scenario: I would like to put shared libraries into locations according to their properties (32/64bit/Debug/Release) without taking care of unique names. On Linux, this is easily be done via rpath, but I haven't found any

Build OpenSSL with RPATH?

允我心安 提交于 2019-11-26 18:01:22
I have Ubuntu 14.04. It came with openssl 1.0.1f. I want to install another openssl version (1.0.2) and I want to compile it by myself. I configure it as follows: LDFLAGS='-Wl,--export-dynamic -L/home/myhome/programs/openssl/i/lib -L/home/myhome/programs/zlib/i/lib' CPPFLAGS='-I/home/myhome/programs/openssl/i/include -I/home/myhome/programs/zlib/i/include' ./config --prefix=/home/myhome/programs/openssl/i \ zlib-dynamic shared --with-zlib-lib=/home/myhome/programs/zlib/i/lib \ --with-zlib-include=/home/myhome/programs/zlib/i/include make make install After install, when i check the binary with

Is there a way to inspect the current rpath on Linux?

柔情痞子 提交于 2019-11-26 10:19:55
问题 I\'m aware that it is possible to use readelf -d <elf> | grep RPATH to inspect a given binary from the shell, but is it possible to do this within a process? Something like (my completely made up system call): /* get a copy of current rpath into buffer */ sys_get_current_rpath(&buffer); I\'m trying to diagnose some suspect SO linking issues in our codebase, and would like to inspect the RPATH this way if possible (I\'d rather not have to spawn an external script). 回答1: #include <stdio.h>

How to stop MinGW and MSYS from mangling path names given at the command line

时光怂恿深爱的人放手 提交于 2019-11-26 09:22:56
问题 On Windows, I\'m cross-compiling a program for ARM/Linux using CodeSourcery\'s cross-compiler suite. I use MinGW MSYS as my command interpreter, and very often it will mangle my paths and pathnames. For example, to build my program, I invoke arm-none-linux-gnueabi-gcc.exe -Wall -g \\ -Wl,--dynamic-linker=/usr/lib/myrpath/ld-linux.so.3 \\ -Wl,-rpath=/usr/lib/myrpath \\ -I../targetsysroot/usr/include \\ myprogram.c -o myprogram Of course, I want /usr/lib/myrpath inserted verbatim into the

I don&#39;t understand -Wl,-rpath -Wl,

二次信任 提交于 2019-11-26 05:53:34
For convenience I added the relevant manpages below. My (mis)understanding first: If I need to separate options with , , that means that the second -Wl is not another option because it comes before , which means it is an argument to the -rpath option. I don't understand how -rpath can have a -Wl,. argument! What would make sense in my mind would be this: -Wl,-rpath . This should invoke -rpath linker option with the current directory argument. man gcc: -Wl,option Pass option as an option to the linker. If option contains commas, it is split into multiple options at the commas. You can use this

I don&#39;t understand -Wl,-rpath -Wl,

偶尔善良 提交于 2019-11-26 01:56:08
问题 For convenience I added the relevant manpages below. My (mis)understanding first: If I need to separate options with , , that means that the second -Wl is not another option because it comes before , which means it is an argument to the -rpath option. I don\'t understand how -rpath can have a -Wl,. argument! What would make sense in my mind would be this: -Wl,-rpath . This should invoke -rpath linker option with the current directory argument. man gcc: -Wl,option Pass option as an option to