[Klone-users] Compilation for elf m68k

thomas fossati tho at koanlogic.com
Tue Apr 8 04:09:31 EDT 2008


Hi Mickael,

yesterday I installed the uclinux stuff (http://www.uclinux.org/get_started/uClinuxbeginner.html 
) and did the basic steps as described in the following paragraphs:

	* download the tools
	* m68k-elf toolchain
	* uClinux distribution
	* compiling the basics

In the end the m68k-elf toolchain is in /usr/local/bin - which is my  
shell's PATH - while the uclinux tree is at /opt/uClinux-dist (just  
like yours).

Next I've created a custom makl toolchain with needed C and LD flags:

=-=-=-=-=-=-=-=-=-=-=-=
UCLIBC_INCS = /opt/uClinux-dist/uClibc/include
M68K_ELF_CFLAGS = -I${UCLIBC_INCS} -m5200 -msep-data -D__UCLINUX__
M68K_ELF_CXXFLAGS = ${M68K_ELF_CFLAGS}

CC = m68k-elf-gcc ${M68K_ELF_CFLAGS}
LDFLAGS = -Wl,-elf2flt -lc
CXX = m68k-elf-g++ ${M68K_ELF_CXXFLAGS}
CXXFLAGS = ${CFLAGS}
AR = m68k-elf-ar
RANLIB = m68k-elf-ranlib
LD = m68k-elf-ld
NM = m68k-elf-nm
STRIP = m68k-elf-strip
=-=-=-=-=-=-=-=-=-=-=-=

Then I've tried out a plain make and in fact it failed :)

The failure is due to a bug in makl: it simply ignores the {C,LD}FLAGS  
provided in the toolchain when doing test compilation in the  
autoconfigure step ... ok fixed (see attached file).

Provided that you copy the makl.patch and m68k-elf.tc files in the  
same directory as the top-level klone Makefile, that's how it looks  
like:

=-=-=-=-=-=-=-=-=-=-=-=
KLONE_VERSION = 2.0.2

KLONE_CONF_ARGS = --enable_debug

KLONE_CUSTOM_TC = $(CURDIR)/m68k-elf.tc

KLONE_IMPORT_ARGS = -v

KLONE_TARGET_PATCH_FILE = $(CURDIR)/makl.patch

WEBAPP_DIR = $(CURDIR)/webapp

include klapp.mk

klapp.mk: ; wget -O $@ http://koanlogic.com/klone/klapp.mk
=-=-=-=-=-=-=-=-=-=-=-=

At this point a

$ make NO_TEST=true

should go till the end of the cross-build process.

Hope it helps, t.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: m68k-elf.tc
Type: application/octet-stream
Size: 379 bytes
Desc: not available
Url : http://koanlogic.com/pipermail/klone-users/attachments/20080408/5ff437c4/m68k-elf.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 279 bytes
Desc: not available
Url : http://koanlogic.com/pipermail/klone-users/attachments/20080408/5ff437c4/Makefile.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: makl.patch
Type: application/octet-stream
Size: 541 bytes
Desc: not available
Url : http://koanlogic.com/pipermail/klone-users/attachments/20080408/5ff437c4/makl.obj


More information about the klone-users mailing list