Can the RPATH of a Released Linux Executable be Modified: $ORIGIN/netcoredeps #18011
Replies: 3 comments 3 replies
-
` internal class DllImportSoDemo
}` `#include "../DllImportSoDemo2/ABC.h"
}` `#include "ABC.h" int ABC::add(int x, int y) |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I will also add if you have access to source code for the native libraries: If possible you should build the native libraries against your system libraries. That way you can avoid doing all this dependency management and everything should work with the same library. Which is how most native Linux programs are built. |
Beta Was this translation helpful? Give feedback.
-
When developing and deploying Linux - based applications, dependency management issues often arise. My program needs to call multiple different SDKs to meet diverse functional requirements. Currently, according to the program's architecture and configuration, I need to place the shared object files (SO files) of these SDKs in the
$ORIGIN/netcoredeps
directory. Here,$ORIGIN
is a special variable that points to the directory where the executable itself is located. This setting is a common practice in many Linux program dependency management scenarios, which helps ensure that the program can find the required dependent libraries during runtime.However, as the project progresses, I'm facing a tough problem. There are SO files with the same names in different SDKs. This situation can lead to serious conflicts, preventing the program from correctly identifying and loading the specific SDK library files it needs, thus affecting the normal operation of the program. To solve this problem, I considered creating separate sub - directories for different SDKs, placing the SO files with the same names but belonging to different SDKs in these sub - directories respectively, in order to achieve effective isolation and management.
But now, a new obstacle has emerged. The released executable cannot call the SO files in these sub - directories. This means that although I have carried out a reasonable directory planning for the files, the program cannot correctly locate the dependent files in these sub - directories at a deeper level during runtime.
Based on this, I would like to ask if it is possible to modify the RPATH value of the executable so that it can correctly identify the SO files in these sub - directories. Or is there any other way to make the sub - directories under
netcoredeps
effective, ensuring that the program can smoothly call all the required SDK dependent files, thus guaranteeing the stable operation and functional implementation of the program. I'm looking forward to your valuable suggestions and solutions.Beta Was this translation helpful? Give feedback.
All reactions