LD_LIBRARY_PATH Not Working?

386 views
Skip to first unread message

Erik

unread,
Feb 3, 2011, 5:52:13 AM2/3/11
to PyInstaller
Hello everyone.

I am compiling on linux and running on linux, so I'd like to keep the
size of the binary down.

I tried compiling with --onedir and then just doing LD_LIBRARY_PATH=/
lib ./PROG as I read in one of the posts on this group, but it doesn't
work, it still looks for the libraries in the current working
directory.

Thanks for your help.

-Erik

Martin Zibricky

unread,
Feb 3, 2011, 6:07:18 AM2/3/11
to pyins...@googlegroups.com
LD_LIBRARY_PATH is overridden in the bootloader. So it won't to set
LD_LIBRARY_PATH before starting your frozen app.

Erik píše v Čt 03. 02. 2011 v 02:52 -0800:

Erik

unread,
Feb 3, 2011, 6:43:31 PM2/3/11
to PyInstaller
Thanks Martin, that makes sense.

So is there any way to set this path during compile time so that I can
tell it to use a specific directory?

Thanks,
-Erik

Martin Zibricky

unread,
Feb 4, 2011, 7:33:09 AM2/4/11
to pyins...@googlegroups.com
Erik píše v Čt 03. 02. 2011 v 15:43 -0800:

>
> So is there any way to set this path during compile time so that I can
> tell it to use a specific directory?

You will need to hardcode it in the C code of the bootloader and
recompile the bootloader in ./trunk/source/ folder.

The file to modify is in ./trunk/source/linux/utils.c. There is the code
which sets the LD_LIBRARY_PATH.

For details how to compile the bootloader from source see pyinstaller
manual.

Erik

unread,
Feb 4, 2011, 9:13:49 PM2/4/11
to PyInstaller
Awesome thank you.

One last question, instead of tweaking LD_LIBRARY_PATH, how can I
tweak the path that the archive gets extracted to at run that occurs
wit the onefile option? Apps compiled with pyinstaller won't work on /
tmp directories that have noexec mount options, so I need to get
around this by being able to set my own tmp path.

Thank you.
-Erik

Erik

unread,
Feb 9, 2011, 9:10:21 PM2/9/11
to PyInstaller
Anyone? Is there a way to change that path to where the _MEIXXXX
folder gets extract to?

Thanks!
-Erik

Hartmut Goebel

unread,
Feb 10, 2011, 1:53:10 PM2/10/11
to pyins...@googlegroups.com
Am 10.02.2011 03:10, schrieb Erik:
> Anyone? Is there a way to change that path to where the _MEIXXXX
> folder gets extract to?
Of course :-) But only in the C code :-(

--
Schönen Gruß - Regards
Hartmut Goebel
Dipl.-Informatiker (univ.), CISSP, CSSLP

Goebel Consult
Spezialist für IT-Sicherheit in komplexen Umgebungen
http://www.goebel-consult.de

Monatliche Kolumne: http://www.cissp-gefluester.de/
Goebel Consult mit Mitglied bei http://www.7-it.de


Erik

unread,
Feb 10, 2011, 3:15:20 PM2/10/11
to PyInstaller
Care to point me in the write direction? I am more than willing to
modify the C code.

Thanks,
-Erik

On Feb 10, 1:53 pm, Hartmut Goebel <h.goe...@goebel-consult.de> wrote:
> Am 10.02.2011 03:10, schrieb Erik:> Anyone? Is there a way to change that path to where the _MEIXXXX
> > folder gets extract to?
>
> Of course :-) But only in the C code :-(
>
> --
> Schönen Gruß - Regards
> Hartmut Goebel
> Dipl.-Informatiker (univ.), CISSP, CSSLP
>
> Goebel Consult
> Spezialist für IT-Sicherheit in komplexen Umgebungenhttp://www.goebel-consult.de
>
> Monatliche Kolumne:http://www.cissp-gefluester.de/
> Goebel Consult mit Mitglied beihttp://www.7-it.de
>
>  smime.p7s
> 6KViewDownload

Hartmut Goebel

unread,
Feb 10, 2011, 3:28:20 PM2/10/11
to pyins...@googlegroups.com
Am 10.02.2011 21:15, schrieb Erik:
> Care to point me in the write direction? I am more than willing to
> modify the C code.
Well, I'm not the one knows the C-source, sorry. But
source/common/main.c and launch.c may be a good starting point.

Erik

unread,
Feb 10, 2011, 4:13:39 PM2/10/11
to PyInstaller
launch.c it was ;)

On Feb 10, 3:28 pm, Hartmut Goebel <h.goe...@goebel-consult.de> wrote:
> Am 10.02.2011 21:15, schrieb Erik:> Care to point me in the write direction? I am more than willing to
> > modify the C code.
>
> Well, I'm not the one knows the C-source, sorry. But
> source/common/main.c and launch.c may be a good starting point.
>
> --
> Schönen Gruß - Regards
> Hartmut Goebel
> Dipl.-Informatiker (univ.), CISSP, CSSLP
>
> Goebel Consult
> Spezialist für IT-Sicherheit in komplexen Umgebungenhttp://www.goebel-consult.de
>
> Monatliche Kolumne:http://www.cissp-gefluester.de/
> Goebel Consult mit Mitglied beihttp://www.7-it.de
>
>  smime.p7s
> 6KViewDownload
Reply all
Reply to author
Forward
0 new messages