This topic contains 9 replies, has 2 voices, and was last updated by Maurizio 9 years, 2 months ago.
-
AuthorPosts
-
February 4, 2015 at 5:50 am #23133
MaurizioHi all, I would like to use ellcc to generate code for my ARM core-M3 target.
Due to very limited resources I need to be bare-metal without any additional library.I did a few initial tests by cross-compiling a sample test program on a Windows host but I get some strange errors related to duplicate file inclusions, missing type definitions etc. The same example complies and runs perfectly with gcc 4.7 and gcc 4.9 so I’m a bit confused.
Any suggestions? Is the window version of ellcc reliable or is it better to use the linux one?
Thanks
MaurizioFebruary 4, 2015 at 6:05 am #23135Hi Maurizio,
I’d also like to see Cortex-M3 supported by ELLCC. Could you post an example of what you’re trying to compile? I’ll take a look to see how we can start folding at least some bare metal functionality in for Cortex-M. It is probably just a matter of creating the appropriate config file.
-Rich
February 4, 2015 at 7:04 am #23138
MaurizioHi Rich, thanks for your reply.
Actually I have two different issues:
1) understanding if the code generated is suitable for a bare-metal CortexM3. At the moment I’m compiling with-target arm-elk-engeabi -mthumb -mcpu=cortex-m3
Not sure if this is enough or I also have to modify some config file.2) The compile-time errors I was mentioning in my previous post. I did a few more investigations, it seems they are related to the
#pragma once
directive. If I replace them with the good old#ifndef myfileneme / #define myfilename .. #endif
compilation is ok.Thanks for any suggestion
MaurizioFebruary 5, 2015 at 6:49 am #23170Hi Maurizio,
A quick status update. I’m working on the Cortex-M3 in my spare time. Here’s what I have so far. I created a config file called thumb-linux-engeabi (in ellcc/libecc/config):
based_on: arm-ellcc-linux compiler: options: - -target arm-ellcc-linux - -mthumb - -mcpu=cortex-m3 - -mfpu=none - -mfloat-abi=softfp linker: static_crt1: $R/lib/thumb-linux-engeabi/crt1.o dynamic_crt1: $R/lib/thumb-linux-engeabi/Scrt1.o crtbegin: $R/lib/thumb-linux-engeabi/crtbegin.o crtend: $R/lib/thumb-linux-engeabi/crtend.o library_paths: - -L$R/lib/thumb-linux-engeabi
I modified ellcc/libecc/src/musl/configure by adding the following line:
thumb*) ARCH=arm ;;
Then in the ellcc/libecc directory, I can try to make the C library:
make thumb-linux-engeabi
If I disable building assembly language files, all the C files compile. Now it is a matter of modifying the assembly code to be thumb compatible.
I plan to use this Linux library for testing, and then add support for standalone ELK.-Rich
February 5, 2015 at 8:46 am #23173
MaurizioThanks Rich, I’m also working on this in background, I’ll try to follow what you are doing..
-mFebruary 8, 2015 at 7:13 pm #23255Hi Maurizio,
Version 0.1.10 has preliminary Cortex-M support. Any feedback appreciated.
-Rich
February 12, 2015 at 11:47 am #23283
MaurizioHi Rich, that’s great! I will give it a try when I have a moment…!
Best regards
MaurizioFebruary 14, 2015 at 3:29 pm #23294
MaurizioHi Rich, I’ve seen the new thumb-linux-engeabi configuration..
One thing is not clear to me: can I try to use this version for my bareboard target or the libraries are somehow linux-specific?Thanks
-mFebruary 14, 2015 at 3:55 pm #23295Hi Maurizio,
I haven’t finished the bare-metal support for the M3 yet. I’m hoping to get it done, or at least usable by the end of the weekend.
-Rich
February 15, 2015 at 1:30 am #23299
MaurizioI’m in no hurry, we are using GCC at the moment and it is fine. I just wanted to evaluate if with an llvm-based compiler we could get enough advantages in term of code optimizations that would justify the transition.
Have a nice weekend!
-m -
AuthorPosts
You must be logged in to reply to this topic.