[coldfire-gnu-discuss] uClinux & ColdFire pthread debugging using CodeSourcery 4.4-53
Harry Gunnarsson
mrharryg at gmail.com
Wed Mar 10 16:18:05 UTC 2010
Thanks for the reply
Earlier, with CS 4.2, I used the -m5307 flag for compiling and linking
As mentioned I did some more research on the options and now I typically
compile like this(The -D flags I don't really use, I brought them over from
the userspace makefiles for uClinux distro)
m68k-uclinux-gcc -mcpu=5272 -g3 -DCONFIG_COLDFIRE -DEMBED -Dlinux
-D__linux__ -Dunix -D__uClinux__ -Isrc/pthread/join -DDEBUG -c
src/pthread/join/join.c -o objs/jthread_m68k_Ono/join.o
m68k-uclinux-gcc -mcpu=5272 -DCONFIG_COLDFIRE -Wl,--fatal-warnings
-Wl,-elf2flt -o objs/jthread_m68k_Ono/jthread_m68k_Ono.bflt
objs/jthread_m68k_Ono/join.o -lpthread
Running with -v on linking, I see that the following path is used
-L...installpath.../freescale-coldfire-4.4/bin/../m68k-uclinux/libc/m5206e/usr/lib
Therefore I pick up gdbserver from this path
freescale-coldfire-4.4/bin/../m68k-uclinux/libc/m5206e/usr/lib/bin/gdbserver
and put it on the target
Then I run as usual
gdbserver :5000 ./jth...bflt
and
m68k-uclinux-gdb ./jth...bflt.gdb
etc
So I think I am doing the right thing here, but please advice if there is
another recommended way.
Yes, I always follow your last point; I never call ld explicitly.
On Wed, Mar 10, 2010 at 2:04 AM, Maxim Kuvyrkov <maxim at codesourcery.com>wrote:
> On 3/9/10 9:11 AM, Harry Gunnarsson wrote:
> ...
>
>> Now I am trying to get the latest uclinux.org <http://uclinux.org>
>>
>> distro from 2009 running (kernel 2.6.[29-31]). The main reason is to
>> look into improvements (kernel, busybox etc) in general (stability) and
>> JFFS2 enhancements in general.
>> - uClinux 2009 distro
>> - CodeSourcery 4.4-53
>>
>
> How do you build your applications (especially the ones that you trying to
> debug with CodeSourcery's tools)?
>
> To get a reliable uClinux system you need to build the binaries with the
> same tools you then try to debug them with.
>
>
> My port seems to work well in all aspects except for debugging
>> multi-thread user apps.
>> I have tried many permutations of target build flags (-mcpu, -m etc),
>> and according to CS website it seems recommended to -m5208 runtime with
>> M5272 ColdFire. Therefore, I have lately tried '-mcpu=5272' for .c
>> sources and '-m5208' during link.
>>
>
> A side note: just specifying -mcpu=<your cpu, 5272 in this case>
> consistently to the compiler is the best approach. Also, it is highly
> recommended to use the compiler driver (m68k-uclinux-gcc or
> m68k-uclinux-g++) to link the programs -- that way the driver will invoke
> the linker with the correct set of utility libraries; using the linker
> directly is error-prone to picking up the libraries for a different CPU.
>
> Regards,
>
> --
> Maxim Kuvyrkov
> CodeSourcery
> maxim at codesourcery.com
> (650) 331-3385 x724
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/coldfire-gnu-discuss/attachments/20100310/8e8b6500/attachment.html>
More information about the coldfire-gnu-discuss
mailing list