Author Topic: Compile Error On Float Point Problem  (Read 4133 times)

wellswang

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
    • http://wells.osall.com
Compile Error On Float Point Problem
« on: March 06, 2007, 12:48:58 am »
I want to re-compile Justreader for hacking some code,
but when 'make' to this process:

Code: [Select]
g++  -o dist/usr/lib/qt/bin/justreader TextReader.o main.o FileDialog.o SettingsDlg.o ColorComboBox.o SelectKeyButton.o toUnicode.o Bookmarks.o Stream.o StreamHTML.o StreamTXT.o StreamPlucker.o StreamPalmDoc.o StreamPalmTXT.o StreamPalmHTML.o StreamPalmMP.o Frame.o IntDict.o Control.o dictionary.o file.o shc.o shcm.o utf8.o Unzip.o unzip.o makedoc9.o Palm2QImage.o config.o moc_TextReader.o moc_FileDialog.o moc_SettingsDlg.o moc_ColorComboBox.o moc_SelectKeyButton.o moc_Bookmarks.o moc_Control.o   -Wl,-rpath,/mnt/zgcc/qt3//lib -L/mnt/zgcc/qt3//lib -L/opt/arm/3.3.2/armv5tel-cacko-linux/X11R6/lib -lqt-mt -lXext -lX11 -lm -Wl,-rpath-link,/opt/arm/3.3.2/armv5tel-cacko-linux/X11R6/lib
i got many error messages like below one:

Code: [Select]
/opt/native/arm/3.4.6-xscale-softvfp/lib/gcc/armv5tel-cacko-linux/3.4.6/../../../../armv5tel-cacko-linux/bin/ld: ERROR: TextReader.o uses FPA instructions, whereas dist/usr/lib/qt/bin/justreader does not
but i've add -msoft-float parameter to gcc ,
it doesnot work ...

my gcc parameter is :
Code: [Select]
CFLAGS   = -pipe -Wall -W -O2 -fomit-frame-pointer -mcpu=iwmmxt -mtune=iwmmxt  -D__FOR_QT__ -DQT_NO_DEBUG -DQT_SHARED -DQT_THREAD_SUPPORT -msoft-float
CXXFLAGS = -pipe -Wall -W -O2 -fomit-frame-pointer -mcpu=iwmmxt -mtune=iwmmxt -fno-exceptions -fno-rtti  -D__FOR_QT__ -DQT_NO_DEBUG -DQT_SHARED -DQT_THREAD_SUPPORT -msoft-float

I am using gcc 3.4.6 from pdaXrom_1.1.0beta3  official feed

Anybody can help me ?
Thanks.

--wells.

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Compile Error On Float Point Problem
« Reply #1 on: March 06, 2007, 01:05:47 am »
Quote
I want to re-compile Justreader for hacking some code,
but when 'make' to this process:

Code: [Select]
g++  -o dist/usr/lib/qt/bin/justreader TextReader.o main.o FileDialog.o SettingsDlg.o ColorComboBox.o SelectKeyButton.o toUnicode.o Bookmarks.o Stream.o StreamHTML.o StreamTXT.o StreamPlucker.o StreamPalmDoc.o StreamPalmTXT.o StreamPalmHTML.o StreamPalmMP.o Frame.o IntDict.o Control.o dictionary.o file.o shc.o shcm.o utf8.o Unzip.o unzip.o makedoc9.o Palm2QImage.o config.o moc_TextReader.o moc_FileDialog.o moc_SettingsDlg.o moc_ColorComboBox.o moc_SelectKeyButton.o moc_Bookmarks.o moc_Control.o   -Wl,-rpath,/mnt/zgcc/qt3//lib -L/mnt/zgcc/qt3//lib -L/opt/arm/3.3.2/armv5tel-cacko-linux/X11R6/lib -lqt-mt -lXext -lX11 -lm -Wl,-rpath-link,/opt/arm/3.3.2/armv5tel-cacko-linux/X11R6/lib
i got many error messages like below one:

Code: [Select]
/opt/native/arm/3.4.6-xscale-softvfp/lib/gcc/armv5tel-cacko-linux/3.4.6/../../../../armv5tel-cacko-linux/bin/ld: ERROR: TextReader.o uses FPA instructions, whereas dist/usr/lib/qt/bin/justreader does not
but i've add -msoft-float parameter to gcc ,
it doesnot work ...

