Freeze statically

S

Sebastien Dudek

Hi everyone!

Let me explain you my big adventure. So I trying to make a static
python executable using the native Python freeze. I've modified the
file Modules/Setup.dist using this perl cli : perl -pi -e 's!(^#
\*shared\*)!*static*\n$1!' Modules/Setup.dist

Then ./configure, make && make install

If I'm using my python interpreter to build with freeze a simple
project that we can call "hello world". It works perfectly but it is
still : "dynamically linked (uses shared libs)". So modifying the
Makefile using '-static' for linking, I hopped I could make it static.

But... it fail :
+------------------------------------------------------------------------------------------------------------------------------------------
+
....
/home/fluxius/Python-2.7.2/./Modules/pwdmodule.c:156: warning: Using
'setpwent' in statically linked applications requires at runtime the
shared libraries from the glibc version used for linking
/home/fluxius/Python-2.7.2/./Modules/pwdmodule.c:168: warning: Using
'endpwent' in statically linked applications requires at runtime the
shared libraries from the glibc version used for linking
/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer
equality in `/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/
4.5.2/../../../libc.a(strcmp.o)' can not be used when making an
executable; recompile with -fPIE and relink with -pie
collect2: ld returned 1 exit status
make: *** [hello] Erreur 1
+------------------------------------------------------------------------------------------------------------------------------------------
+

Help me please!! =)
 
S

Sebastien Dudek

Actually, there is a solution but not very clean.

I was surprise by two différent tools:
- Statifier (but it needs to be compiled without ASLR)
- And ErminePro which is very powerful to transform dynamic
executables to static.

But if someone is aware about compiling python code to static more
properly, I'm in!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top