Subject: Re: lib/36511: lcc is an ANSI C compiler for a variety of platforms
To: None <lib-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Aleksey Cheusov <cheusov@tut.by>
List: netbsd-bugs
Date: 06/27/2007 21:00:04
The following reply was made to PR lib/36511; it has been noted by GNATS.
From: Aleksey Cheusov <cheusov@tut.by>
To: Martin Husemann <martin@duskware.de>
Cc: gnats-bugs@NetBSD.org
Subject: Re: lib/36511: lcc is an ANSI C compiler for a variety of platforms
Date: Wed, 27 Jun 2007 23:56:59 +0300
> On Wed, Jun 27, 2007 at 08:18:40PM +0300, Aleksey Cheusov wrote:
>> I'm not sure that *non-standard* __asm directive can be allowed if
>> __STDC__ is defined. Can you explain this?
> I'm not sure what code you quote - it is not in NetBSD AFAICS.
sys/sys/cdefs_elf.h revision 1.27
41 #if __STDC__
42 #define ___RENAME(x) __asm(___STRING(_C_LABEL(x)))
43 #else
44 #ifdef __LEADING_UNDERSCORE
54 #if __STDC__
55 #define __strong_alias(alias,sym)
56 __asm(".global " _C_LABEL_STRING(#alias) "\n"
57 _C_LABEL_STRING(#alias) " = " _C_LABEL_STRING(#sym));
99 #if __STDC__
100 #define __SECTIONSTRING(_sec, _str)
101 __asm(".section " #_sec "\n\t.asciz \"" _str "\"\n\t.previous")
102 #else
103 #define __SECTIONSTRING(_sec, _str)
104 __asm(".section _sec\n\t.asciz _str\n\t.previous")
105 #endif
>> P.S.
>> It's not clear for me what things should be fixed?
>> LCC itself or NetBSD includes or both?
> I think both.
> How about we protect the whole __RENAME(x) block in NetBSD's cdefs.h by
> #ifndef __RENAME / #endif
> and modify lcc to provide a working __RENAME(x) macro? We don't need
> to special case __LCC__ then and can use the same for other
> compilers.
This sounds reasoble but I don't know what is this __RENAME macro and
"function renaming" for.
And why an absense of it is a fatal error
sys/cdefs.h:
254 #error "No function renaming possible"
wip/tcc fails because of this.
--
Best regards, Aleksey Cheusov.