Subject: Re: TenDRA compiler __RENAME and more
To: None <>
From: =?iso-8859-1?Q?Sebasti=E1n_J._D=B4Alessandro?= <>
List: tech-userlevel
Date: 08/01/2004 21:39:13
Thanks christos,

                        I will see if I can port it. One more question, if
I´d made a library with the function foo ( renamed to __foo13 ), ones
compiled with a compiler respecting the __RENAME this library will keep the
name __foo13 inside (I used the command nm to verify it), so the problem
would be if I link this library with a program compiled with the tendra
compiler that is ignoring the __RENAME because it will keep the name "foo"
in the program (not __foo13), and will give me an error of undefined
reference to "foo"... so the only way of working now with the compiler would
be using the renamed names ( like __foo13) until I port it (of course not
using this functions will work too). I assumed that tendra it self never
uses a function that was __RENAMED in the code because it compiled fine.
                        The question is: why is required the __RENAME
definition on the system?, returning to the example, why would I define in a
program a function with 2 names (2 names before compiling)? Is this because
the function was named diferent among other systems and this way someone can
compile the program on all them?. I´m sorry if it obvious, I just don´t know
why __RENAME was created.

Sebastián D´Alessandro.

----- Original Message ----- 
From: "Christos Zoulas" <>
To: <>
Sent: Sunday, August 01, 2004 6:45 PM
Subject: Re: TenDRA compiler __RENAME and more

> In article <001201c47802$108bed90$d4c9f4d8@q>,
> Sebastián J. D´Alessandro <> wrote:
> >
> >Hello,
> >
> >            I´ve compiled the Tendra C/C++ Compiler
> >on NetBSD/i386 1.6ZI. I needed to make a few changes on the source files
> >finally it compiles (with gcc and tcc when it is available) and works. I
> >would
> >like to know if the changes are fine and if they are not, why?.
> >
> >            There are two changes that I don´t fully understand, first
> >sources of TenDRA redefine: _POSIX_NGROUPS_MAX, _POSIX_OPEN_MAX,
> >_POSIX_PATH_MAX. I commented them and let the ones of system effective,
> >this correct?
> >
> >            The second problem is about the definition of __RENAME, all
> >posibilities of defining __RENAME creates problems during compiling. I
> >solved the problem adding to cdefs.h the following:
> >
> >                    + #ifdef __TenDRA__
> >                    + #define __RENAME(x)
> >                    + #else
> >                    #error "No function renaming possible"
> >                    + #endif
> >
> >            What are the consecuences of the last change?. I would like
> >hear the opinion of an advanced user, that fully understand the play of
> >and the play of __RENAME during the compilation of the compiler.
> >
> >            A complete explanation of the changes and the way of repeat
> >is
> >in my page
> >
> >Thanks, Sebastián D´Alessandro.
> The _POSIX_FOO defines, don't matter. The __RENAME(x) macro you need to
> port to the equivalent for the tendra compiler.
> void foo(void) __RENAME(__foo13);
> is functionally equivalent to defining:
> void __foo13(void);
> to be the same as foo.
> christos