Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
NSLU2 based Linux File Server
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures
View previous topic :: View next topic  
Author Message
Shining Arcanine
Veteran
Veteran


Joined: 24 Sep 2009
Posts: 1110

PostPosted: Tue Jun 01, 2010 1:20 am    Post subject: Reply with quote

I am having an issue where the cross compiler is failing to build uclibc, citing the following:

Quote:
/usr/libexec/gcc/armv5teb-softfloat-linux-uclibc/ld: error: /usr/lib/gcc/armv5teb-softfloat-linux-uclibc/4.4.3/libgcc.a(_udivsi3.o) uses VFP instructions, whereas lib/libuClibc-0.9.30.1.so does not
/usr/libexec/gcc/armv5teb-softfloat-linux-uclibc/ld: failed to merge target specific data of file /usr/lib/gcc/armv5teb-softfloat-linux-uclibc/4.4.3/libgcc.a(_udivsi3.o)
/usr/libexec/gcc/armv5teb-softfloat-linux-uclibc/ld: error: /usr/lib/gcc/armv5teb-softfloat-linux-uclibc/4.4.3/libgcc.a(_divsi3.o) uses VFP instructions, whereas lib/libuClibc-0.9.30.1.so does not
/usr/libexec/gcc/armv5teb-softfloat-linux-uclibc/ld: failed to merge target specific data of file /usr/lib/gcc/armv5teb-softfloat-linux-uclibc/4.4.3/libgcc.a(_divsi3.o)
/usr/libexec/gcc/armv5teb-softfloat-linux-uclibc/ld: error: /usr/lib/gcc/armv5teb-softfloat-linux-uclibc/4.4.3/libgcc.a(_umodsi3.o) uses VFP instructions, whereas lib/libuClibc-0.9.30.1.so does not
/usr/libexec/gcc/armv5teb-softfloat-linux-uclibc/ld: failed to merge target specific data of file /usr/lib/gcc/armv5teb-softfloat-linux-uclibc/4.4.3/libgcc.a(_umodsi3.o)
/usr/libexec/gcc/armv5teb-softfloat-linux-uclibc/ld: error: /usr/lib/gcc/armv5teb-softfloat-linux-uclibc/4.4.3/libgcc.a(_modsi3.o) uses VFP instructions, whereas lib/libuClibc-0.9.30.1.so does not
/usr/libexec/gcc/armv5teb-softfloat-linux-uclibc/ld: failed to merge target specific data of file /usr/lib/gcc/armv5teb-softfloat-linux-uclibc/4.4.3/libgcc.a(_modsi3.o)
/usr/libexec/gcc/armv5teb-softfloat-linux-uclibc/ld: error: /usr/lib/gcc/armv5teb-softfloat-linux-uclibc/4.4.3/libgcc.a(_dvmd_lnx.o) uses VFP instructions, whereas lib/libuClibc-0.9.30.1.so does not
/usr/libexec/gcc/armv5teb-softfloat-linux-uclibc/ld: failed to merge target specific data of file /usr/lib/gcc/armv5teb-softfloat-linux-uclibc/4.4.3/libgcc.a(_dvmd_lnx.o)
/usr/libexec/gcc/armv5teb-softfloat-linux-uclibc/ld: error: /usr/lib/gcc/armv5teb-softfloat-linux-uclibc/4.4.3/libgcc.a(_divdi3.o) uses VFP instructions, whereas lib/libuClibc-0.9.30.1.so does not
/usr/libexec/gcc/armv5teb-softfloat-linux-uclibc/ld: failed to merge target specific data of file /usr/lib/gcc/armv5teb-softfloat-linux-uclibc/4.4.3/libgcc.a(_divdi3.o)
/usr/libexec/gcc/armv5teb-softfloat-linux-uclibc/ld: error: /usr/lib/gcc/armv5teb-softfloat-linux-uclibc/4.4.3/libgcc.a(_moddi3.o) uses VFP instructions, whereas lib/libuClibc-0.9.30.1.so does not
/usr/libexec/gcc/armv5teb-softfloat-linux-uclibc/ld: failed to merge target specific data of file /usr/lib/gcc/armv5teb-softfloat-linux-uclibc/4.4.3/libgcc.a(_moddi3.o)
libc/libc_so.a(difftime.os): In function `difftime':
difftime.c:(.text+0x8): undefined reference to `__floatsidf'
difftime.c:(.text+0x2c): undefined reference to `__subdf3'
libc/libc_so.a(_fpmaxtostr.os): In function `_fpmaxtostr':
_fpmaxtostr.c:(.text+0xc4): undefined reference to `__nedf2'
_fpmaxtostr.c:(.text+0xe8): undefined reference to `__eqdf2'
_fpmaxtostr.c:(.text+0x104): undefined reference to `__divdf3'
_fpmaxtostr.c:(.text+0x110): undefined reference to `__ltdf2'
_fpmaxtostr.c:(.text+0x1b8): undefined reference to `__muldf3'
_fpmaxtostr.c:(.text+0x37c): undefined reference to `__gedf2'
_fpmaxtostr.c:(.text+0x410): undefined reference to `__fixunsdfsi'
_fpmaxtostr.c:(.text+0x418): undefined reference to `__floatunsidf'
libc/libc_so.a(__psfs_do_numeric.os): In function `__psfs_do_numeric':
__psfs_do_numeric.c:(.text+0x554): undefined reference to `__truncdfsf2'
libc/libc_so.a(strtof.os): In function `strtof':
strtof.c:(.text+0x1c): undefined reference to `__extendsfdf2'
libc/libc_so.a(__strtofpmax.os): In function `__strtofpmax':
__strtofpmax.c:(.text+0x14c): undefined reference to `__adddf3'
collect2: ld returned 1 exit status
make: *** [lib/libc.so] Error 1
* ERROR: cross-armv5teb-softfloat-linux-uclibc/uclibc-0.9.30.1-r1 failed:
* make failed
*
* Call stack:
* ebuild.sh, line 54: Called src_compile
* environment, line 2768: Called die
* The specific snippet of code:
* emake || die "make failed";
*
* If you need support, post the output of 'emerge --info =cross-armv5teb-softfloat-linux-uclibc/uclibc-0.9.30.1-r1',
* the complete build log and the output of 'emerge -pqv =cross-armv5teb-softfloat-linux-uclibc/uclibc-0.9.30.1-r1'.
* This ebuild is from an overlay: '/usr/local/portage/'
* The complete build log is located at '/var/tmp/cross/armv5teb-softfloat-linux-uclibc/portage/cross-armv5teb-softfloat-linux-uclibc/uclibc-0.9.30.1-r1/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/cross/armv5teb-softfloat-linux-uclibc/portage/cross-armv5teb-softfloat-linux-uclibc/uclibc-0.9.30.1-r1/temp/environment'.
* S: '/var/tmp/cross/armv5teb-softfloat-linux-uclibc/portage/cross-armv5teb-softfloat-linux-uclibc/uclibc-0.9.30.1-r1/work/uClibc-0.9.30.1'

