Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: will netbsd be sticking with gcc?



It appears my original message got eaten by the mailing list... now that I've 
noticed,
I'll resend it.

I see... well, that's one solution to not being locked into GCC's 
extensions (#define them away)!

A compiler I'd be interested in seeing compile NetBSD would be OpenWatcom, 
at least when version 2.0 comes out in the next 10 years :P; in it's current 
state, the POSIX wrapper for OpenWatcom is broken, and it's not fully C99 
compliant yet. More specifically, I'm interested in just seeing more C 
compilers be able to compile the Open Source Unix-like systems, since GCC 
has a reputation for being a nightmare to port to new instruction sets. But 
these are just my random musings- not something I'm currently ready to spend 
time doing (emphasis on currently).

Additionally, I have successfully gotten tinyCC (Fabrice Bellard's C99 
compiler) to
compile successfully by defining __NETBSD__ as a platform. However, it is 
currently
unable to compile executables because NetBSD isn't aware internally that tinyCC
can perform ELF symbol renaming:
pbbsd$ gmake test
gmake -C tests test
gmake[1]: Entering directory '/home/wjones/src/tcc-0.9.26/tests'
------------ hello-exe ------------
../tcc -B.. ../examples/ex1.c -o hello || (../tcc -vv; exit 1) && ./hello
tcc: error: file 'crt1.o' not found
In file included from ../examples/ex1.c:2:
In file included from ../include/tcclib.h:10:
In file included from /usr/include/stddef.h:37:
/usr/include/sys/cdefs.h:375: error: #error "No function renaming possible"

The "tcc: error: file 'crt1.o' not found" is also questionable. I'll look into 
it when I have some time.

----- Original Message -----
From: "Martin Husemann" <martin%duskware.de@localhost>
To: "William D. Jones" <thor0505%comcast.net@localhost>
Cc: netbsd-users%netbsd.org@localhost
Sent: Friday, June 20, 2014 3:05:33 AM
Subject: Re: will netbsd be sticking with gcc?

On Thu, Jun 19, 2014 at 06:03:02PM -0400, William D. Jones wrote:
> I know that deep within the source tree (I believe it's somewhere in 
> $SRCROOT/share/mk), there is a piece of documentation which explains that 
> portions of NetBSD depend on GCC's extensions... so that limits compilers 
> which can compile NetBSD to clang/llvm and GCC... however, is there any 
> documentation which describe which source files depend on what extensions?

That is not really a limitation, and pcc imlements enough of the
extensions as well (for C code). But we nowadays require C99 support,
so that rules out the most nasty stranglers upfront.

Most of this is abstracted away from the actual compiler in 
src/sys/sys/cdefs.h and everything relying on an extension not 
macro-magicalized there could be called a bug (worth a PR).

And of course we would accept patches that make it work with yet another
compiler. Are there any out there you are interested in especially?

Martin


Home | Main Index | Thread Index | Old Index