I followed the development lfs book(20051118), using knoppix 4.0.2 dvd as a starting point. After I have finished some packages in chapter 6, I compared the size of files in lfs's directory with knoppix's. I found that almost all elf binaries are bigger than knoppix's, 70% of them are ~10K bigger, a few of them are 30K or more bigger.

So I focused on one of them, sed-4.1.4(knoppix's is 4.1.4, lfs book's is also 4.1.4):
the knoppix one is 41K, for linux 2.2.0
the one I compiled is 96K, for linux 2.6.0
ldd show that they use the same libries.

I tried the following steps in order to produce such sed like knoppix(debian)'s:
1: configure
2: make && make check #this "make check" makes 4&&5's check almost the same
3: strip --strip-all sed/sed #seems that stripped binary is a bit faster
4: time make check
5: cp /bin/sed sed/sed && time make check #everything is the same except that the binary is the system's
I have tried knoppix's gcc-3.3.6, gcc-3.4.4,gcc-4.0.1,and the lfs book's gcc-4.0.2 several times with different CFLAGS and found that:
-O3 is a bit faster than knoppix's, but is much bigger(100+K after strip)
-O2's average time is almost the same as knoppix's, but the binary is 9xK after strip
-Os is much slower, and get 7xK binary


Could somebody tell me how to produce binaries as fast && small as main distributions?

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-chat
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to