Sets LD_LIBRARY_PATH inside toolchain-wrapper.
PATCH 1/1 Sets LD_LIBRARY_PATH inside toolchain-wrapper.
Setting the host library path in the toolchain wrapper allows moving the host toolchain folder to a new path, as some of the tools depends on buildroot provided libraries.
--- toolchain/toolchain-wrapper.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
toolchain/toolchain-wrapper.c +14 -0
@@ -231,6 +231,7 @@ int main(int argc, char **argv)char *progpath = argv[0 ];char *basename;char *env_debug; +char *ld_path, *new_ld_path;char *paranoid_wrapper;int paranoid;int ret, i, count =0 , debug;
@@ -442,6 +443,19 @@ int main(int argc, char **argv) }#endif +/* Adds library path to our host libraries */ +if ((ld_path =getenv ("LD_LIBRARY_PATH" )) && ld_path[0 ]) { + new_ld_path =malloc (strlen (ld_path) +strlen (absbasedir) +6 ); +sprintf (new_ld_path,"%s:%s/lib" , ld_path, absbasedir); + }else { + new_ld_path =malloc (strlen (absbasedir) +5 ); +sprintf (new_ld_path,"%s/lib" , absbasedir); + } +if (setenv ("LD_LIBRARY_PATH" , new_ld_path,1 )) { +perror (__FILE__": Failed to set LD_LIBRARY_PATH" ); +return 3 ; + } +if (execv (exec_args[0 ], exec_args))perror (path);
Signature · 1 line
2.16.1
PATCH 1/1 Sets LD_LIBRARY_PATH inside toolchain-wrapper.
Hello,
Quoted 5 lines · Daniel Serpell
Setting the host library path in the toolchain wrapper allows moving the host toolchain folder to a new path, as some of the tools depends on buildroot provided libraries.
Signed-off-by Daniel Serpell <[email protected]>
This is not needed. If you want to move around the host toolchain folder, run "make sdk", which prepares the host toolchain to be a relocatable SDK.
See slide 280 of
https://bootlin.com/doc/training/buildroot/buildroot-slides.pdf for more details.
And yes, we should mention this in the Buildroot manual. Patches welcome :-)
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering http://bootlin.com
PATCH 1/1 Sets LD_LIBRARY_PATH inside toolchain-wrapper.
In reply to a message not in the archiveHi Thomas,
Quoted 9 lines · Thomas Petazzoni
Hello,
Quoted 5 lines · Daniel Serpell
Setting the host library path in the toolchain wrapper allows moving the host toolchain folder to a new path, as some of the tools depends on buildroot provided libraries.
Signed-off-by Daniel Serpell <[email protected]>
Quoted 7 lines
This is not needed. If you want to move around the host toolchain folder, run "make sdk", which prepares the host toolchain to be a relocatable SDK.
See slide 280 of
https://bootlin.com/doc/training/buildroot/buildroot-slides.pdf for more details.
Yes, I missed that.
I see that you are using patchelf to make RPATH relative inside host binaries, is there any reason to not run that always, or at least in the "make toolchain" target?
Quoted 4 lines
And yes, we should mention this in the Buildroot manual. Patches welcome :-)
I'm not very good at writing documentation, perhaps the attached patch is enough.
Regards,
Daniel.
PD: Sorry, I first emailed this off-list on error.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Adds-documentation-to-the-make-sdk-rule.patch
Type: text/x-patch
Size: 1729 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180216/24479338/attachment.bin>
PATCH 1/1 Sets LD_LIBRARY_PATH inside toolchain-wrapper.
Hello,
Quoted 3 lines · Daniel Serpell
I see that you are using patchelf to make RPATH relative inside host binaries, is there any reason to not run that always, or at least in the "make toolchain" target?
Because there's no real reason to do that. During the build, the toolchain and other host tools are not moving, so keeping the absolute RPATH is fine. It's only when you want to move the toolchain/SDK around that the rpath needs to be adjusted to be relative RPATH.
Quoted 2 lines
I'm not very good at writing documentation, perhaps the attached patch is enough.
Patch looks good. Could you send it with "git send-email", and change the commit title to something like:
docs/manual: add documentation for the "make sdk" target
Thanks!
Thoas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering http://bootlin.com