my gcc parameter is :
Code: [Select]
CFLAGS   = -pipe -Wall -W -O2 -fomit-frame-pointer -mcpu=iwmmxt -mtune=iwmmxt  -D__FOR_QT__ -DQT_NO_DEBUG -DQT_SHARED -DQT_THREAD_SUPPORT -msoft-float
CXXFLAGS = -pipe -Wall -W -O2 -fomit-frame-pointer -mcpu=iwmmxt -mtune=iwmmxt -fno-exceptions -fno-rtti  -D__FOR_QT__ -DQT_NO_DEBUG -DQT_SHARED -DQT_THREAD_SUPPORT -msoft-float

I am using gcc 3.4.6 from pdaXrom_1.1.0beta3  official feed

Anybody can help me ?
Thanks.

--wells.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=155502\"][{POST_SNAPBACK}][/a][/div]

you can't add -msoft-float as it conflicts with the pdaXrom gcc toolchain which has been compiled with soft-vfp and you cannot mix the two.
also, it looks strange that you are linking in files from /mnt/zgcc/qt3/lib while rpathing /opt/arm/3.3.2/armv5tel-cacko-linux/X11R6/lib

I recommend you to use my customized zgcc-3.4.6.squashfs instead. it can build justreader just fine with just qmake justreader.pro followed by make
only difference is that my specs file uses xscale instead iwmmxt for the mcpu and mtune flags, but you can easily change that
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

wellswang

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
    • http://wells.osall.com
Compile Error On Float Point Problem
« Reply #2 on: March 06, 2007, 01:31:20 am »
thanks, meanie~

I will try it again.

-wells.

radiochickenwax

  • Full Member
  • ***
  • Posts: 158
    • View Profile
Compile Error On Float Point Problem
« Reply #3 on: March 06, 2007, 07:43:56 pm »
Quote
you can't add -msoft-float as it conflicts with the pdaXrom gcc toolchain which has been compiled with soft-vfp and you cannot mix the two.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=155505\"][{POST_SNAPBACK}][/a][/div]


Well, I've asked this before and gotten no response, but I can't help asking again:

How can one replace the gcc-toolchain?  I've recompiled gcc with this option enabled, (to try to use fortran natively) but it's really unstable.  It compiles some stuff, but not others, and most problems come at the linking stage. (similar to the original post).  I guess this isn't really the forum for this kind of question, but I'd really like to hear what anyone has to say in this regard.

Would replacing libgcc with the altered floating point calculators necessitate a whole new rom?  I realize I'm out of my depth here, but I don't intend to stay there.  I really  want to get fortran working natively.
« Last Edit: March 06, 2007, 07:51:27 pm by radiochickenwax »
ZAURII:    sl-6000 : (temporarily) bricked pdaxrom b1   ||   sl-c3200 : yonggun/Debian-EABI
OTHERS:  htc-excalibur,  axim x5,  ipaq 4355, (still trying to find useable linux setups)
thinking about gumstix to replace/augment zaurus

Ikkakujyu

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • http://ikkakujyu.googlepages.com
Compile Error On Float Point Problem
« Reply #4 on: March 07, 2007, 03:30:35 am »
Quote
Would replacing libgcc with the altered floating point calculators necessitate a whole new rom?  I realize I'm out of my depth here, but I don't intend to stay there.  I really  want to get fortran working natively.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=155618\"][{POST_SNAPBACK}][/a][/div]

As has been stated, you can't mix floating point implementations, so you'd have to rebuild the entire system.

Of course, EABI allows you to mix-and-match... just, you -still- need to recompile the whole system to be EABI aware :/
Etched Marble Experiment - pushing the Zaurus to its limit - blog - wiki

radiochickenwax

  • Full Member
  • ***
  • Posts: 158
    • View Profile
Compile Error On Float Point Problem
« Reply #5 on: March 12, 2007, 09:07:12 pm »
Quote
Quote
Would replacing libgcc with the altered floating point calculators necessitate a whole new rom?  I realize I'm out of my depth here, but I don't intend to stay there.  I really  want to get fortran working natively.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=155618\"][{POST_SNAPBACK}][/a][/div]

As has been stated, you can't mix floating point implementations, so you'd have to rebuild the entire system.

