[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
 directory:

 gcc -Wp,-MD,arch/x86/kernel/.tsc.o.d  -nostdinc -isystem
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/include
 -I/sources/linux-2.6.33.4-gcc45/arch/x86/include -Iinclude  -include
 include/generated/autoconf.h -D__KERNEL__ -Wall -Wundef -Wstrict-
 prototypes
 -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=1
 -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-
 sign
 -fno-strict-overflow -fno-dwarf2-cfi-asm -fconserve-stack -fno-stack-
 protector
  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(tsc)"
 -D"KBUILD_MODNAME=KBUILD_STR(tsc)"  -S -c -o arch/x86/kernel/tsc.S
 arch/x86/kernel/tsc.c

 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