codehenry / xmonad

Automatically exported from code.google.com/p/xmonad
0 stars 0 forks source link

Strip the executable file created during recompilation #505

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. recompile xmonad

I think it's a good idea to strip the executable file generated during 
recompilation to make it even more lightweight.

My xmonad version is 0.10

I believe the following code is pretty self-explanatory:

$ cd
$ xmonad --recompile
$ ls --size .xmonad/xmonad-x86_64-linux
2552 .xmonad/xmonad-x86_64-linux
$ file .xmonad/xmonad-x86_64-linux
.xmonad/xmonad-x86_64-linux: ELF 64-bit LSB executable, x86-64, version 1 
(SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, 
BuildID[sha1]=0xfec31cee9b5541ce3310171ffa299d0282a5cfb8, not stripped
$ strip .xmonad/xmonad-x86_64-linux
$ ls --size .xmonad/xmonad-x86_64-linux
1648 .xmonad/xmonad-x86_64-linux
$ file .xmonad/xmonad-x86_64-linux
.xmonad/xmonad-x86_64-linux: ELF 64-bit LSB executable, x86-64, version 1 
(SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, 
BuildID[sha1]=0xfec31cee9b5541ce3310171ffa299d0282a5cfb8, stripped

Original issue reported on code.google.com by jach...@gmail.com on 16 Apr 2012 at 10:25

GoogleCodeExporter commented 8 years ago
I mean, I'm not against a patch that does this, but... you have to have GHC 
installed (250MB) to recompile xmonad. Is that last 250KB the important place 
to do space optimization?

Original comment by daniel.w...@gmail.com on 16 Apr 2012 at 10:32

GoogleCodeExporter commented 8 years ago
Hehe, you're right. The few KBs are not important. But I thought an ELF file 
runs somewhat faster, if there are no useless symbols. But maybe I'm mistaken, 
I'm not an expert on this topic :)

Original comment by jach...@gmail.com on 17 Apr 2012 at 4:23

GoogleCodeExporter commented 8 years ago
I hadn't heard of that. A bit of searching the web seems to suggest that modern 
Linux is smart enough that stripping doesn't improve speed.

http://fixunix.com/unix/89227-stripping-unix-executable-doesnt-make-faster.html

Original comment by daniel.w...@gmail.com on 17 Apr 2012 at 5:05

GoogleCodeExporter commented 8 years ago
The extra-symbols thing would matter only if debugging information were in 
STABS format like in old BSDs... not even the BSDs do that any more, because 
ELF lets you put them in sections that can be completely ignored at runtime 
(with old a.out format, the only place you could put extra information was the 
symbol table).

Original comment by allber...@gmail.com on 17 Apr 2012 at 5:27