Linux MIPS Architecture development
 help / color / mirror / Atom feed
* unresolved (soft)float symbols
@ 2005-01-13 14:08 Philippe De Swert
  2005-01-13 14:13 ` sjhill
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Philippe De Swert @ 2005-01-13 14:08 UTC (permalink / raw)
  To: linux-mips

Hello people,

I have a custom build module with some float operations in it. I build a
2.4.17 kernel for a mips32 core (BCM6348 chip). It boots up fine, busybox
works nicely, also some other apps like dropbear and thttpd do what they are
expected to do.

I build everything with soft-floats using a uclibc toolchain (kernel +
filesystem). This is the configuration of my toolchain.

~#mips-linux-gcc -v
Reading specs from
/vobs/linux/tools/3pp-build/gcc/../../mips/gcc/lib/gcc-lib/mips-linux-uclibc/3.3.4/specs
Configured with:
/vobs/linux/tools/3pp-build/gcc/toolchain_build_mips_nofpu/gcc-3.3.4/configure
--prefix=/vobs/linux/tools/3pp-build/gcc/../../mips/gcc
--build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=mips-linux-uclibc
--enable-languages=c,c++ --enable-shared --disable-__cxa_atexit
--enable-target-optspace --with-gnu-ld --disable-nls --enable-multilib
--without-float --enable-sjlj-exceptions
Thread model: posix
gcc driver version 3.3.4 executing gcc version 3.3.3

The module builds fine also, but when insmodding I get the following error.

insmod: unresolved symbol __fixdfsi
insmod: unresolved symbol __floatsidf
insmod: unresolved symbol __muldf3
insmod: unresolved symbol __adddf3

As these are all float operations I am wondering about the following things:

1.why they are in there? I have a soft-float toolchain....
2.Is there float support in the kernel? While googling for it I found a few
things talking about FP point in the kernel. Does it have something to do with
the Algorithmics/MIPS FPU emulator. (Although it does not work emulator or
not. Which I expected because it should only be used by apps which emit FPU
calls, and this should not happen because I use a softfloat toolchain). So I
expect it does not really have something to do with this.
3.I took care of using the same compiler options as the kernel compilation
uses. I guess this is the correct way, and the problems are thus not related
to this.

Any pointers to a solution would be helpful. I am trying woth a hard-float
toolchain now (it only takes a while to compile everything). I could also not
dig up anything similar in the archives.

Thank you,

Philippe 

| Philippe De Swert -GNU/linux - uClinux freak-      
|      
| Stag developer http://stag.mind.be/  
| Emdebian developer: http://www.emdebian.org  
|   
| Please do not send me documents in a closed format. (*.doc,*.xls,*.ppt)    
| Use the open alternatives. (*.pdf,*.ps,*.html,*.txt)    
| Why? http://pallieter.is-a-geek.org:7832/~johan/word/english/    

-------------------------------------------------------
NOTE! My email address is changing to ... @scarlet.be
Please make the necessary changes in your address book. 

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

* Re: unresolved (soft)float symbols
  2005-01-13 14:08 unresolved (soft)float symbols Philippe De Swert
@ 2005-01-13 14:13 ` sjhill
  2005-01-13 15:16 ` Ralf Baechle
  2005-01-13 17:17 ` David Daney
  2 siblings, 0 replies; 7+ messages in thread
From: sjhill @ 2005-01-13 14:13 UTC (permalink / raw)
  To: Philippe De Swert; +Cc: linux-mips

> The module builds fine also, but when insmodding I get the following error.
> 
> insmod: unresolved symbol __fixdfsi
> insmod: unresolved symbol __floatsidf
> insmod: unresolved symbol __muldf3
> insmod: unresolved symbol __adddf3
> 
This has nothing to do with floating point in the kernel. It does have
to do with your toolchain. My uClibc soft-float toolchains are a little
out of date, but you can see the exact steps I took to build the SWFP
toolchain for uClibc. Let us know how it goes.

-Steve

   ftp://ftp.realitydiluted.com/linux/MIPS/toolchains/uclibc-swfp

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

* Re: unresolved (soft)float symbols
  2005-01-13 14:08 unresolved (soft)float symbols Philippe De Swert
  2005-01-13 14:13 ` sjhill
@ 2005-01-13 15:16 ` Ralf Baechle
  2005-01-13 17:17 ` David Daney
  2 siblings, 0 replies; 7+ messages in thread
From: Ralf Baechle @ 2005-01-13 15:16 UTC (permalink / raw)
  To: Philippe De Swert; +Cc: linux-mips

On Thu, Jan 13, 2005 at 03:08:24PM +0100, Philippe De Swert wrote:

> The module builds fine also, but when insmodding I get the following error.
> 
> insmod: unresolved symbol __fixdfsi
> insmod: unresolved symbol __floatsidf
> insmod: unresolved symbol __muldf3
> insmod: unresolved symbol __adddf3
> 
> As these are all float operations I am wondering about the following things:
> 
> 1.why they are in there? I have a soft-float toolchain....

That's why they are there.

> 2.Is there float support in the kernel? While googling for it I found a few

Nothing whatsoever.

> things talking about FP point in the kernel. Does it have something to do with
> the Algorithmics/MIPS FPU emulator. (Although it does not work emulator or
> not. Which I expected because it should only be used by apps which emit FPU
> calls, and this should not happen because I use a softfloat toolchain). So I
> expect it does not really have something to do with this.
> 3.I took care of using the same compiler options as the kernel compilation
> uses. I guess this is the correct way, and the problems are thus not related
> to this.

The simple answer is no FP in the kernel.

  Ralf

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

* Re: unresolved (soft)float symbols
  2005-01-13 14:08 unresolved (soft)float symbols Philippe De Swert
  2005-01-13 14:13 ` sjhill
  2005-01-13 15:16 ` Ralf Baechle
@ 2005-01-13 17:17 ` David Daney
  2 siblings, 0 replies; 7+ messages in thread
From: David Daney @ 2005-01-13 17:17 UTC (permalink / raw)
  To: Philippe De Swert; +Cc: linux-mips

Philippe De Swert wrote:
> Hello people,
> 
> I have a custom build module with some float operations in it. I build a
> 2.4.17 kernel for a mips32 core (BCM6348 chip). It boots up fine, busybox
> works nicely, also some other apps like dropbear and thttpd do what they are
> expected to do.
> 
> I build everything with soft-floats using a uclibc toolchain (kernel +
> filesystem). This is the configuration of my toolchain.
> 
> ~#mips-linux-gcc -v
> Reading specs from
> /vobs/linux/tools/3pp-build/gcc/../../mips/gcc/lib/gcc-lib/mips-linux-uclibc/3.3.4/specs
> Configured with:
> /vobs/linux/tools/3pp-build/gcc/toolchain_build_mips_nofpu/gcc-3.3.4/configure
> --prefix=/vobs/linux/tools/3pp-build/gcc/../../mips/gcc
> --build=i386-pc-linux-gnu --host=i386-pc-linux-gnu --target=mips-linux-uclibc
> --enable-languages=c,c++ --enable-shared --disable-__cxa_atexit
> --enable-target-optspace --with-gnu-ld --disable-nls --enable-multilib
> --without-float --enable-sjlj-exceptions
> Thread model: posix
> gcc driver version 3.3.4 executing gcc version 3.3.3
> 
> The module builds fine also, but when insmodding I get the following error.
> 
> insmod: unresolved symbol __fixdfsi
> insmod: unresolved symbol __floatsidf
> insmod: unresolved symbol __muldf3
> insmod: unresolved symbol __adddf3
> 
> As these are all float operations I am wondering about the following things:
> 
> 1.why they are in there? I have a soft-float toolchain....
> 2.Is there float support in the kernel? While googling for it I found a few
> things talking about FP point in the kernel. Does it have something to do with
> the Algorithmics/MIPS FPU emulator. (Although it does not work emulator or
> not. Which I expected because it should only be used by apps which emit FPU
> calls, and this should not happen because I use a softfloat toolchain). So I
> expect it does not really have something to do with this.
> 3.I took care of using the same compiler options as the kernel compilation
> uses. I guess this is the correct way, and the problems are thus not related
> to this.
> 
> Any pointers to a solution would be helpful. I am trying woth a hard-float
> toolchain now (it only takes a while to compile everything). I could also not
> dig up anything similar in the archives.
> 

These symbols are defined in libgcc.a, however libgcc.a is normally
compiled with options that make it incompatible with kernel modules.

There is a trick I have played to work around this. If you do a normal gcc
build and then remove gcc/libgcc.a and the gcc/libgcc directory. You can
build a kernel compatible version by doing:

export LIBGCC2_DEBUG_CFLAGS='-g -G0 -mno-abicalls -fno-pic'
make

The resulting libgcc.a will be compatible with the kernel.  Rename it to
something like libgcckernel.a.

Now you can link the kernel module adding -lgcckernel and you should be
ready to go.

David Daney.

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

* Re: unresolved (soft)float symbols
@ 2005-01-14  9:34 Philippe De Swert
  0 siblings, 0 replies; 7+ messages in thread
From: Philippe De Swert @ 2005-01-14  9:34 UTC (permalink / raw)
  To: ralf; +Cc: linux-mips

Thank you all for the answers I got already,

