Thank you very much for your replies. 
If I understood you well, my original task (use IAR generated library in SDCC) is also not feasible?

Do you know of any other C compiler that I might use as a replacement for SDCC. I also need my project to be as safe and reliable as possible. Maybe choosing an open source compiler is not a good decision? I would need something that's cheaper than IAR...?

Thanks in advance
Sanita


On Thu, Feb 13, 2014 at 10:03 AM, Maarten Brock <sourceforge.brock@dse.nl> wrote:
Hello Sanita,

This is virtually impossible. There is no standard calling convention for
8051. Every compiler uses its own invention, be it IAR, Keil or SDCC.
AFAIK only Raisonance and Keil are compatible. On top of that every
compiler uses its own object and library format. IAR has no clue how to
interpret the contents of an SDCC generated .rel file nor how to interpret
the sdcclib generated library. SDCC has another tool for generating
libraries called sdar which is similar to gnu AR, but I don't believe IAR
can handle that either.

I'll make the story even worse. It's already difficult to keep source code
compatible between these compilers. The use of <compiler.h> might help a
bit with that.

The above is true for almost every microcontroller and its different
compiler tools. Only for modern 32-bit controllers there is an EABI
definition that is followed by many tools.

Maarten

> Hello,
>
> I've started working with SDCC a few days ago and, naturally, I have some
> issues. I'm hoping you can help me solve them. I went through the mailing
> list archive and I didn't see a similar question.
>
> I have a project for 8051 that requires IAR Workbench and SDCC working
> together. That is, some parts of the project will be done in IAR and
> should
> later, as a library file, be included in a .c file made with SDCC.
> For starters I'm just trying to do the opposite, to see how SDCC and IAR
> work together. What I'm doing is:
> - create an example.c file that includes 8051.h file from SDCC\include and
> write to port P0 i.eg. P0=0x01;
> - make a .lib out of it "sdcclib examplelib.lib example.rel"
> - go to IAR, add this .lib file to my project. I've also added the path to
> my lib in the preprocessor.
> - use the functions from my examplelib library in my IAR project
>
> However, this does not work. When I add the library and try to build the
> project, I keep getting the error: "Fatal Error[e8]: Corrupt file.
> Unknown
> or misplaced tag encountered in module NO MODULE NAME ( C:\...\pstlib.lib
> ). Tag  unknown [67]", "Error while running linker".
>
> Am I missing anything?
> Thanks in advance.
> Sanita


------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user