dBug build problem under Linux

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

dBug build problem under Linux

3,814 Views
GunnarRistroph
Contributor I
I am trying to build dBug so I can use it to build my own boot loader for the M5208EVB.

When I type "make m5208evb", I get the following error:

No rule to make target `obj/m5208evb/gnu/board/m5208evb/src/uClinux_and_SBCTools/delay.o', needed by `all'.

The top level Makefile calls proj/m5208/build/gnu/m5208evb.make which includes build/gnu/mcf5xxx.comp and build/common.objs. No where is there a make target that tells how to make the list of objects found in OBJS.

Is there a simple fix or something that I am overlooking?


Development environment: Debian 2.6.15 with m68k-elf-tools-20030314. Using 5208_DBUG.zip downloaded from the Freescale website.
Labels (1)
0 Kudos
8 Replies

792 Views
GunnarRistroph
Contributor I
The top level Makefile calls proj/m5208/build/gnu/m5208evb.make which includes build/gnu/mcf5xxx.comp and build/common.objs AND build/gnu/cf.rules.lst.

The make targets for things in OBJS are in this file - build/gnu/cf.rules.lst, but it still isn't working, (possibly because make isn't matching the names).
0 Kudos

792 Views
GunnarRistroph
Contributor I
To summarize progress so far, I downloaded 5208_DBUG.zip from the freescale website and unzipped it. I then:

1) converted all files to unix line endings:
find . -type f -print -exec fromdos \{\} \;