>>> Failed to emerge cross-armv5teb-softfloat-linux-uclibc/uclibc-0.9.30.1-r1, Log file:

>>> '/var/tmp/cross/armv5teb-softfloat-linux-uclibc/portage/cross-armv5teb-softfloat-linux-uclibc/uclibc-0.9.30.1-r1/temp/build.log'

* Messages for package cross-armv5teb-softfloat-linux-uclibc/uclibc-0.9.30.1-r1:
* You really should consider setting UCLIBC_CPU
* Otherwise, the build will be generic (read: slow).
* Available CPU options:
* ERROR: cross-armv5teb-softfloat-linux-uclibc/uclibc-0.9.30.1-r1 failed:
* make failed
*
* Call stack:
* ebuild.sh, line 54: Called src_compile
* environment, line 2768: Called die
* The specific snippet of code:
* emake || die "make failed";
*
* If you need support, post the output of 'emerge --info =cross-armv5teb-softfloat-linux-uclibc/uclibc-0.9.30.1-r1',
* the complete build log and the output of 'emerge -pqv =cross-armv5teb-softfloat-linux-uclibc/uclibc-0.9.30.1-r1'.
* This ebuild is from an overlay: '/usr/local/portage/'
* The complete build log is located at '/var/tmp/cross/armv5teb-softfloat-linux-uclibc/portage/cross-armv5teb-softfloat-linux-uclibc/uclibc-0.9.30.1-r1/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/cross/armv5teb-softfloat-linux-uclibc/portage/cross-armv5teb-softfloat-linux-uclibc/uclibc-0.9.30.1-r1/temp/environment'.
* S: '/var/tmp/cross/armv5teb-softfloat-linux-uclibc/portage/cross-armv5teb-softfloat-linux-uclibc/uclibc-0.9.30.1-r1/work/uClibc-0.9.30.1'


It seems that I need to add -mfpu=vfp to the CFLAGS when building uclibc to fix it:

http://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg15892.html
http://dev.gentoo.org/~vapier/CROSS-COMPILE-HOWTO

I am not sure how to do this. Does anyone have any idea how to do that?
Back to top
View user's profile Send private message
cynyr
n00b
n00b