> On Thu, Jan 13, 2005 at 03:08:24PM +0100, Philippe De Swert wrote:
> 
> > The module builds fine also, but when insmodding I get the following error.
> > 
> > insmod: unresolved symbol __fixdfsi
> > insmod: unresolved symbol __floatsidf
> > insmod: unresolved symbol __muldf3
> > insmod: unresolved symbol __adddf3
> > 
> > As these are all float operations I am wondering about the following things:
> > 
> > 1.why they are in there? I have a soft-float toolchain....
> 
> That's why they are there.

After looking further into it I found out that they are softfloat symbols and
that they should be in the libgcc.a of my toolchain. (David Daney confirmed
this, but I don't understand however how I am supposed to regenerate the
libgcc.a with his method. So David if you could tell me more about it. Is it
supposed to be build during the final gcc stages?) According to Steve I have a
faulty toolchain, after looking into his build method I cannot find anything
very different expect for the gxx-include-dir configuration option, but I
guess this is not causing the problem.

I found a toolchain that works, but I would prefer to have my own (with
sources) And I am trying to learn something here. So I am trying to understand
what is happening. Am I correct if the problem lies in the fact that libgcc.a
is putting/used to put in these symbols in the module. The kernel does not
understand these symbols because they are supposed to be userland only, so the
solution would be to have a libgcc.a which does not do that?

How do I generate one (or which is the specific thing I have to take care of
to avoid that the problem occurs)? Can I make my toolchain link against
something else?

Of course is this is not in the context of the mailing list I would appreciate
any pointers for a mips-toolchain mailing list.

> The simple answer is no FP in the kernel.

This is what I expected, but I got confused by some answers on other mailing
lists. But it is good to have a clear point.

Thank you,

Philippe
 
| Philippe De Swert -GNU/linux - uClinux freak-      
|      
| Stag developer http://stag.mind.be/  
| Emdebian developer: http://www.emdebian.org  
|   
| Please do not send me documents in a closed format. (*.doc,*.xls,*.ppt)    
| Use the open alternatives. (*.pdf,*.ps,*.html,*.txt)    
| Why? http://pallieter.is-a-geek.org:7832/~johan/word/english/    

-------------------------------------------------------
NOTE! My email address is changing to ... @scarlet.be
Please make the necessary changes in your address book. 

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

* Re: unresolved (soft)float symbols
@ 2005-01-14  9:45 Philippe De Swert
  2005-01-14  9:45 ` Philippe De Swert
  0 siblings, 1 reply; 7+ messages in thread
From: Philippe De Swert @ 2005-01-14  9:45 UTC (permalink / raw)
  Cc: linux-mips

Oeps I forgot to ask. Would it help if I linked it in statically with the
-static-libgcc option. I suppose these symbols will then be hard-coded in the
module binary itself. Or am I very wrong here...

Thanks,

Philippe
 
| Philippe De Swert    
|      
| Stag developer http://stag.mind.be/  
| Emdebian developer: http://www.emdebian.org  
|   
| Please do not send me documents in a closed format. (*.doc,*.xls,*.ppt)    
| Use the open alternatives. (*.pdf,*.ps,*.html,*.txt)    
| Why? http://pallieter.is-a-geek.org:7832/~johan/word/english/    

-------------------------------------------------------
NOTE! My email address is changing to ... @scarlet.be
Please make the necessary changes in your address book. 

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

* Re: unresolved (soft)float symbols
  2005-01-14  9:45 Philippe De Swert
@ 2005-01-14  9:45 ` Philippe De Swert
  0 siblings, 0 replies; 7+ messages in thread
From: Philippe De Swert @ 2005-01-14  9:45 UTC (permalink / raw)
  Cc: linux-mips

Oeps I forgot to ask. Would it help if I linked it in statically with the
-static-libgcc option. I suppose these symbols will then be hard-coded in the
module binary itself. Or am I very wrong here...

Thanks,

Philippe
 
| Philippe De Swert    
|      
| Stag developer http://stag.mind.be/  
| Emdebian developer: http://www.emdebian.org  
|   
| Please do not send me documents in a closed format. (*.doc,*.xls,*.ppt)    
| Use the open alternatives. (*.pdf,*.ps,*.html,*.txt)    
| Why? http://pallieter.is-a-geek.org:7832/~johan/word/english/    

-------------------------------------------------------
NOTE! My email address is changing to ... @scarlet.be
Please make the necessary changes in your address book. 

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

end of thread, other threads:[~2005-01-14  9:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-13 14:08 unresolved (soft)float symbols Philippe De Swert
2005-01-13 14:13 ` sjhill
2005-01-13 15:16 ` Ralf Baechle
2005-01-13 17:17 ` David Daney
  -- strict thread matches above, loose matches on Subject: below --
2005-01-14  9:34 Philippe De Swert
2005-01-14  9:45 Philippe De Swert
2005-01-14  9:45 ` Philippe De Swert

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