in reply to Re: bootstrapping with microperl
in thread bootstrapping with microperl

Hi, that UPX is very cool. ++ . To continue discussion on microperl: Would you know how to modify the Makefile.micro to get it to produce a statically linked microperl? It's still linked to some shared libs:
libm.so.6 => /lib/libm.so.6 
libc.so.6 => /lib/libc.so.6 
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 
libc.so.6 and ld-linux.so.2 seem pretty standard in boot disks, but I was thinking of statically linking libm.so.6 .

Replies are listed 'Best First'.
Re: Re: Re: bootstrapping with microperl
by rob_au (Abbot) on Jan 19, 2003 at 21:08 UTC
    It is very easy to build microperl statically - To do this, the flag -static needs to be added to the compiler flags. For example:

    LD = $(CC) DEFINES = -DPERL_CORE -DPERL_MICRO OPTIMIZE = -O3 -static CFLAGS = $(DEFINES) $(OPTIMIZE) LIBS = -lm _O = .o

    On systems that support dynamic linking, this prevents linking with the shared libraries. On other systems, this option has no effect.

     

    perl -le 'print+unpack("N",pack("B32","00000000000000000000001000011110"))'

      Thanks rob_au. Here is another tip which might save some time for monks trying to get upx(the binary compressor) to work. If you have gcc3.2 on linux, it dosn't automatically switch to using g++, as do previous versions. So if your compile of upx fails with a message including " __gxx_personality_v0" you need to edit the Makefile to use CC=g++.