473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Freezing a static executable

I am trying to freeze a static executable. I built a static Python
executable this way:
./configure --disable-shared --prefix=/usr/local
make
make install
Even that didn't give me a really static executable, though:
$ ldd /usr/local/bin/python
linux-gate.so.1 => (0xffffe000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb7f44000)
libdl.so.2 => /lib/libdl.so.2 (0xb7f40000)
libutil.so.1 => /lib/libutil.so.1 (0xb7f3c000)
libm.so.6 => /lib/tls/libm.so.6 (0xb7f17000)
libc.so.6 => /lib/tls/libc.so.6 (0xb7de9000)
/lib/ld-linux.so.2 (0xb7f70000)
Then I typed this:
/usr/local/bin/python
/home/wware/Python-2.4.1/Tools/freeze/freeze.py foo.py
ldd foo
$ ldd foo
linux-gate.so.1 => (0xffffe000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb7f5a000)
libdl.so.2 => /lib/libdl.so.2 (0xb7f56000)
libutil.so.1 => /lib/libutil.so.1 (0xb7f52000)
libm.so.6 => /lib/tls/libm.so.6 (0xb7f2d000)
libc.so.6 => /lib/tls/libc.so.6 (0xb7dff000)
/lib/ld-linux.so.2 (0xb7f86000)
What stupid thing am I doing wrong?
TIA for any advice
Will Ware

Jun 5 '06 #1
1 2161
Will Ware wrote:
I am trying to freeze a static executable. I built a static Python
executable this way:
./configure --disable-shared --prefix=/usr/local
make
make install
Even that didn't give me a really static executable, though:
AFAIK it's not supported because the interpreter won't be able to load
C extensions if compiled statically. There is a bootstrap issue, to
build a static python executable you need extensions built but to build
extensions you need python, so you need unconventional build procedure.

After python build is finished you get static library libpython2.4.a.
Then you need all extensions you're going to use built as .a files (I'm
not even sure there is a standard way to do it). Then you need to write
a loader like in py2exe, exemaker, pyinstaller, etc that will
initialize python interperter and extensions. Those three pieces
(libpython2.4.a, extensions, loader) can be linked as a static
executable.

What stupid thing am I doing wrong?


You are just trying to do something nobody was really interested to
implement.

Jun 5 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Torsten Mohr | last post by:
Hi, i'd like to build an executable file that is linked with a python library and executes a script via PyRun_SimpleString or similar functions. Is there a static library of python available,...
3
by: Marcin Vorbrodt | last post by:
So I have a class Math that looks like this: Math { public: static Real PI(void); }; Real Math::PI(void) { return 4.0 * atan(1.0); }
2
by: Bramz | last post by:
Hi all, I have a rather strange linker (?) problem. At least, I think it's a linker problem, but I'm not so sure. It's a bit lengthy to describe ... I've implemented a generic factory...
4
by: jr | last post by:
I am working in VC++ so this may be microsoft specific though I don't think so. Excuse me if it is. Assuming it isn't, can someone generally explain the purpose of having both - is it purely a...
8
by: Robert A Riedel | last post by:
I have an application that requires a DLL and an executable that uses the DLL, both of which were implemented in Visual C++ using unmanged code. Both the executable and the DLL are linked with...
7
by: bearophileHUGS | last post by:
Most of my ideas seem usless or stupid, but I think expressing them here doesn't harm much. This is an idea for Py 3.0, because it's not backward compatible. Dicts and sets require immutable...
15
by: Notre Poubelle | last post by:
Hello, I have a large legacy MFC application. As is typical, there is an executable along with several MFC DLLs. One of these DLLs is created by staticly linking in many libraries resulting in...
3
by: =?Utf-8?B?VG9kZA==?= | last post by:
What is the memory footprint of static methods of a windows app running on a server when the server spins up multiple instances of the application? In my envirionment, we have a Citrix server...
2
by: Evan Burkitt | last post by:
Hi, all. I have a Windows DLL that exports a number of functions. These functions expect to receive a pointer to a callback function and an opaque void* parameter. The callback functions are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.