Karim BELABAS on Sun, 2 Mar 2003 20:33:01 +0100 (MET)

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: linker warning

On Sun, 2 Mar 2003, Karim BELABAS wrote:
> On Mon, 3 Feb 2003, Igor Schein wrote:
>> when compiling CVS sources on Solaris 9 with Forte 7.0, I see this:
>> ld: warning: symbol `overflow' has differing types:
>>         (file mp.o type=OBJT; file kernel2.o type=NOTY);
>>         kernel2.o definition taken
>> ld: warning: symbol `hiremainder' has differing types:
>>         (file mp.o type=OBJT; file kernel2.o type=NOTY);
>>         kernel2.o definition taken
> Should be gone now. Please use 'cvs update -d', I have completely wrecked the
> sparcv8 assembler kernel !

Should have given more details:

1) there was a generic src/kernel/sparcv8/ directory containing both
MicroSparc and SuperSparc specific files (SuperSparc doesn't have
division...). I have split this into two directories, hence the 'update -d',
necessary to get the new directory structure.

I have removed the useless kernel/sparcv9/ directory.

2) there is a large amount of duplicated code in the sparc* directories, in
various guises, one of which used gcc inline assembler instructions. That
version used fixed registers as a convenient way of (mis)handling the "global
variables" hiremainder and overflow, used by the level0 kernel [ routines
returning, and operating on, words: addll, mulll, etc].

I have removed this hack so as to use the same assembler constructions
whether the compiler is gcc or not, and not clobber hardware registers for
no good purpose [ the resulting kernel is slightly faster now, btw, at least
on UltraSparc ].

I also have removed some of the code duplication, but didn't dare merging the
sparcv7 assembler yet, since I cannot test it.

3) As a matter of fact, now, hiremainder and overflow are no longer global in
any of the inline assembler kernels, the ones requiring gcc. The non-inline
assembler kernels still need to access these global variables [ and are
_very_ inefficient. gcc should really be used whenever an inline kernel is
available ]

4) These global symbols are still being defined and included in libpari in
case one uses different compilers when compiling the library and applications
[ a bad idea, but... ]. It's the level0 kernel's job to define them, and it
did that [ without using them, in some cases ].

These symbols were mistakenly redefined in kernel/none/mp.c and
kernel/gmp/mp.c.  Hence the linker's warning: two global symbols with the
same name had been defined, one through direct assembly with 'as', the other
through gcc's compilation of mp.c.

Karim Belabas                     Tel: (+33) (0)1 69 15 57 48
Dép. de Mathématiques, Bât. 425   Fax: (+33) (0)1 69 15 60 19
Université Paris-Sud              http://www.math.u-psud.fr/~belabas/
F-91405 Orsay (France)            http://www.parigp-home.de/  [PARI/GP]