public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* gcc 3.4.6 fails to build 2.6.25 due to offsetof() not digestible by gas
@ 2008-05-01  5:07 sampo
  2008-05-01 12:06 ` Adrian Bunk
  0 siblings, 1 reply; 21+ messages in thread
From: sampo @ 2008-05-01  5:07 UTC (permalink / raw)
  To: linux-kbuild; +Cc: sampo

Platform: x86
Compiler: gcc-3.4.6
Binutils: 2.17.50.0.8
Kernel under build: 2.6.25 (from kernel.org)

Problem: Build fails due to incompatibility of asm-offsets.h with
assembler. See below:

gcc -Wp,-MD,arch/x86/kernel/.entry_32.o.d  -nostdinc -isystem
/apps/gcc/3.4.6/lib/gcc/i686-pc-linux-gnu/3.4.6/include -D__KERNEL__
-Iinclude  -include include/linux/autoconf.h -D__ASSEMBLY__ -m32
-DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1
-Iinclude/asm-x86/mach-default     -c -o arch/x86/kernel/entry_32.o
arch/x86/kernel/entry_32.S
include/asm/asm-offsets.h: Assembler messages:
include/asm/asm-offsets.h:10: Error: invalid character '_' in mnemonic
include/asm/asm-offsets.h:11: Error: invalid character '_' in mnemonic
include/asm/asm-offsets.h:12: Error: invalid character '_' in mnemonic
include/asm/asm-offsets.h:13: Error: invalid character '_' in mnemonic
include/asm/asm-offsets.h:14: Error: invalid character '_' in mnemonic
include/asm/asm-offsets.h:15: Error: invalid character '_' in mnemonic
(snip - much more of the same)

Analysis:

1. All errors are related to use of offsetof() macro. The asm-offsets.h
   contains lines like

     IA32_SIGCONTEXT_ax $44 offsetof(struct sigcontext, ax)	#

2. offsetof() macro is defined in include/linux/stddef.h. It appears
   to rely on __compiler_offsetof() which maps to __builtin_offsetof()
   on gcc-4.x, but on gcc-3.4.6 the definition is as follows

     #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)

   I believe this C syntax is what is causing indigestion to gas.

3. The compilation can be forced to proceed bit further by
   adding to beginning of .S files #define __ASM_OFFSETS_H__
   which prevents the problematic include from being included.
   However, some .S files actually need the definitions.

4. In Documentation/Changes file the compiler requirement is
   documented as gcc-3.2. Therefore it seems reasonable to expect
   gcc-3.4.6 to work.

5. Last time I compiled kernel was 2.6.23.9. Back then this
   problem did not exist. The toolchain is the same as used back then.

6. googling did not return any enlightening entries, thus I presume
   this problem has not been reported yet.

Cheers,
--Sampo



^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2008-05-02 11:05 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-01  5:07 gcc 3.4.6 fails to build 2.6.25 due to offsetof() not digestible by gas sampo
2008-05-01 12:06 ` Adrian Bunk
2008-05-01 15:05   ` sampo
2008-05-01 16:34     ` Adrian Bunk
2008-05-01 16:38       ` sampo
2008-05-01 16:53         ` Adrian Bunk
2008-05-01 17:10           ` sampo
2008-05-01 18:53             ` `sed`ing asm-offsets (Re: gcc 3.4.6 fails to build 2.6.25 due to offsetof() not digestible by gas) Oleg Verych
2008-05-01 21:42               ` Sam Ravnborg
2008-05-01 21:52                 ` Oleg Verych
2008-05-01 22:54                 ` Oleg Verych
2008-05-01 19:17             ` gcc 3.4.6 fails to build 2.6.25 due to offsetof() not digestible by gas Adrian Bunk
2008-05-01 21:39               ` Sam Ravnborg
2008-05-01 22:07                 ` Adrian Bunk
2008-05-02  0:53                   ` sampo
2008-05-02  1:48                     ` Oleg Verych
2008-05-02  6:08                       ` Sam Ravnborg
2008-05-02 10:56                         ` Oleg Verych
2008-05-02 10:42                           ` Sam Ravnborg
2008-05-02 11:25                             ` source processing-friendly scripting Oleg Verych
2008-05-02  6:06                     ` gcc 3.4.6 fails to build 2.6.25 due to offsetof() not digestible by gas Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox