2009年5月21日 星期四

hidden symbol `__aeabi_uidiv' in xxxx is referenced by DSO

事情是這樣低
想要試試ARM EABI的cross compile.因為它使用了VFP的方式大幅提昇floating point performance.
在compile nano-X時出現以下錯誤

arm-linux-gcc  -fomit-frame-pointer -march=armv4 -Wall -Wpointer-arith -O3 -mstructure-size-boundary=8  -I. -I/home/gigijoe/S3C2440/microwindows-0.91/src/include  -L/home/gigijoe/S3C2440/microwindows-0.91/src/lib  /home/gigijoe/S3C2440/microwindows-0.91/src/obj/demos/nanox/demo.o -o /home/gigijoe/S3C2440/microwindows-0.91/src/bin/demo -lnano-X

/usr/local/arm/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/../../../../arm-none-linux-gnueabi/bin/ld: /home/gigijoe/S3C2440/microwindows-0.91/src/bin/demo: hidden symbol `__aeabi_uidiv' in /usr/local/arm/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/armv4t/libgcc.a(_udivsi3.o) is referenced by DSO
/usr/local/arm/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/../../../../arm-none-linux-gnueabi/bin/ld: final link failed: Nonrepresentable section on output

大致上就是找不到 __aeabi_uidiv 導致link fail.
google了一下
http://wiki.debian.org/ArmEabiPort
http://people.defora.org/~khorben/200903.html

有提到加上 -lgcc 解決.
嗯,沒用啊不理偶.
好吧,只好用暴力法直接去找source code
嘿嘿黑,正解就是加上-lgcc_s


關於VFP

none
Selects no floating-point option. No floating-point code is to be used.

vfp
Selects hardware vector floating-point unit conforming to architecture VFPv1. This is a synonym for -fpu vfpv1. This option is not available for the Thumb compilers.

vfpv1
Selects hardware vector floating-point unit conforming to architecture VFPv1, such as the VFP10 rev 0. This option is not available for the Thumb compilers.

vfpv2
Selects hardware vector floating-point unit conforming to architecture VFPv2, such as the VFP10 rev 1. This option is not available for the Thumb compilers.

fpa
Selects hardware Floating Point Accelerator (FPA). This option is not available for the Thumb compilers and is only provided for backwards compatibility.

softvfp+vfp
Selects a floating-point library with pure-endian doubles and software floating-point linkage that uses the VFP hardware. Select this option if you are interworking Thumb code with ARM code on a system that implements a VFP unit.
If you select this option:
- tcc and tcpp behave exactly as for -fpu softvfp except that they link with VFP-optimized floating-point libraries.
- armcc and armcpp behave the same as for -fpu vfp except that all functions are given software floating-point linkage. This means that ARM functions compiled with this option pass and return floating-point arguments and results as they would for -fpu softvfp, but use VFP instructions internally.

* Note
If you specify this option for both armcc and tcc, it ensures that your interworking floating-point code is compiled to use software floating-point linkage. If you specify vfp, vfpv1, or vfpv2 for armcc you must use the __softfp keyword to ensure that your interworking ARM code is compiled to use software floating-point linkage. See the description of __softfp in Function keywords for more information.

softvfp
Selects software floating-point library (FPLib) with pure-endian doubles. This is the default if you do not specify a -fpu option.

softfpa
Selects software floating-point library with mixed-endian doubles.

沒有留言:

張貼留言