This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Error in creating arm toolchain without CT_ARCH_ARM_EABI option


There are many things that can go wrong here.  Turn on 'Kernel hacking'
and select the 'Verbose user fault messages'.  You might also want to
replace your filesystem with initramfs image and or just make a simple
hello world init.

Below is an ARM Linux program that should build without a library, etc.
Your init program might need libraries, etc.  Also, if your kernels page
fault handler doesn't map memory you can get the same symptom.  You can
compile the program, make it your init and see if it prints.

fwiw,
Bill Pringlemeir.


/* arm-none-eabi-gcc -I/home/src/linux/usr/include -nostdlib
hello_world.c -o hello_world */
#include <linux/unistd.h>

static inline int write(int fd, void *buf, int len)
{
    int rval;
    asm volatile ("mov  r0, %1\n\t"
        "mov     r1, %2\n\t"
                 "mov   r2, %3\n\t"
        "mov    r7, %4\n\t"
                "swi    #7\n\t"
        "mov    %0, r0\n\t"
                : "=r" (rval)
                  : "r" (fd),
                      "r" (buf),
                            "r" (len),
                                  "Ir" (__NR_write)
                                       : "r0", "r1", "r2", "r7");
    return rval;
}

struct timespec {
    long   tv_sec;        /* seconds */
    long   tv_nsec;       /* nanoseconds */
};

static inline int nanosleep(const struct timespec *req, struct timespec
*rem)
{
    int rval;
    asm volatile ("mov  r0, %1\n\t"
        "mov     r1, %2\n\t"
        "mov    r7, %3\n\t"
                "swi    #7\n\t"
        "mov    %0, r0\n\t"
                : "=r" (rval)
                  : "r" (req),
                      "r" (rem),
                            "Ir" (__NR_nanosleep)
                                 : "r0", "r1", "r2", "r7");
    return rval;
}


#define print_it(a)  write(0, (a), sizeof((a)))
int _start(void)
{
    int i;
    struct timespec ts = { 300000, 0 };
    for(i = 0; i < 5; i++) {
        if(nanosleep(&ts, 0))
            print_it ("Sleep failed.\n");
        print_it ("Hello World.\n");
    }
    print_it ("Good-bye cruel world.\n");
    return 0;
}


On 25 Feb 2011, sami.md.ko@gmail.com wrote:

> Hi Yann E. MORIN
>
> Â Â Â ÂThanks for the help.
> Â Â Â ÂI tried to build my arm-toolchain without EABI on X86_64
> Â Â Â Âmachine and the build was successful
>
> Â Â Â ÂThen i compiled kernel and created Âfilesystem using this newly
> Â Â Â Âcreated arm toolchain.
>
> Â Â Â ÂHowever board is not booting, it stops after "Freeing init Memory"
>
> Â Â Â ÂPls let me know what could be the problem. I guess that
> Â Â Â Âsince Im creating a non EABI toolchain i need to give name of the
> Â Â Â Âspecific ABI i.e CT_ARCH_ABI Âduring ct-ng configuration.
>
> Â Â Â ÂHow to find what what CT_ARCH_ABI option to use for my ARM soc ?
>
> Â Â Â ÂPls find my kernel_config, build.log and ctng_config in attachment.
>
> Â Â Â ÂNote: EABI is disabled in kernel.
>
> Thanks
> Sami
>
>
> On Wed, Feb 23, 2011 at 5:09 AM, Yann E. MORIN
> <yann.morin.1998@anciens.enib.fr> wrote:
>> Sami, All,
>>
>> On Tuesday 22 February 2011 12:32:24 sami md wrote:
>>> I am creating a gcc-4.3.3,glibc-2.9 based toolchain for ARM SoC with
>>> crosstool-ng.
>>> When "Use EABI" (i.e. CT_ARCH_ARM_EABI) option is set in "Target
>>> Options" the toolchain is created properly and also works fine.
>>>
>>> But if i dont select "Use EABI" option, i get below errors:
>> [--SNIP--]
>>
>> It works fine on my x86_64 machine, but on a i686, it breaks?!?...
>> Wooopsss... :-( I'll look later, now is time for bed... :-O
>>
>>> The build.log and config files are attached.
>>
>> I could not use your .config as-is, as you are using custom kernel headers.
>> So I used latest ones (2.6.37.1).
>>
>> Regards,
>> Yann E. MORIN.
>>
>> --
>> .-----------------.--------------------.------------------.--------------------.
>> | ÂYann E. MORIN Â| Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
>> | +33 662 376 056 | Software ÂDesigner | \ / CAMPAIGN Â Â | Â___ Â Â Â Â Â Â Â |
>> | +33 223 225 172 `------------.-------: ÂX ÂAGAINST Â Â Â| Â\e/ ÂThere is no Â|
>> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL  Â|  v  conspiracy. Â|
>> '------------------------------^-------^------------------^--------------------'
>>

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]