2008-06-06 05:10:51     libbfdsp : problem with bfin-linux-uclibc-gcc and atan_fr16

Document created by Aaronwu Employee on Aug 15, 2013
Version 1Show Document
  • View in full screen mode

2008-06-06 05:10:51     libbfdsp : problem with bfin-linux-uclibc-gcc and atan_fr16

John Foo (UNITED STATES)

Message: 56802   

 

Hi,

 

After compiling the libdsp as well as the test programs in testsuite, the test program "math" fails:

 

atan_fr16(0x1234): 0x1bd (should be 0x1215)

Finished

 

When I compile I get following warning: (when linking with libbfdsp.a)

 

cos_fr16.asm(.text+0x6): warning: warning: relocation references a different segment

 

 

This only happens with bfin-linux-uclibc-gcc (ELF, FDPIC). With bfin-uclinux-gcc (FLAT) I obtain no warning and the test program returns correct results. Same things happen to cos_fr16 and sin_fr16.

 

Did anyone experience similar problems?

I am using a BF561.

 

I'd appreciate any help!

-Raphaël

QuoteReplyEditDelete

 

 

2008-06-06 06:05:30     Re: libbfdsp : problem with bfin-linux-uclibc-gcc and atan_fr16

Mike Frysinger (UNITED STATES)

Message: 56806   

 

atan/cos/sin fr16 have not been ported to FDPIC so they wont work yet

QuoteReplyEditDelete

 

 

2008-06-09 17:06:07     Re: libbfdsp : problem with bfin-linux-uclibc-gcc and atan_fr16

Konstantin Hartwich (GERMANY)

Message: 56883   

 

confirmed...

 

 

 

i tryed to use the libbfdsp with cfft_ radix 2, it reports thr linker cant find _cos_fr16 and another one i dont remeber. i was compiling using fdpic and bfin-linux-uclibc-gcc. it seems that there is a bug, and the reference in the .asm file to bf_math.h insteadof math.h in the toolchain containing the radix 2 fft function has been bugfixed some 2 weeks ago. but thus its not in the current release :(. those nightly snapshots are dated to 2007, so i dont know what they're for..

 

only possible solution is to get the svn trunk of the toolchain and recompile and reinstall it. i was trying that on friday, but havnt finished yet. maybe there is somone out there who managed this in a different way.

 

 

 

PS: checkout needs some time, building needs double.

QuoteReplyEditDelete

 

 

2008-06-09 17:33:34     Re: libbfdsp : problem with bfin-linux-uclibc-gcc and atan_fr16

Mike Frysinger (UNITED STATES)

Message: 56884   

 

you dont need the whole toolchain to rebuild just libbfdsp ... you only need the libs subdir in trunk

 

QuoteReplyEditDelete

 

 

2009-04-21 16:44:44     Re: libbfdsp : problem with bfin-linux-uclibc-gcc and atan_fr16

Leo Singer (UNITED STATES)

Message: 73027   

 

I am having this problem with both the bfin-linux-uclibc- toolchain and the bfin-uclinux- toolchain.  I am using a distribution installed from the following two archives:

 

 

 

blackfin-toolchain-uclibc-default-08r1-8.i386.tar.gz

 

blackfin-toolchain-08r1-8.i386.tar.gz

 

 

 

What must I do to fix this link error and gain access to the fft routines?

QuoteReplyEditDelete

 

 

2009-04-21 17:12:07     Re: libbfdsp : problem with bfin-linux-uclibc-gcc and atan_fr16

Robin Getz (UNITED STATES)

Message: 73030   

 

Leo:

 

Which part of Mike's response don't you understand? for now - use flat (the bfin-uclinux toolchain).

 

-Robin

QuoteReplyEditDelete

 

 

2009-04-21 21:29:10     Re: libbfdsp : problem with bfin-linux-uclibc-gcc and atan_fr16

Leo Singer (UNITED STATES)

Message: 73033   

 

I reiterate:  I am having this problem with both the bfin-linux-uclibc- toolchain and the bfin-uclinux- toolchain.  I installed both by extracting those two archives.  Am I missing some files?  Or do I need to download a newer toolchain?

QuoteReplyEditDelete

 

 

2009-04-21 21:36:30     Re: libbfdsp : problem with bfin-linux-uclibc-gcc and atan_fr16

Leo Singer (UNITED STATES)

Message: 73034   

 

Here's output from my build:

 

 

 

bfin-uclinux-g++ -o build/bfin/sonaragent.o -c -Wall -Iinclude src/sonaragent.cpp

 

bfin-uclinux-g++ -o build/bfin/sonaragent.coff build/bfin/sonaragent.o -lm -lbfdsp

 

/opt/uClinux/bfin-uclinux/bfin-uclinux/runtime/usr/lib/libbfdsp.a(twidfftrad4_fr16.o): In function `__twidfftrad4_fr16':

 

twidfftrad4_fr16.c:(.text+0x86): undefined reference to `_cos_fr16'

 

twidfftrad4_fr16.c:(.text+0x90): undefined reference to `_sin_fr16'

 

twidfftrad4_fr16.c:(.text+0xc6): undefined reference to `_cos_fr16'

 

twidfftrad4_fr16.c:(.text+0x126): undefined reference to `_sin_fr16'

 

collect2: ld returned 1 exit status

 

QuoteReplyEditDelete

 

 

2009-04-21 22:57:49     Re: libbfdsp : problem with bfin-linux-uclibc-gcc and atan_fr16

Robin Getz (UNITED STATES)

Message: 73035   

 

Leo:

 

Please post your source files. Posting random errors doesn't help.

 

-Robin

QuoteReplyEditDelete

 

 

2009-04-22 00:44:59     Re: libbfdsp : problem with bfin-linux-uclibc-gcc and atan_fr16

Leo Singer (UNITED STATES)

Message: 73038   

Here is the file "a.c":

 

 

#include <filter.h>

 

#define N 64

 

complex_fract16 twid[N/2];

 

 

 

void main()

 

{

 

  twidfftrad2_fr16(twid, N);

 

}

 

 

With my uClinux toolchain, I get the previously quoted error when I try building "a.c" using either of the following commands:

bfin-linux-uclibc-gcc a.c -lbfdsp

bfin-uclinux-gcc a.c -lbfdsp

QuoteReplyEditDelete

 

 

2009-04-22 10:33:53     Re: libbfdsp : problem with bfin-linux-uclibc-gcc and atan_fr16

Robin Getz (UNITED STATES)

Message: 73063   

 

Leo:

 

This works for me:

 

rgetz@imhotep:~/tmp> bfin-uclinux-gcc foo.c -lbfdsp

foo.c: In function ‘main’:

foo.c:8: warning: return type of ‘main’ is not ‘int’

rgetz@imhotep:~/tmp>

 

QuoteReplyEditDelete

 

 

2009-04-22 15:36:08     Re: libbfdsp : problem with bfin-linux-uclibc-gcc and atan_fr16

Mike Frysinger (UNITED STATES)

Message: 73079   

 

like Robin says, it works fine with 2008R1.5.  if it isnt working for you, it implies you arent using the toolchain you think you're using.

QuoteReplyEditDelete

Attachments

    Outcomes