Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 9165 - UPX binary compression USE flag implementation
Summary: UPX binary compression USE flag implementation
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: Daniel Robbins (RETIRED)
URL: http://forums.gentoo.org/viewtopic.ph...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-15 12:01 UTC by David Nielsen
Modified: 2011-10-30 22:37 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Nielsen 2002-10-15 12:01:48 UTC
Enabling UPX in portage via USE, would this be possible, and if so would 
anyone help me implement this for a future portage release?
Comment 1 SpanKY gentoo-dev 2002-10-15 18:43:59 UTC
in what areas would you find this to be best applied ? 
Comment 2 Hanno Böck gentoo-dev 2002-10-16 04:06:00 UTC
I dont think that this is a very good idea. It would save harddisk space, but it
might introduce a lot of problems:
As far as I know how executable packers like upx work, it would need more
memory. Also, I don't think that upx is compatible with all programs.
If you wanna save diskspace, set your CFLAGS to "-Os" (optimize for size).
If oyu really want to implement something like this, also think about the
script-packer gzexe, which usually can pack better than upx.
Comment 3 David Nielsen 2002-10-16 10:00:07 UTC
I had a rethinking, the USE flag might not such a good idea - UPX should be an 
ON/OFF switch, and we don't really have a way of locking a flag down. So 
Implementing this might be a bit hard.

Anyways, the reason I wanted to implement this was that it had been stated in 
the thread on the forums that UPX has an extremely fast decompression scheme, 
also the smaller we make our binaries (in theory) the faster they should load, 
thus we get faster load times, with out having to resort to -Os (and therefore 
loss execution speed). At least that's the theory (as stated the in the thread).

Also it seems like a fun little project for me, since I'll get to have a looksy 
at the portage code :) - the only problem seems to be adjusting the MD5 sums 
for unmerging and having a way to set enable/disable in global scope (I don't 
know how portage "works" at all so I don't know how hard this is to implement.)

This is NOT about saving diskspace this is about reading less from the disk 
(remember harddrives are MUCH slower than ram, let alone the CPU). Saving 
diskspace seems to me like just a minor advantage here.

Am I making sense or am I just totally wrong ?
- Lovechild
Comment 4 Santiago Tabares 2002-10-16 20:53:50 UTC
Remember to read the UPX manpage first:

...
How it works: 

Because Linux is a real operating system, the in-place in-memory 
decompression scheme used in the other executable formats doesn't 
work here. 

Instead we must use temporary decompression to disk. Interestingly - 
because of the good memory management of the Linux kernel - this 
often does not introduce a noticable delay, and in fact there 
will be no disk access at all if you have enough free memory as 
the entire process takes places within the filesystem buffers. 
...
- It is not advisable to compress programs which usually have many 
instances running (like `make') because the common segments of 
compressed programs won't be shared any longer between different 
processes. 
...
Comment 5 David Nielsen 2002-10-17 05:01:26 UTC
Oh crap, back to the drawing board - I figured we could just make /tmp a 
ramdisk or keep it in ram all the time (that's what I gathered from reading the 
thread)..

oh forget it, let's just close this sucker and get on with our lifes, I'm 
guessing the best way to decrease load times would be extensive use of the new 
prelinking features in glibc 2.3. - damned, the idea sounded so nice at first.