[LFS Trac] #2662: gcc 4.5.0 -Os does not generate correct code

LFS Trac trac at linuxfromscratch.org
Wed Jun 2 19:26:20 PDT 2010

#2662: gcc 4.5.0 -Os does not generate correct code
 Reporter:  bdubbs@…                     |       Owner:  bdubbs@…                   
     Type:  defect                       |      Status:  assigned                   
 Priority:  high                         |   Milestone:  6.7                        
Component:  Book                         |     Version:  SVN                        
 Severity:  major                        |    Keywords:                             

Comment(by bdubbs@…):

 Replying to [comment:7 hohoxu_hao115]:
 > I think this bug is hardware dependent.My kernel compiled by gcc-4.5 for
 x86_64,with or without size optimization,has no problems.

 Thanks for the feedback.  The obvious question is "Did it boot properly."
 The build normally completes, but the kernel panics upon boot.

 Can you post the results of `cat \proc\cpuinfo`

 It would also help if you could run the following from the kernel

 gcc -Wp,-MD,arch/x86/kernel/.tsc.o.d  -nostdinc -isystem
 -I/sources/linux- -Iinclude  -include
 include/generated/autoconf.h -D__KERNEL__ -Wall -Wundef -Wstrict-
 -Wno-trigraphs -fno-strict-aliasing -fno-common
 -Werror-implicit-function-declaration -Wno-format-security
 -fno-delete-null-pointer-checks -Os -m64 -march=core2 -mno-red-zone
 -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args
 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare
 -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
 -Wframe-larger-than=2048 -fno-stack-protector -fno-omit-frame-pointer
 -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-
 -fno-strict-overflow -fno-dwarf2-cfi-asm -fconserve-stack -fno-stack-
 -D"KBUILD_MODNAME=KBUILD_STR(tsc)"  -S -c -o arch/x86/kernel/tsc.S

 and post arch/x86/kernel/tsc.S as an attachment

 If you can check your log of the build, where arch/x86/kernel/tsc.c is
 built, does it match the above build string?

Ticket URL: <http://wiki.linuxfromscratch.org/lfs/ticket/2662#comment:8>
LFS Trac <http://wiki.linuxfromscratch.org/lfs/>
Linux From Scratch: Your Distro, Your Rules.

More information about the lfs-book mailing list