From mboxrd@z Thu Jan 1 00:00:00 1970 From: greg@kroah.com (Greg KH) Date: Tue, 2 Dec 2014 20:15:26 -0800 Subject: Huge difference in build sizes In-Reply-To: <547E89F2.30803@cdac.in> References: <547D818B.7090307@cdac.in> <20141202181604.GA15869@kroah.com> <547E89F2.30803@cdac.in> Message-ID: <20141203041526.GA5583@kroah.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Wed, Dec 03, 2014 at 09:26:34AM +0530, Raghavendra wrote: > Hello Greg, > > Thank you for the reply. > > On Tuesday 02 December 2014 11:46 PM, Greg KH wrote: > >On Tue, Dec 02, 2014 at 02:38:27PM +0530, Raghavendra wrote: > >>Hello all, > >> > >>I am using Ubuntu-12.04 which came with 3.2 kernel. Parallel to this, > >>I've compiled and installed 3.12.1 kernel using the Ubuntu-3.2's > >>configuration, and the compiler which came with the distro. I've noticed > >>that there is a huge difference in the size of the .ko file between the > >>Ubuntu's kernel and the kernel which I've compiled. Sample results are : > >> > >>$ du -sh usb-storage.ko > >>It shows : 56K for the Ubuntu's 3.2 kernel > >> 1.3M for the custom kernel that I've compiled > >> > >>I've tested the same thing for a simple hello world module : > >>$ du -sh hello.ko > >>It shows : 4.0k for the Ubuntu's 3.2 kernel > >> 56k for the custom kernel that I've compiled > >> > >>What could be the reason for this huge amount of difference of storage > >>space in spite of using the same config file and compiler? > >You have not "stripped" the debug symbols from the kernel you built, > >which is what Ubuntu does as part of their build process. I suggest > >turning off that kernel configuration option, as it's probably not > >needed for your development. > If you are referring to the option "CONFIG_DEBUG_INFO", then it is said to > 'y' in both the kernel's configuration files. > Is there any other config. option or compiler flags that I need to look for? That's a good one to turn off, start with that and see what happens.