Of course, EABI allows you to mix-and-match... just, you -still- need to recompile the whole system to be EABI aware :/
[div align=\"right\"][a href=\"index.php?act=findpost&pid=155639\"][{POST_SNAPBACK}][/a][/div]

(Realizing my earlier post was a little unclear).

Yes, altered floating-point implementations would need a new "libc" and all programs would need to be aware of this,  but what about the plain old "libgcc" which is all I'm trying to replace?  

I'm not really interested in changing the floating-point implementation (yet).  I just want a new gcc-toolchain. I find it difficult to believe that rebuilding the same toolchain that the existing ROM uses with support for additional languages should need a whole new ROM.

I just want a system that runs fortran natively.  The compilation of g77 is reasonably  straight-forward, but the resulting library (libgcc) is not. (at least to me).  

It took me a long time of playing around on an already slow machine just to get the gcc  toolchain's source-code to build.  Maybe I didn't give it enough of a chance.
« Last Edit: March 12, 2007, 09:09:39 pm by radiochickenwax »
ZAURII:    sl-6000 : (temporarily) bricked pdaxrom b1   ||   sl-c3200 : yonggun/Debian-EABI
OTHERS:  htc-excalibur,  axim x5,  ipaq 4355, (still trying to find useable linux setups)
thinking about gumstix to replace/augment zaurus

Ikkakujyu

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • http://ikkakujyu.googlepages.com
Compile Error On Float Point Problem
« Reply #6 on: March 12, 2007, 10:20:39 pm »
Quote
It took me a long time of playing around on an already slow machine just to get the gcc  toolchain's source-code to build.  Maybe I didn't give it enough of a chance.
[div align=\"right\"][{POST_SNAPBACK}][/a][/div]

The [a href=\"http://www.linuxfromscratch.org/lfs/view/stable/]Linux From Scratch[/url] project has notes on building an entire toolchain, you should read up on it. It shouldn't be too different to adapt to the 3.6 GCC. If it doesn't work, try to find the archived older versions.

It's a long process to get it right - you have to build GCC, use that to build Glibc, then rebuild GCC to link against the newly-created Glibc. Since pdaXrom already has Glibc built, you can probably skip most of that.

Read up on the whole thing, though - it's pretty enlightening.
Etched Marble Experiment - pushing the Zaurus to its limit - blog - wiki

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Compile Error On Float Point Problem
« Reply #7 on: March 13, 2007, 04:19:18 am »
Quote
Quote
Quote
Would replacing libgcc with the altered floating point calculators necessitate a whole new rom?  I realize I'm out of my depth here, but I don't intend to stay there.  I really  want to get fortran working natively.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=155618\"][{POST_SNAPBACK}][/a][/div]

As has been stated, you can't mix floating point implementations, so you'd have to rebuild the entire system.

Of course, EABI allows you to mix-and-match... just, you -still- need to recompile the whole system to be EABI aware :/
[div align=\"right\"][a href=\"index.php?act=findpost&pid=155639\"][{POST_SNAPBACK}][/a][/div]

(Realizing my earlier post was a little unclear).

Yes, altered floating-point implementations would need a new "libc" and all programs would need to be aware of this,  but what about the plain old "libgcc" which is all I'm trying to replace?  

I'm not really interested in changing the floating-point implementation (yet).  I just want a new gcc-toolchain. I find it difficult to believe that rebuilding the same toolchain that the existing ROM uses with support for additional languages should need a whole new ROM.

I just want a system that runs fortran natively.  The compilation of g77 is reasonably  straight-forward, but the resulting library (libgcc) is not. (at least to me).  

It took me a long time of playing around on an already slow machine just to get the gcc  toolchain's source-code to build.  Maybe I didn't give it enough of a chance.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=156073\"][{POST_SNAPBACK}][/a][/div]

did you use the pdaXrom toolchain (which is softvfp enabled) to compile fortran or did you use your own DIY toolchain which uses soft-float/fpa to compile fortran? the latter would build a completely incompatible libgcc
also, you need to build fortran from the same gnu compiler version as the pdaXrom toolchain, ie 3.4.6 sources of fortran, otherwise you will be building a different version of libgcc.
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

radiochickenwax

  • Full Member
  • ***
  • Posts: 158
    • View Profile
Compile Error On Float Point Problem
« Reply #8 on: March 15, 2007, 07:38:21 pm »
Quote
The Linux From Scratch project has notes on building an entire toolchain, you should read up on it. It shouldn't be too different to adapt to the 3.6 GCC. If it doesn't work, try to find the archived older versions.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=156076\"][{POST_SNAPBACK}][/a][/div]


Yes, I've been reading up on that.  Great project, thanks.


Quote
It's a long process to get it right - you have to build GCC, use that to build Glibc, then rebuild GCC to link against the newly-created Glibc. Since pdaXrom already has Glibc built, you can probably skip most of that.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=156076\"][{POST_SNAPBACK}][/a][/div]

It certainly is a long process.  Like you said, and for the same reasons, I'm not trying to rebuild glibc (yet).  



Quote
did you use the pdaXrom toolchain (which is softvfp enabled) to compile fortran or did you use your own DIY toolchain which uses soft-float/fpa to compile fortran? the latter would build a completely incompatible libgcc
also, you need to build fortran from the same gnu compiler version as the pdaXrom toolchain, ie 3.4.6 sources of fortran, otherwise you will be building a different version of libgcc.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=156093\"][{POST_SNAPBACK}][/a][/div]

I've actually tried all of the above, as well as cross-tool.  I was using gcc3.4.5 to compile gcc3.4.5. The only partial  successes I believe I've gotten thus far were from the pdaXrom x86 softvfp cross-compiler in one try and the native pdaXrom toolchain in another.  I'm not sure what's going wrong with the resulting toolchain anymore, since I haven't had a chance to try it again for a few weeks. The last I remember is that it wasn't linking compiled code into executable code somehow.  

I'm sure to give this another try in the near future, even if it means starting completely from scratch as was suggested.

Thanks for the responses, I guess there's not much of a demand for fortran in pdaxrom, or if there is, it's fairly silent.  I do very much appreciate the assistance.
« Last Edit: March 15, 2007, 07:41:01 pm by radiochickenwax »
ZAURII:    sl-6000 : (temporarily) bricked pdaxrom b1   ||   sl-c3200 : yonggun/Debian-EABI
OTHERS:  htc-excalibur,  axim x5,  ipaq 4355, (still trying to find useable linux setups)
thinking about gumstix to replace/augment zaurus

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Compile Error On Float Point Problem
« Reply #9 on: March 15, 2007, 08:16:37 pm »
Quote
Quote
The Linux From Scratch project has notes on building an entire toolchain, you should read up on it. It shouldn't be too different to adapt to the 3.6 GCC. If it doesn't work, try to find the archived older versions.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=156076\"][{POST_SNAPBACK}][/a][/div]


Yes, I've been reading up on that.  Great project, thanks.


Quote
It's a long process to get it right - you have to build GCC, use that to build Glibc, then rebuild GCC to link against the newly-created Glibc. Since pdaXrom already has Glibc built, you can probably skip most of that.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=156076\"][{POST_SNAPBACK}][/a][/div]

It certainly is a long process.  Like you said, and for the same reasons, I'm not trying to rebuild glibc (yet).  



Quote
did you use the pdaXrom toolchain (which is softvfp enabled) to compile fortran or did you use your own DIY toolchain which uses soft-float/fpa to compile fortran? the latter would build a completely incompatible libgcc
also, you need to build fortran from the same gnu compiler version as the pdaXrom toolchain, ie 3.4.6 sources of fortran, otherwise you will be building a different version of libgcc.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=156093\"][{POST_SNAPBACK}][/a][/div]

I've actually tried all of the above, as well as cross-tool.  I was using gcc3.4.5 to compile gcc3.4.5. The only partial  successes I believe I've gotten thus far were from the pdaXrom x86 softvfp cross-compiler in one try and the native pdaXrom toolchain in another.  I'm not sure what's going wrong with the resulting toolchain anymore, since I haven't had a chance to try it again for a few weeks. The last I remember is that it wasn't linking compiled code into executable code somehow.  

I'm sure to give this another try in the near future, even if it means starting completely from scratch as was suggested.

Thanks for the responses, I guess there's not much of a demand for fortran in pdaxrom, or if there is, it's fairly silent.  I do very much appreciate the assistance.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=156451\"][{POST_SNAPBACK}][/a][/div]

Note that building from scratch is not the option that you want because that would mean a complete new and incompatible gcc unless you can build a soft-vfp enabled gcc from scratch for which you need sashz' special patches...
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

radiochickenwax

  • Full Member
  • ***
  • Posts: 158
    • View Profile
Compile Error On Float Point Problem
« Reply #10 on: March 17, 2007, 09:04:42 pm »
Quote
Note that building from scratch is not the option that you want because that would mean a complete new and incompatible gcc unless you can build a soft-vfp enabled gcc from scratch for which you need sashz' special patches...
[div align=\"right\"][a href=\"index.php?act=findpost&pid=156459\"][{POST_SNAPBACK}][/a][/div]


Yeah, that's a problem.  The special patches are available on SVN?  It's gonna take me awhile to get the hang of learning to apply them I think.
ZAURII:    sl-6000 : (temporarily) bricked pdaxrom b1   ||   sl-c3200 : yonggun/Debian-EABI
OTHERS:  htc-excalibur,  axim x5,  ipaq 4355, (still trying to find useable linux setups)
thinking about gumstix to replace/augment zaurus