2) make bin files executable:
chmod a+x bin/*

3) change the name of uClinux_and_SBCTools to "tools" because make was having a hard time matching it (by the way: it should be uClinux NOT ucLinux), I changed the existing directory names and all refences to it in all files (just a couple of these)

4) replaced C:/SBCToolsV2/Standard/ColdFire/gcc/m68k-elf-3.3.2/bin with /usr/local/m68k-elf/bin in build/gnu/mcf5xxx.comp and C:/SBCToolsV2/Standard/ColdFire/gcc/m68k-elf-3.3.2/lib/gcc-lib/m68k-elf/3.3.2/m5307 with /usr/local/lib/gcc-lib/m68k-elf/2.95.3/m5307

This gets me most of the way there, but not quite.

After making the objects, I get:

------------------------------------------------------------
-------- M5208EVB dBUG for external Flash and SDRAM --------
------------------------------------------------------------

m68k-elf-ld -L/usr/local/lib/gcc-lib/m68k-elf/2.95.3/m5307 -v -T proj/m5208evb/build/gnu/flash.ld \
-Map obj/m5208evb/gnu/m5208evb_flash.map -o obj/m5208evb/gnu/m5208evb_flash.elf \
obj/m5208evb/gnu/cpu/coldfire/mcf5xxx/asm.o obj/m5208evb/gnu/cpu/coldfire/mcf5xxx/disasm.o obj/m5208evb/gnu/cpu/coldfire/mcf5xxx/mcf5xxx_hi.o obj/m5208evb/gnu/cpu/coldfire/mcf5xxx/mcf5xxx_lo.o obj/m5208evb/gnu/cpu/coldfire/mcf5xxx/mcf5xxx_uart.o obj/m5208evb/gnu/cpu/coldfire/mcf5xxx/vectors.o obj/m5208evb/gnu/cpu/coldfire/mcf5208/mcf5208_hi.o obj/m5208evb/gnu/cpu/coldfire/mcf5208/mcf5208_lo.o obj/m5208evb/gnu/uif/main.o obj/m5208evb/gnu/uif/cmds.o obj/m5208evb/gnu/uif/alloc.o obj/m5208evb/gnu/uif/assert.o obj/m5208evb/gnu/uif/history.o obj/m5208evb/gnu/uif/setshow.o obj/m5208evb/gnu/uif/stdlib.o obj/m5208evb/gnu/uif/isr.o obj/m5208evb/gnu/uif/msgs.o obj/m5208evb/gnu/uif/brktab.o obj/m5208evb/gnu/uif/symtab.o obj/m5208evb/gnu/uif/dl_srec.o obj/m5208evb/gnu/uif/printk.o obj/m5208evb/gnu/uif/fl.o obj/m5208evb/gnu/uif/image.o obj/m5208evb/gnu/uif/coff.o obj/m5208evb/gnu/uif/elf.o obj/m5208evb/gnu/uif/net/queue.o obj/m5208evb/gnu/uif/net/net.o obj/m5208evb/gnu/uif/net/dn.o obj/m5208evb/gnu/uif/net/up.o obj/m5208evb/gnu/uif/net/dn_srec.o obj/m5208evb/gnu/uif/net/dnsetshow.o obj/m5208evb/gnu/uif/net/arp.o obj/m5208evb/gnu/uif/net/icmp.o obj/m5208evb/gnu/uif/net/ip.o obj/m5208evb/gnu/uif/net/nbuf.o obj/m5208evb/gnu/uif/net/nif.o obj/m5208evb/gnu/uif/net/tftp.o obj/m5208evb/gnu/uif/net/udp.o obj/m5208evb/gnu/cpu/coldfire/mcf5xxx/mcf5xxx_fec.o obj/m5208evb/gnu/cpu/coldfire/mcf5xxx/mcf5xxx_fecbd.o obj/m5208evb/gnu/cpu/coldfire/mcf5xxx/mcf5xxx_timer.o obj/m5208evb/gnu/dev/flash/amd_flash.o obj/m5208evb/gnu/board/common/dldbug.o obj/m5208evb/gnu/board/common/setget.o obj/m5208evb/gnu/board/common/mcfserial.o obj/m5208evb/gnu/board/m5208evb/src/evbcmds.o obj/m5208evb/gnu/board/m5208evb/src/m5208evb.o obj/m5208evb/gnu/board/m5208evb/src/params.o obj/m5208evb/gnu/board/m5208evb/src/sc.o obj/m5208evb/gnu/board/m5208evb/src/sysinit.o obj/m5208evb/gnu/board/m5208evb/src/tools/delay.o obj/m5208evb/gnu/board/m5208evb/src/tools/decompress.o obj/m5208evb/gnu/board/build.o -lgcc
GNU ld version 2.10 (with BFD 2.10)
/usr/local/bin/m68k-elf-ld.real: region data_ram is full (obj/m5208evb/gnu/m5208evb_flash.elf section .bss)
obj/m5208evb/gnu/cpu/coldfire/mcf5208/mcf5208_lo.o: In function `_asm_startmeup':
obj/m5208evb/gnu/cpu/coldfire/mcf5208/mcf5208_lo.o(.text+0x2c): undefined reference to `main'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/home/gunnar/AES/VIFXR/5208_DBUG/dbug'
make: *** [m5208evb] Error 2


Here is some environment information:

m68k-elf-gcc -v
Reading specs from /usr/local/lib/gcc-lib/m68k-elf/2.95.3/specs
gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)

m68k-elf-ld -v
GNU ld version 2.10 (with BFD 2.10)
0 Kudos

792 Views
GunnarRistroph
Contributor I
Well, I solved the undefined "main" problem and the not enough room in ram_data problem... but now there are undefined references to atexit from libgcc.

To summarize progress so far, I downloaded 5208_DBUG.zip from the freescale website and unzipped it. I then:

1) converted all files to unix line endings:
find . -type f -print -exec fromdos \{\} \;

2) make bin files executable:
chmod a+x bin/*

3) change the name of uClinux_and_SBCTools to "tools" because make was having a hard time matching it (by the way: it should be uClinux NOT ucLinux), I changed the existing directory names and all refences to it in all files (just a couple of these)

4) replaced C:/SBCToolsV2/Standard/ColdFire/gcc/m68k-elf-3.3.2/bin with /usr/local/m68k-elf/bin in build/gnu/mcf5xxx.comp and C:/SBCToolsV2/Standard/ColdFire/gcc/m68k-elf-3.3.2/lib/gcc-lib/m68k-elf/3.3.2/m5307 with /usr/local/lib/gcc-lib/m68k-elf/2.95.3/m5307

5) modified /proj/m5208evb/build/gnu/flash.ld to make data_ram bigger because they gave an error (probably because of difference in gcc versions)

6) renamed dbug_main to main in src/uif/main.c because that was preventing it from linking

This gets me most of the way there, but not quite.

After making the objects, I get:

------------------------------------------------------------
-------- M5208EVB dBUG for external Flash and SDRAM --------
------------------------------------------------------------

m68k-elf-ld -L/usr/local/lib/gcc-lib/m68k-elf/2.95.3/m5307 -v -T proj/m5208evb/build/gnu/flash.ld \
-Map obj/m5208evb/gnu/m5208evb_flash.map -o obj/m5208evb/gnu/m5208evb_flash.elf \
obj/m5208evb/gnu/cpu/coldfire/mcf5xxx/asm.o obj/m5208evb/gnu/cpu/coldfire/mcf5xxx/disasm.o obj/m5208evb/gnu/cpu/coldfire/mcf5xxx/mcf5xxx_hi.o obj/m5208evb/gnu/cpu/coldfire/mcf5xxx/mcf5xxx_lo.o obj/m5208evb/gnu/cpu/coldfire/mcf5xxx/mcf5xxx_uart.o obj/m5208evb/gnu/cpu/coldfire/mcf5xxx/vectors.o obj/m5208evb/gnu/cpu/coldfire/mcf5208/mcf5208_hi.o obj/m5208evb/gnu/cpu/coldfire/mcf5208/mcf5208_lo.o obj/m5208evb/gnu/uif/main.o obj/m5208evb/gnu/uif/cmds.o obj/m5208evb/gnu/uif/alloc.o obj/m5208evb/gnu/uif/assert.o obj/m5208evb/gnu/uif/history.o obj/m5208evb/gnu/uif/setshow.o obj/m5208evb/gnu/uif/stdlib.o obj/m5208evb/gnu/uif/isr.o obj/m5208evb/gnu/uif/msgs.o obj/m5208evb/gnu/uif/brktab.o obj/m5208evb/gnu/uif/symtab.o obj/m5208evb/gnu/uif/dl_srec.o obj/m5208evb/gnu/uif/printk.o obj/m5208evb/gnu/uif/fl.o obj/m5208evb/gnu/uif/image.o obj/m5208evb/gnu/uif/coff.o obj/m5208evb/gnu/uif/elf.o obj/m5208evb/gnu/uif/net/queue.o obj/m5208evb/gnu/uif/net/net.o obj/m5208evb/gnu/uif/net/dn.o obj/m5208evb/gnu/uif/net/up.o obj/m5208evb/gnu/uif/net/dn_srec.o obj/m5208evb/gnu/uif/net/dnsetshow.o obj/m5208evb/gnu/uif/net/arp.o obj/m5208evb/gnu/uif/net/icmp.o obj/m5208evb/gnu/uif/net/ip.o obj/m5208evb/gnu/uif/net/nbuf.o obj/m5208evb/gnu/uif/net/nif.o obj/m5208evb/gnu/uif/net/tftp.o obj/m5208evb/gnu/uif/net/udp.o obj/m5208evb/gnu/cpu/coldfire/mcf5xxx/mcf5xxx_fec.o obj/m5208evb/gnu/cpu/coldfire/mcf5xxx/mcf5xxx_fecbd.o obj/m5208evb/gnu/cpu/coldfire/mcf5xxx/mcf5xxx_timer.o obj/m5208evb/gnu/dev/flash/amd_flash.o obj/m5208evb/gnu/board/common/dldbug.o obj/m5208evb/gnu/board/common/setget.o obj/m5208evb/gnu/board/common/mcfserial.o obj/m5208evb/gnu/board/m5208evb/src/evbcmds.o obj/m5208evb/gnu/board/m5208evb/src/m5208evb.o obj/m5208evb/gnu/board/m5208evb/src/params.o obj/m5208evb/gnu/board/m5208evb/src/sc.o obj/m5208evb/gnu/board/m5208evb/src/sysinit.o obj/m5208evb/gnu/board/m5208evb/src/tools/delay.o obj/m5208evb/gnu/board/m5208evb/src/tools/decompress.o obj/m5208evb/gnu/board/build.o -lgcc
GNU ld version 2.10 (with BFD 2.10)
/usr/local/lib/gcc-lib/m68k-elf/2.95.3/m5307/libgcc.a(__main.o): In function `__do_global_ctors':
/home/davidm/work/uclinux-elf-tools/m68k-elf-gcc/gcc/../../gcc-2.95.3/gcc/libgcc2.c(.text+0x3e): undefined reference to `atexit'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/home/gunnar/AES/VIFXR/5208_DBUG/dbug'
make: *** [m5208evb] Error 2
0 Kudos

792 Views
GunnarRistroph
Contributor I
linking with libc.a by adding -lc to the linker options (right after -lgcc) solve the unresolved "atexit" problem (even though atexit isn't actually used), but then creates a conflict with "malloc" because "malloc" is defined in libc.a, but also has a definition in the dBug code, so I'll probably rename "malloc" to "mymalloc" or something

also, I've switched to using gcc 4.1.1
0 Kudos

792 Views
GunnarRistroph
Contributor I
To summarize progress so far, I downloaded 5208_DBUG.zip from the freescale website and unzipped it. I then:

1) converted all files to unix line endings:
find . -type f -print -exec fromdos \{\} \;

2) make bin files executable:
chmod a+x bin/*

3) change the name of uClinux_and_SBCTools to "tools" because make was having a hard time matching it (by the way: it should be uClinux NOT ucLinux), I changed the existing directory names and all refences to it in all files (just a couple of these)

4) replaced C:/SBCToolsV2/Standard/ColdFire/gcc/m68k-elf-3.3.2/bin with /usr/local/m68k-uclinux/bin in build/gnu/mcf5xxx.comp and C:/SBCToolsV2/Standard/ColdFire/gcc/m68k-elf-3.3.2/lib/gcc-lib/m68k-elf/3.3.2/m5307 with /usr/local/lib/gcc/m68k-uclinux/4.1.1/m5307

5) added "-lc" after "-lgcc" in proj/m5208evb/build/gnu/m5208evb.make

With these changes I can make clean and then make m5208evb and I actually get a 598Kb m5208evb_flash.s19 file with no errors in the make, but some warnings. I haven't tried out the binaries or made a fully tested patch.


m68k-elf-gcc or m68k-uclinux-gcc version 4.1.1 and rest of m68k toolchain from m68k-uclinux-tools-20060615.sh with GNU Make 3.81
0 Kudos

792 Views
GunnarRistroph
Contributor I
(I'm concerned that it may have linked with libc's malloc and not the malloc in src/uif/alloc.c)
0 Kudos

792 Views
GunnarRistroph
Contributor I
The m5208evb_flash.s19 file worked (programmed frow MS Windows with CF Flasher), so I guess it used the right malloc.
0 Kudos

792 Views
GunnarRistroph
Contributor I
In proj/m5208evb/build/gnu/flash.ld

user_space should have a LENGTH of 0x01FE0000
and USER_SPACE_SIZE should also be 0x01FE0000
0 Kudos