Some Questions Regarding Dynamic/static Linking


Micket

Member
Joined
Jul 16, 2006
Messages
196
Age
41
Location
Sweden, Gothenburg
Website
www.micket.com
Hi, Orkie asked me to compile a dynamically linked version of oldplay, so tried some things out
This is the libraries i use
CODE

STATICLIBS = -Wl,-Bstatic \
-L../libs \
-ladplug \
-lbinio \
-lfaad \
-lflac \
-lgme \
-lmac \
-lmodplug \
-lmpcdec \
-lpokecubed \
-lsidplay \
-ltimidity \
-ltta \
-luade \
-lwavpack \
-lzip

DYNAMICLIBS = -Wl,-Bdynamic \
`$(PREFIX)sdl-config --libs` \
-lid3tag \
-lmad \
-lvorbisidec \
-lz

LIBS += $(STATICLIBS) $(DYNAMICLIBS)
#LIBS += $(DYNAMICLIBS) $(STATICLIBS)


Compiling using this removes 2 MB from my binary (quite nice) compared to only using static.

However, changing order by using the later LIBS i end up with just 1 MB decrease.
Something must be getting statically linked that didn't before. Either that or some other reason why an extra MB should appear in there.

I'd appreciate some help in clearing up this subject.

Second, is it possible to dynamically link anything using oopo's toolchain and get it to work with gp2x, or will the glibc ruin everything?
 
Back
Top