tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] tinycc on arm


From: Daniel Glöckner
Subject: Re: [Tinycc-devel] tinycc on arm
Date: Wed, 3 Sep 2008 15:17:04 +0200
User-agent: Mutt/1.4.2.1i

On Wed, Sep 03, 2008 at 04:23:50PM +0800, ccecping wrote:
>  /usr/lib/crtl.o: invalid object file
>  /usr/lib/crti.o: invalid object file
>  /usr/lib/libm.so:bad architecture
>  /usr/lib/libm.a: invalid object file
>  tcc: cannot find -lm
>  make:*** [tcc] Error 1

It needs crt1.o, crti.o, crtn.o, libm, and libc compiled for ARM.

Copy the filesystem from your ARM system to /somewhere/on/your/pc.
In tcc.c change
#define CONFIG_TCC_CRT_PREFIX "/usr/lib"
to
#define CONFIG_TCC_CRT_PREFIX "/somewhere/on/your/pc/usr/lib"

Change the lines
    tcc_add_library_path(s, "/usr/local/lib");
    tcc_add_library_path(s, "/usr/lib");
    tcc_add_library_path(s, "/lib");
to
    tcc_add_library_path(s, "/somewhere/on/your/pc/usr/local/lib");
    tcc_add_library_path(s, "/somewhere/on/your/pc/usr/lib");
    tcc_add_library_path(s, "/somewhere/on/your/pc/lib");

Change the lines
        tcc_add_sysinclude_path(s, "/usr/local/include");
        tcc_add_sysinclude_path(s, "/usr/include");
to
        tcc_add_sysinclude_path(s, "/somewhere/on/your/pc/usr/local/include");
        tcc_add_sysinclude_path(s, "/somewhere/on/your/pc/usr/include");

In tcctok.h change
     DEF(TOK___slltold, "__slltold")
to
     DEF(TOK___slltold, "__floatdidf")

In tccelf.c change
        snprintf(buf, sizeof(buf), "%s/%s", tcc_lib_path, "libtcc1.a");
        tcc_add_file(s1, buf);
to
        tcc_add_file(s1,"/somewhere/on/your/pc/lib/libgcc_s.so.1");
(libgcc_s.so.1 might be in another directory)

In Makefile change
        $(CC) $(CFLAGS) -DTCC_TARGET_ARM -DTCC_ARM_EABI -o $@ $< $(LIBS)
to
        $(CC) $(CFLAGS) -DTCC_TARGET_ARM -o $@ $< $(LIBS)

Recompile arm-tcc with gcc.

To build the final tcc, remove all occurences of the string
"/somewhere/on/your/pc".

  Daniel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]