2002-04-03 08:57:13

by Robin Johnson

[permalink] [raw]
Subject: Bug in compiling

Greetings,

While mass compiling a new kernel for my slew of systems, I had an unusual
problem

gcc barfs and gives this huge error:
gcc -D__KERNEL__ -I/usr/src/linux-2.4.19-pre4-ac3/include -Wall
-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
-fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2
-march=i686 -DKBUILD_BASENAME=exec_domain -DEXPORT_SYMTAB -c
exec_domain.c
exec_domain.c:234: parse error before `register_exec_domain'
exec_domain.c:234: warning: type defaults to `int' in declaration of
`register_exec_domain'
exec_domain.c:234: `register_exec_domain' redeclared as different kind of
symbol
exec_domain.c:113: previous declaration of `register_exec_domain'
exec_domain.c:234: invalid initializer
exec_domain.c:234: warning: data definition has no type or storage class
exec_domain.c:234: parse error before `register_exec_domain'
exec_domain.c:234: warning: type defaults to `int' in declaration of
`register_exec_domain'
exec_domain.c:234: conflicting types for `register_exec_domain'
exec_domain.c:234: previous declaration of `register_exec_domain'
exec_domain.c:234: warning: excess elements in scalar initializer
exec_domain.c:234: warning: (near initialization for
`register_exec_domain')
exec_domain.c:234: parse error before `register_exec_domain'
exec_domain.c:234: warning: data definition has no type or storage class
exec_domain.c:235: parse error before `unregister_exec_domain'
exec_domain.c:235: warning: type defaults to `int' in declaration of
`unregister_exec_domain'
exec_domain.c:235: `unregister_exec_domain' redeclared as different kind
of symbol
exec_domain.c:140: previous declaration of `unregister_exec_domain'
exec_domain.c:235: invalid initializer
exec_domain.c:235: warning: data definition has no type or storage class
exec_domain.c:235: parse error before `unregister_exec_domain'
exec_domain.c:235: warning: type defaults to `int' in declaration of
`unregister_exec_domain'
exec_domain.c:235: conflicting types for `unregister_exec_domain'
exec_domain.c:235: previous declaration of `unregister_exec_domain'
exec_domain.c:235: warning: excess elements in scalar initializer
exec_domain.c:235: warning: (near initialization for
`unregister_exec_domain')
exec_domain.c:235: parse error before `unregister_exec_domain'
exec_domain.c:235: warning: data definition has no type or storage class
exec_domain.c:236: parse error before `__set_personality'
exec_domain.c:236: warning: type defaults to `int' in declaration of
`__set_personality'
exec_domain.c:236: `__set_personality' redeclared as different kind of
symbol
exec_domain.c:161: previous declaration of `__set_personality'
exec_domain.c:236: invalid initializer
exec_domain.c:236: warning: data definition has no type or storage class
exec_domain.c:236: parse error before `__set_personality'
exec_domain.c:236: warning: type defaults to `int' in declaration of
`__set_personality'
exec_domain.c:236: conflicting types for `__set_personality'
exec_domain.c:236: previous declaration of `__set_personality'
exec_domain.c:236: warning: excess elements in scalar initializer
exec_domain.c:236: warning: (near initialization for `__set_personality')
exec_domain.c:236: parse error before `__set_personality'
exec_domain.c:236: warning: data definition has no type or storage class
exec_domain.c:287: parse error before `abi_defhandler_coff'
exec_domain.c:287: warning: type defaults to `int' in declaration of
`abi_defhandler_coff'
exec_domain.c:287: conflicting types for `abi_defhandler_coff'
exec_domain.c:249: previous declaration of `abi_defhandler_coff'
exec_domain.c:287: invalid initializer
exec_domain.c:287: warning: data definition has no type or storage class
exec_domain.c:287: parse error before `abi_defhandler_coff'
exec_domain.c:287: warning: type defaults to `int' in declaration of
`abi_defhandler_coff'
exec_domain.c:287: conflicting types for `abi_defhandler_coff'
exec_domain.c:287: previous declaration of `abi_defhandler_coff'
exec_domain.c:287: warning: excess elements in scalar initializer
exec_domain.c:287: warning: (near initialization for
`abi_defhandler_coff')
exec_domain.c:287: parse error before `abi_defhandler_coff'
exec_domain.c:287: warning: data definition has no type or storage class
exec_domain.c:288: parse error before `abi_defhandler_elf'
exec_domain.c:288: warning: type defaults to `int' in declaration of
`abi_defhandler_elf'
exec_domain.c:288: conflicting types for `abi_defhandler_elf'
exec_domain.c:250: previous declaration of `abi_defhandler_elf'
exec_domain.c:288: invalid initializer
exec_domain.c:288: warning: data definition has no type or storage class
exec_domain.c:288: parse error before `abi_defhandler_elf'
exec_domain.c:288: warning: type defaults to `int' in declaration of
`abi_defhandler_elf'
exec_domain.c:288: conflicting types for `abi_defhandler_elf'
exec_domain.c:288: previous declaration of `abi_defhandler_elf'
exec_domain.c:288: warning: excess elements in scalar initializer
exec_domain.c:288: warning: (near initialization for `abi_defhandler_elf')
exec_domain.c:288: parse error before `abi_defhandler_elf'
exec_domain.c:288: warning: data definition has no type or storage class
exec_domain.c:289: parse error before `abi_defhandler_lcall7'
exec_domain.c:289: warning: type defaults to `int' in declaration of
`abi_defhandler_lcall7'
exec_domain.c:289: conflicting types for `abi_defhandler_lcall7'
exec_domain.c:251: previous declaration of `abi_defhandler_lcall7'
exec_domain.c:289: invalid initializer
exec_domain.c:289: warning: data definition has no type or storage class
exec_domain.c:289: parse error before `abi_defhandler_lcall7'
exec_domain.c:289: warning: type defaults to `int' in declaration of
`abi_defhandler_lcall7'
exec_domain.c:289: conflicting types for `abi_defhandler_lcall7'
exec_domain.c:289: previous declaration of `abi_defhandler_lcall7'
exec_domain.c:289: warning: excess elements in scalar initializer
exec_domain.c:289: warning: (near initialization for
`abi_defhandler_lcall7')
exec_domain.c:289: parse error before `abi_defhandler_lcall7'
exec_domain.c:289: warning: data definition has no type or storage class
exec_domain.c:290: parse error before `abi_defhandler_libcso'
exec_domain.c:290: warning: type defaults to `int' in declaration of
`abi_defhandler_libcso'
exec_domain.c:290: conflicting types for `abi_defhandler_libcso'
exec_domain.c:252: previous declaration of `abi_defhandler_libcso'
exec_domain.c:290: invalid initializer
exec_domain.c:290: warning: data definition has no type or storage class
exec_domain.c:290: parse error before `abi_defhandler_libcso'
exec_domain.c:290: warning: type defaults to `int' in declaration of
`abi_defhandler_libcso'
exec_domain.c:290: conflicting types for `abi_defhandler_libcso'
exec_domain.c:290: previous declaration of `abi_defhandler_libcso'
exec_domain.c:290: warning: excess elements in scalar initializer
exec_domain.c:290: warning: (near initialization for
`abi_defhandler_libcso')
exec_domain.c:290: parse error before `abi_defhandler_libcso'
exec_domain.c:290: warning: data definition has no type or storage class
exec_domain.c:291: parse error before `abi_traceflg'
exec_domain.c:291: warning: type defaults to `int' in declaration of
`abi_traceflg'
exec_domain.c:291: conflicting types for `abi_traceflg'
exec_domain.c:253: previous declaration of `abi_traceflg'
exec_domain.c:291: invalid initializer
exec_domain.c:291: warning: data definition has no type or storage class
exec_domain.c:291: parse error before `abi_traceflg'
exec_domain.c:291: warning: type defaults to `int' in declaration of
`abi_traceflg'
exec_domain.c:291: conflicting types for `abi_traceflg'
exec_domain.c:291: previous declaration of `abi_traceflg'
exec_domain.c:291: warning: excess elements in scalar initializer
exec_domain.c:291: warning: (near initialization for `abi_traceflg')
exec_domain.c:291: parse error before `abi_traceflg'
exec_domain.c:291: warning: data definition has no type or storage class
exec_domain.c:292: parse error before `abi_fake_utsname'
exec_domain.c:292: warning: type defaults to `int' in declaration of
`abi_fake_utsname'
exec_domain.c:292: conflicting types for `abi_fake_utsname'
exec_domain.c:254: previous declaration of `abi_fake_utsname'
exec_domain.c:292: invalid initializer
exec_domain.c:292: warning: data definition has no type or storage class
exec_domain.c:292: parse error before `abi_fake_utsname'
exec_domain.c:292: warning: type defaults to `int' in declaration of
`abi_fake_utsname'
exec_domain.c:292: conflicting types for `abi_fake_utsname'
exec_domain.c:292: previous declaration of `abi_fake_utsname'
exec_domain.c:292: warning: excess elements in scalar initializer
exec_domain.c:292: warning: (near initialization for `abi_fake_utsname')
exec_domain.c:292: parse error before `abi_fake_utsname'
exec_domain.c:292: warning: data definition has no type or storage class
{standard input}: Assembler messages:
{standard input}:691: Error: symbol `register_exec_domain' is already
defined
{standard input}:697: Error: symbol `unregister_exec_domain' is already
defined
{standard input}:703: Error: symbol `__set_personality' is already defined

Now I know the exact source compiled and booted perfectly already. All I
did was tar up my source tree, and copy it to another system. It was on
/root/kern3/linux-2.4.19-pre4-ac3 on the first system, and
/usr/src/linux-2.4.19-pre4-ac3 on the second system. I ran 'make
distclean', copied in the config file, which is almost identical, ran
'make oldconfig dep bzImage'. Then in compiling kernel/exec_domain.c I get
that massive set of error messages that don't make sense at all, as they
have compiled perfectly only 20 minutes before.

Any ideas?

Please CC your replies, as I am not subscrided to the list.

--
Robin Hugh Johnson
E-Mail : [email protected]
Home Page : http://www.orbis-terrarum.net/?l=people.robbat2
ICQ# : 30269588


2002-04-03 11:17:17

by Keith Owens

[permalink] [raw]
Subject: Re: Bug in compiling

On Wed, 3 Apr 2002 00:57:06 -0800 (PST),
Robin Johnson <[email protected]> wrote:
>While mass compiling a new kernel for my slew of systems, I had an unusual
>problem
>
>gcc barfs and gives this huge error:
>gcc -D__KERNEL__ -I/usr/src/linux-2.4.19-pre4-ac3/include -Wall
>-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
>-fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2
>-march=i686 -DKBUILD_BASENAME=exec_domain -DEXPORT_SYMTAB -c
>exec_domain.c
>exec_domain.c:234: parse error before `register_exec_domain'
>exec_domain.c:235: parse error before `unregister_exec_domain'
>exec_domain.c:236: parse error before `__set_personality'
>exec_domain.c:287: parse error before `abi_defhandler_coff'
>...

All EXPORT_SYMBOL. You would get that behaviour if gcc did not
recognise EXPORT_SYMBOL as a macro. Probably random data corruption.

2002-04-04 05:34:07

by Robin Johnson

[permalink] [raw]
Subject: Re: Bug in compiling

On Wed, 3 Apr 2002, Keith Owens wrote:
> On Wed, 3 Apr 2002 00:57:06 -0800 (PST),
> Robin Johnson <[email protected]> wrote:
> >While mass compiling a new kernel for my slew of systems, I had an unusual
> >problem
> >
> >gcc barfs and gives this huge error:
> >gcc -D__KERNEL__ -I/usr/src/linux-2.4.19-pre4-ac3/include -Wall
> >-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
> >-fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2
> >-march=i686 -DKBUILD_BASENAME=exec_domain -DEXPORT_SYMTAB -c
> >exec_domain.c
> >exec_domain.c:234: parse error before `register_exec_domain'
> >exec_domain.c:235: parse error before `unregister_exec_domain'
> >exec_domain.c:236: parse error before `__set_personality'
> >exec_domain.c:287: parse error before `abi_defhandler_coff'
> >...
>
> All EXPORT_SYMBOL. You would get that behaviour if gcc did not
> recognise EXPORT_SYMBOL as a macro. Probably random data corruption.
Of the pair of machines, I upgraded one of them to GCC 3.0.4, while
leaving the other at 2.95.3.

The identical source and config file compiles fine on the one, but not on
the other. It gives that exec_domain slew.c of errors.

So is this a GCC bug that I have located, or something more with the
kernel?, as Documentation/Changes lists GCC 2.95.3 at the minimal version
required.

I would like to avoid the GCC3 tree as it stands presently, as I have some
C++ code that can not be ported at this time to work with GCC3, and only
works with GCC2.95.3.

Any ideas?

Thanks in advance.

(Again, please CC replies to me as I am not subscribed to the list.)

--
Robin Hugh Johnson
E-Mail : [email protected]
Home Page : http://www.orbis-terrarum.net/?l=people.robbat2
ICQ# : 30269588 or 41961639

2002-04-04 07:05:45

by Keith Owens

[permalink] [raw]
Subject: Re: Bug in compiling

On Wed, 3 Apr 2002 21:34:59 -0800 (PST),
Robin Johnson <[email protected]> wrote:
>On Wed, 3 Apr 2002, Keith Owens wrote:
>> On Wed, 3 Apr 2002 00:57:06 -0800 (PST),
>> Robin Johnson <[email protected]> wrote:
>> >gcc -D__KERNEL__ -I/usr/src/linux-2.4.19-pre4-ac3/include -Wall
>> >-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
>> >-fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2
>> >-march=i686 -DKBUILD_BASENAME=exec_domain -DEXPORT_SYMTAB -c
>> >exec_domain.c
>> >exec_domain.c:234: parse error before `register_exec_domain'
>> >exec_domain.c:235: parse error before `unregister_exec_domain'
>> >exec_domain.c:236: parse error before `__set_personality'
>> >exec_domain.c:287: parse error before `abi_defhandler_coff'
>> >...
>>
>> All EXPORT_SYMBOL. You would get that behaviour if gcc did not
>> recognise EXPORT_SYMBOL as a macro. Probably random data corruption.
>Of the pair of machines, I upgraded one of them to GCC 3.0.4, while
>leaving the other at 2.95.3.

On the failing system,

cd /usr/src/linux-2.4.19-pre4-ac3/kernel
gcc -D__KERNEL__ -I/usr/src/linux-2.4.19-pre4-ac3/include -Wall \
-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer \
-fno-strict-aliasing -fno-common -pipe \
-mpreferred-stack-boundary=2 -march=i686 \
-DKBUILD_BASENAME=exec_domain -DEXPORT_SYMTAB \
-E -c exec_domain.c -o exec_domain.i

and send exec_domain.i to [email protected] (not the list).