The linux kernel doesn't build anymore with gcc version 4.4.0 20080826

The problem seems to be that one extern variable (kallsyms_token_index)
declared with  __attribute__((weak)) does not get a ".weak" in the assembler
output
anymore (compared the gcc 4.3)

I attached a preprocessed test case.

Build options:
-Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing
-fno-common -Werror-implicit-function-declaration -Os -m64 -mtune=generic
-mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -pipe
-Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2
-mno-3dnow -Iinclude/asm-x86/mach-default -Wframe-larger-than=2048
-fno-stack-protector -fomit-frame-pointer --param large-stack-frame=100 --param
large-stack-frame-growth=100 -Wdeclaration-after-statement -Wno-pointer-sign
-fverbose-asm

Built with gcc43:

% grep kallsyms_token_index kernel/kallsyms.s
 movzwl  kallsyms_token_index(%rax,%rax), %eax   # kallsyms_token_index, tmp118
        movzwl  kallsyms_token_index(%rax,%rax), %eax   # kallsyms_token_index,
tmp124
        movzwl  kallsyms_token_index(%rax,%rax), %eax   # kallsyms_token_index,
tmp105
        movzwl  kallsyms_token_index(%rax,%rax), %eax   # kallsyms_token_index,
tmp102
        movzwl  kallsyms_token_index(%rax,%rax), %eax   # kallsyms_token_index,
tmp106
        movzwl  kallsyms_token_index(%rax,%rax), %eax   # kallsyms_token_index,
tmp93
        .weak   kallsyms_token_index


With 4.4:
  movzwl  kallsyms_token_index(%rdx,%rdx), %edx   # kallsyms_token_index,
tmp116
        movzwl  kallsyms_token_index(%rdi,%rdi), %edi   # kallsyms_token_index,
tmp122
        movzwl  kallsyms_token_index(%rdx,%rdx), %edx   # kallsyms_token_index,
tmp103
        movzwl  kallsyms_token_index(%rdx,%rdx), %edx   # kallsyms_token_index,
tmp100
        movzwl  kallsyms_token_index(%rcx,%rcx), %ecx   # kallsyms_token_index,
tmp103
        movzwl  kallsyms_token_index(%rcx,%rcx), %ecx   # kallsyms_token_index,
tmp91


Note no ".weak" in the second case. This breaks the build because it relies
on this symbol being weak on the first link pass.


-- 
           Summary: weak symbol regression breaks linux kernel
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ak at muc dot de
  GCC host triplet: x86_64-linux
GCC target triplet: x86_64-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37280

Reply via email to