Hi! On 11:36 Wed 12 May , Venkatram Tummala wrote: > Hey All, > > This question has been asked before but no complete solution was given. > > > Is there any way to build a completely debug kernel as opposed to a release > kernel.? Is yes, how can i do that.? > > Basically i need to disable all (or as many as possible) compile time > optimizations. I tried disabling the O3 flag & i was able to successfully > able to get the vmlinux file (after disabling many compile time options & > drivers which were failing without the O3 flag). But when I tried to boot > this kernel, the kernel hung during startup. Linux kernel is compiled with -O3? Where do you see this? Usually the kernel is compiled with -O2 and tons of flags to disable some optimisations. There is alsa a make config option to compile with -Os. > I think there are some files in the kernel source which MUST be compiled > with the O3 flag. Does anybody have a list of such files. If yes, we can > write a wrapper around the kernel makefile to build these files with the O3 > flag, others without the O3 flag and then "stitch" these up to get vmlinux. I do not want to negate this possibility, but this sounds very weird and unstable when using different gcc versions. Besides grep -r "\-O3" ./ does not find anything. Besides, there are even reports [1] that -O3 might be broken in some cases > the problem is gdb goes haywire with these compile time optimizations & it > is a pain in the neck to debug these kernels. What does gdb do? Note that if you start user mode linux in gdb, you will see segfaults in "page_ok". These are harmless, just type "cont", until startup is completed. -Michi [1] http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#book_part1_chap5 see 5.d/"CFLAGS and CXXFLAGS" -- programing a layer 3+4 network protocol for mesh networks see http://michaelblizek.twilightparadox.com -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