Joined: 24 Feb 2005
Posts: 21

PostPosted: Thu Jun 03, 2010 5:49 pm    Post subject: Reply with quote

Shining Arcanine wrote:
I am having an issue where the cross compiler is failing to build uclibc, citing the following:

...

It seems that I need to add -mfpu=vfp to the CFLAGS when building uclibc to fix it:

http://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg15892.html
http://dev.gentoo.org/~vapier/CROSS-COMPILE-HOWTO

I am not sure how to do this. Does anyone have any idea how to do that?


you should have a /etc/portage/savedconfig/cross-${TARGET}/uclibc-${VERSION}. line 216 in mine says,
Code:
UCLIBC_EXTRA_CFLAGS=""

You should be able to add "-mfpu=vfp" in the the quotes in that line, and set the savedconfig USE flag and be good to go.
Back to top
View user's profile Send private message
Shining Arcanine
Veteran
Veteran


Joined: 24 Sep 2009
Posts: 1110

PostPosted: Thu Jun 03, 2010 6:37 pm    Post subject: Reply with quote

It seems that running the following has the same effect:

Code:
UCLIBC_EXTRA_CFLAGS="-mfpu=vfp" crossdev -t cross-armv5teb-softfloat-linux-uclibc


Unfortunately, I was wrong to think that adding -mpfu=vfp to the CFLAGS would resolve the issue. :/
Back to top
View user's profile Send private message
cynyr
n00b
n00b


Joined: 24 Feb 2005
Posts: 21

PostPosted: Thu Jun 03, 2010 7:11 pm    Post subject: Reply with quote

Look again, you need to edit the config for uclibc, and set the "savedconfig" USE flag. I'm not sure that setting it on the commandline will fix it. I'm assuming that uclibc build scrips read in the config file for the options, and do not use environment variables.
Back to top
View user's profile Send private message
Shining Arcanine
Veteran
Veteran


Joined: 24 Sep 2009
Posts: 1110

PostPosted: Thu Jun 03, 2010 7:36 pm    Post subject: Reply with quote

cynyr wrote:
Look again, you need to edit the config for uclibc, and set the "savedconfig" USE flag. I'm not sure that setting it on the commandline will fix it. I'm assuming that uclibc build scrips read in the config file for the options, and do not use environment variables.


Setting it on the commandline alters the savedconfig output to match what you suggested I set it to be. Running the following command with the savedconfig output does not have any effect on the issue i am seeing:

Code:
USE=savedconfig emerge -1v =cross-armv5teb-softfloat-linux-uclibc/uclibc-0.9.30.1-r1
Back to top
View user's profile Send private message
Btoo
n00b
n00b


Joined: 24 Sep 2008
Posts: 42
Location: An isolated island

PostPosted: Sat Jun 05, 2010 12:31 am    Post subject: Reply with quote

Not to be too rude, as this thread is just what I was looking for a few days ago and will continue to watch, but I came to the conclusion BarracudaDrive http://www.nslu2-linux.org/wiki/Unslung/BarracudaDrive would be a good way to proceed with the NSLU2..[/url]

Funny how there are a few people who threw these things in their closet and are just now bringing them out.

Thank you Shining Arcanine for pursuing this in Gentoo.
Back to top
View user's profile Send private message
Shining Arcanine
Veteran
Veteran


Joined: 24 Sep 2009
Posts: 1110

PostPosted: Sat Jun 05, 2010 1:13 pm    Post subject: Reply with quote

Btoo wrote:
Not to be too rude, as this thread is just what I was looking for a few days ago and will continue to watch, but I came to the conclusion BarracudaDrive http://www.nslu2-linux.org/wiki/Unslung/BarracudaDrive would be a good way to proceed with the NSLU2..[/url]

Funny how there are a few people who threw these things in their closet and are just now bringing them out.

Thank you Shining Arcanine for pursuing this in Gentoo.


Yourwelcome, although I am not sure how much progress I will make with this. The difficulty associated with building cross-compilers and the great amount of information one needs to know to understand each component involved makes fixing things when they break more of an exercise in hacking than the conceptual procedure that it should be from a purely computer science standpoint.

I have other things to do at the moment, but a few days ago, I started spending devoting a large amount of my time to this as a means of distracting myself from a relative's hospitalization. It is about time that I go back to the things I should be doing, but this is both something that I want to do and something that is semi-related to other things that I am supposed to be doing so I will likely keep working on this among the other things I have been doing (e.g. nailing down an issue with the nvidia-drivers on my laptop) in my spare time anyway. It remains to be seen how well I will be able to balance my time.
Back to top
View user's profile Send private message
Shining Arcanine
Veteran
Veteran


Joined: 24 Sep 2009
Posts: 1110

PostPosted: Wed Jun 09, 2010 4:18 pm    Post subject: Reply with quote

I was looking through the savedconfig file today and I think I found the problem:

Code:
#
# Using ELF file format
#
ARCH_ANY_ENDIAN=y
ARCH_BIG_ENDIAN=y
ARCH_WANTS_BIG_ENDIAN=y
# ARCH_WANTS_LITTLE_ENDIAN is not set
ARCH_HAS_MMU=y
ARCH_USE_MMU=y
UCLIBC_HAS_FLOATS=y
# UCLIBC_HAS_FPU is not set
UCLIBC_HAS_SOFT_FLOAT=y
DO_C99_MATH=y
UCLIBC_HAS_FENV=y
KERNEL_HEADERS="/usr/armv5teb-softfloat-linux-uclibc/usr/include"
HAVE_DOT_CONFIG=y


If I change both UCLIBC_HAS_FLOATS and UCLIBC_HAS_SOFT_FLOAT to n, things will work, but this disables floating point support, which I am not sure is the right thing to do. I tried doing make menuconfig on the extract sources in /var/tmp/portage/... after doing ebuild $(equery which cross-armv5teb-softfloat-linux-uclibc/uclibc) prepare and it seems that there is nothing I can do to configure uclibc to compile with floating point support via the use of VFP instructions. I am still fiddling with things.
Back to top
View user's profile Send private message
Shining Arcanine
Veteran
Veteran


Joined: 24 Sep 2009
Posts: 1110

PostPosted: Tue Jun 15, 2010 12:17 pm    Post subject: Reply with quote

The cross compiler idea only worked if I used a savedconfig with floating point support disabled, which is not what I wanted; I wanted something that used softfloat for floating point calculations, so I am trying Debian now. The Debian images are little endian, so hopefully I will be able to install Gentoo Linux from inside Debian.
Back to top
View user's profile Send private message
Shining Arcanine
Veteran
Veteran


Joined: 24 Sep 2009
Posts: 1110

PostPosted: Thu Sep 09, 2010 5:35 am    Post subject: Reply with quote

Here is a brief update. I bricked my NSLU2 trying to modify the hardware to undo a factory underclock, which is why I have not done anything with this for 6 months. Contrary to claims on the nslu2-linux.org website, nail clippers are not appropriate for removing SMD resistors. I accidentally damaged a resistor I was not supposed to remove using the nailclipper removal method, which is what bricked my NSLU2. I need to get a new SMD 103 resistor to replace the one I damaged before I can do anything else with my NSLU2.

Anyway, I looked into this issue again and I discovered why it was happening. It seems that the issue is not in uclibc like I had thought, but in GCC, because of how it is being compiled. The following mailing list explains it fairly well:

Quote:
When porting code to ARM EABI, the following preprocessor macros are interesting:

*

__VFP_FP__ means that the floating point format in use is that of
the ARM VFP unit, which is native-endian IEEE-754.

*

__MAVERICK__ means that the floating point format is that of the
irrus Logic MaverickCrunch
<http://wiki.debian.org/MaverickCrunch>, which is also IEEE-754
and is always little-endian.

*

__SOFTFP__ means that instead of floating point instructions,
library calls are being generated for floating point math
operations so that the code will run on a processor without an FPU.


http://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg15860.html

VFP instructions are meant for a hardware floating point unit, so since libgcc.a is being compiled to use VFP instructions, libgcc.a is being compiled incorrectly. That means that the problem is in how GCC is being compiled, not how uclibc is being compiled. I will look into this more tomorrow, but I think now that I understand what is wrong, a bug report is probably warranted.
Back to top
View user's profile Send private message
Shining Arcanine
Veteran
Veteran


Joined: 24 Sep 2009
Posts: 1110

PostPosted: Thu Sep 09, 2010 3:12 pm    Post subject: Reply with quote

I did some more digging and it seems that my target architecture does support VFP instructions, so it seems that GCC was being compiled correctly for my target architecture. It was the use of softfloat that messed things up. Anyway, I managed to get the cross compiler to compile with the following command:

Code:
UCLIBC_HAS_SOFT_FLOAT="n" UCLIBC_HAS_FPU="y" UCLIBC_CPU="ARM_XSCALE" USE="-*" crossdev -t cross-armv5teb-unknown-linux-uclibc


Edit: Actually, I was right the first time. The Intel IXP425 processor uses the armv5te instruction set, but lacks a floating point unit, so GCC will need to be patched to respect softfloat in order for the cross compiler to work:

http://en.wikipedia.org/wiki/XScale
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum