Freeze statically

Sebastien Dudek fluxius at gmail.com
Mon Jul 11 14:24:47 CEST 2011


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!! =)



More information about the Python-list mailing list