LD_PRELOAD multiple interdependent libraries
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I Have Libraries with a tree of dependencies, i.e. some of the dependencies have other dependencies I want to Preload. How can I do this?
LD_PRELOAD
/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libicudata.so.60
/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libicuuc.so.60
/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libicui18n.so.60
/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libQt5Core.so.5
MyApp
The LD_PRELOAD
call contains is sorted, such that the dependencies are listed before the depending library.
The Linker throws the following error:
ERROR: ld.so: object '/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libQt5Core.so.5' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Can the libraries be preloaded to fulfil the dependencies in the correct order?
shared-libraries ld dynamic-library ld-preload
add a comment |
I Have Libraries with a tree of dependencies, i.e. some of the dependencies have other dependencies I want to Preload. How can I do this?
LD_PRELOAD
/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libicudata.so.60
/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libicuuc.so.60
/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libicui18n.so.60
/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libQt5Core.so.5
MyApp
The LD_PRELOAD
call contains is sorted, such that the dependencies are listed before the depending library.
The Linker throws the following error:
ERROR: ld.so: object '/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libQt5Core.so.5' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Can the libraries be preloaded to fulfil the dependencies in the correct order?
shared-libraries ld dynamic-library ld-preload
add a comment |
I Have Libraries with a tree of dependencies, i.e. some of the dependencies have other dependencies I want to Preload. How can I do this?
LD_PRELOAD
/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libicudata.so.60
/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libicuuc.so.60
/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libicui18n.so.60
/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libQt5Core.so.5
MyApp
The LD_PRELOAD
call contains is sorted, such that the dependencies are listed before the depending library.
The Linker throws the following error:
ERROR: ld.so: object '/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libQt5Core.so.5' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Can the libraries be preloaded to fulfil the dependencies in the correct order?
shared-libraries ld dynamic-library ld-preload
I Have Libraries with a tree of dependencies, i.e. some of the dependencies have other dependencies I want to Preload. How can I do this?
LD_PRELOAD
/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libicudata.so.60
/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libicuuc.so.60
/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libicui18n.so.60
/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libQt5Core.so.5
MyApp
The LD_PRELOAD
call contains is sorted, such that the dependencies are listed before the depending library.
The Linker throws the following error:
ERROR: ld.so: object '/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libQt5Core.so.5' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Can the libraries be preloaded to fulfil the dependencies in the correct order?
shared-libraries ld dynamic-library ld-preload
shared-libraries ld dynamic-library ld-preload
asked Nov 15 '18 at 16:15
danbadanba
517827
517827
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
This error:
ld.so: object '/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libQt5Core.so.5'
from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
means that the dynamic loader tried to open the library and failed.
There are several possible reasons for this failure:
- The file doesn't exist (use
ls -L /opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libQt5Core.so.5
to confirm that it does - The file is for the wrong architecture (e.g. 32-bit ELF when
MyApp
is 64-bit, or vice versa). Usefile MyApp
andfile libQt5Core.so.5
to confirm that they match. - Something else. Perhaps
MyApp
was linked withnewlib
oruClibc
, butlibQt5Core.so.5
was built with GLIBC (or vice versa).
In my case the library can't be preloaded because it itself requires a dynamic library which is "not found" in the LD_LIBRARY_PATH. Unfortunate I can't change the LD_LIBRARY_PATH to include the dependencies.
– danba
Nov 16 '18 at 6:12
@danba I am confused: if you know the reasonlibQt5Core
is not loading, why didn't you say so, and why don't you add whatever library it requires to theLD_PRELOAD
list?
– Employed Russian
Nov 16 '18 at 6:45
I was trying to explain that the shared Library is missing dependencies in the question. The LD_PRELOAD list in the question does contain all dependencies, they're just not interpreted correctly it seems.
– danba
Nov 16 '18 at 6:58
@danba Your theory of why this doesn't work is probably incorrect. How do you know that "the library can't be preloaded because it itself requires a dynamic library which is "not found"" ? SettingLD_DEBUG=files,libs
could provide additional info.
– Employed Russian
Nov 16 '18 at 15:06
Thanks for theLD_DEBUG=files,libs
suggestion. It turns out the environment was dirty on that machine. Your answer, by the way, summarizes possible issues nicely.
– danba
Nov 19 '18 at 13:13
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53323623%2fld-preload-multiple-interdependent-libraries%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This error:
ld.so: object '/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libQt5Core.so.5'
from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
means that the dynamic loader tried to open the library and failed.
There are several possible reasons for this failure:
- The file doesn't exist (use
ls -L /opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libQt5Core.so.5
to confirm that it does - The file is for the wrong architecture (e.g. 32-bit ELF when
MyApp
is 64-bit, or vice versa). Usefile MyApp
andfile libQt5Core.so.5
to confirm that they match. - Something else. Perhaps
MyApp
was linked withnewlib
oruClibc
, butlibQt5Core.so.5
was built with GLIBC (or vice versa).
In my case the library can't be preloaded because it itself requires a dynamic library which is "not found" in the LD_LIBRARY_PATH. Unfortunate I can't change the LD_LIBRARY_PATH to include the dependencies.
– danba
Nov 16 '18 at 6:12
@danba I am confused: if you know the reasonlibQt5Core
is not loading, why didn't you say so, and why don't you add whatever library it requires to theLD_PRELOAD
list?
– Employed Russian
Nov 16 '18 at 6:45
I was trying to explain that the shared Library is missing dependencies in the question. The LD_PRELOAD list in the question does contain all dependencies, they're just not interpreted correctly it seems.
– danba
Nov 16 '18 at 6:58
@danba Your theory of why this doesn't work is probably incorrect. How do you know that "the library can't be preloaded because it itself requires a dynamic library which is "not found"" ? SettingLD_DEBUG=files,libs
could provide additional info.
– Employed Russian
Nov 16 '18 at 15:06
Thanks for theLD_DEBUG=files,libs
suggestion. It turns out the environment was dirty on that machine. Your answer, by the way, summarizes possible issues nicely.
– danba
Nov 19 '18 at 13:13
add a comment |
This error:
ld.so: object '/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libQt5Core.so.5'
from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
means that the dynamic loader tried to open the library and failed.
There are several possible reasons for this failure:
- The file doesn't exist (use
ls -L /opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libQt5Core.so.5
to confirm that it does - The file is for the wrong architecture (e.g. 32-bit ELF when
MyApp
is 64-bit, or vice versa). Usefile MyApp
andfile libQt5Core.so.5
to confirm that they match. - Something else. Perhaps
MyApp
was linked withnewlib
oruClibc
, butlibQt5Core.so.5
was built with GLIBC (or vice versa).
In my case the library can't be preloaded because it itself requires a dynamic library which is "not found" in the LD_LIBRARY_PATH. Unfortunate I can't change the LD_LIBRARY_PATH to include the dependencies.
– danba
Nov 16 '18 at 6:12
@danba I am confused: if you know the reasonlibQt5Core
is not loading, why didn't you say so, and why don't you add whatever library it requires to theLD_PRELOAD
list?
– Employed Russian
Nov 16 '18 at 6:45
I was trying to explain that the shared Library is missing dependencies in the question. The LD_PRELOAD list in the question does contain all dependencies, they're just not interpreted correctly it seems.
– danba
Nov 16 '18 at 6:58
@danba Your theory of why this doesn't work is probably incorrect. How do you know that "the library can't be preloaded because it itself requires a dynamic library which is "not found"" ? SettingLD_DEBUG=files,libs
could provide additional info.
– Employed Russian
Nov 16 '18 at 15:06
Thanks for theLD_DEBUG=files,libs
suggestion. It turns out the environment was dirty on that machine. Your answer, by the way, summarizes possible issues nicely.
– danba
Nov 19 '18 at 13:13
add a comment |
This error:
ld.so: object '/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libQt5Core.so.5'
from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
means that the dynamic loader tried to open the library and failed.
There are several possible reasons for this failure:
- The file doesn't exist (use
ls -L /opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libQt5Core.so.5
to confirm that it does - The file is for the wrong architecture (e.g. 32-bit ELF when
MyApp
is 64-bit, or vice versa). Usefile MyApp
andfile libQt5Core.so.5
to confirm that they match. - Something else. Perhaps
MyApp
was linked withnewlib
oruClibc
, butlibQt5Core.so.5
was built with GLIBC (or vice versa).
This error:
ld.so: object '/opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libQt5Core.so.5'
from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
means that the dynamic loader tried to open the library and failed.
There are several possible reasons for this failure:
- The file doesn't exist (use
ls -L /opt/yocto/2.5.1/sysroots/core2-64-poky-linux/usr/lib/libQt5Core.so.5
to confirm that it does - The file is for the wrong architecture (e.g. 32-bit ELF when
MyApp
is 64-bit, or vice versa). Usefile MyApp
andfile libQt5Core.so.5
to confirm that they match. - Something else. Perhaps
MyApp
was linked withnewlib
oruClibc
, butlibQt5Core.so.5
was built with GLIBC (or vice versa).
answered Nov 16 '18 at 5:34
Employed RussianEmployed Russian
128k21175243
128k21175243
In my case the library can't be preloaded because it itself requires a dynamic library which is "not found" in the LD_LIBRARY_PATH. Unfortunate I can't change the LD_LIBRARY_PATH to include the dependencies.
– danba
Nov 16 '18 at 6:12
@danba I am confused: if you know the reasonlibQt5Core
is not loading, why didn't you say so, and why don't you add whatever library it requires to theLD_PRELOAD
list?
– Employed Russian
Nov 16 '18 at 6:45
I was trying to explain that the shared Library is missing dependencies in the question. The LD_PRELOAD list in the question does contain all dependencies, they're just not interpreted correctly it seems.
– danba
Nov 16 '18 at 6:58
@danba Your theory of why this doesn't work is probably incorrect. How do you know that "the library can't be preloaded because it itself requires a dynamic library which is "not found"" ? SettingLD_DEBUG=files,libs
could provide additional info.
– Employed Russian
Nov 16 '18 at 15:06
Thanks for theLD_DEBUG=files,libs
suggestion. It turns out the environment was dirty on that machine. Your answer, by the way, summarizes possible issues nicely.
– danba
Nov 19 '18 at 13:13
add a comment |
In my case the library can't be preloaded because it itself requires a dynamic library which is "not found" in the LD_LIBRARY_PATH. Unfortunate I can't change the LD_LIBRARY_PATH to include the dependencies.
– danba
Nov 16 '18 at 6:12
@danba I am confused: if you know the reasonlibQt5Core
is not loading, why didn't you say so, and why don't you add whatever library it requires to theLD_PRELOAD
list?
– Employed Russian
Nov 16 '18 at 6:45
I was trying to explain that the shared Library is missing dependencies in the question. The LD_PRELOAD list in the question does contain all dependencies, they're just not interpreted correctly it seems.
– danba
Nov 16 '18 at 6:58
@danba Your theory of why this doesn't work is probably incorrect. How do you know that "the library can't be preloaded because it itself requires a dynamic library which is "not found"" ? SettingLD_DEBUG=files,libs
could provide additional info.
– Employed Russian
Nov 16 '18 at 15:06
Thanks for theLD_DEBUG=files,libs
suggestion. It turns out the environment was dirty on that machine. Your answer, by the way, summarizes possible issues nicely.
– danba
Nov 19 '18 at 13:13
In my case the library can't be preloaded because it itself requires a dynamic library which is "not found" in the LD_LIBRARY_PATH. Unfortunate I can't change the LD_LIBRARY_PATH to include the dependencies.
– danba
Nov 16 '18 at 6:12
In my case the library can't be preloaded because it itself requires a dynamic library which is "not found" in the LD_LIBRARY_PATH. Unfortunate I can't change the LD_LIBRARY_PATH to include the dependencies.
– danba
Nov 16 '18 at 6:12
@danba I am confused: if you know the reason
libQt5Core
is not loading, why didn't you say so, and why don't you add whatever library it requires to the LD_PRELOAD
list?– Employed Russian
Nov 16 '18 at 6:45
@danba I am confused: if you know the reason
libQt5Core
is not loading, why didn't you say so, and why don't you add whatever library it requires to the LD_PRELOAD
list?– Employed Russian
Nov 16 '18 at 6:45
I was trying to explain that the shared Library is missing dependencies in the question. The LD_PRELOAD list in the question does contain all dependencies, they're just not interpreted correctly it seems.
– danba
Nov 16 '18 at 6:58
I was trying to explain that the shared Library is missing dependencies in the question. The LD_PRELOAD list in the question does contain all dependencies, they're just not interpreted correctly it seems.
– danba
Nov 16 '18 at 6:58
@danba Your theory of why this doesn't work is probably incorrect. How do you know that "the library can't be preloaded because it itself requires a dynamic library which is "not found"" ? Setting
LD_DEBUG=files,libs
could provide additional info.– Employed Russian
Nov 16 '18 at 15:06
@danba Your theory of why this doesn't work is probably incorrect. How do you know that "the library can't be preloaded because it itself requires a dynamic library which is "not found"" ? Setting
LD_DEBUG=files,libs
could provide additional info.– Employed Russian
Nov 16 '18 at 15:06
Thanks for the
LD_DEBUG=files,libs
suggestion. It turns out the environment was dirty on that machine. Your answer, by the way, summarizes possible issues nicely.– danba
Nov 19 '18 at 13:13
Thanks for the
LD_DEBUG=files,libs
suggestion. It turns out the environment was dirty on that machine. Your answer, by the way, summarizes possible issues nicely.– danba
Nov 19 '18 at 13:13
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53323623%2fld-preload-multiple-interdependent-libraries%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown