Discussion:
will netbsd be sticking with gcc?
Mayuresh Kathe
2014-06-18 02:10:52 UTC
Permalink
hello,

i just read a note somewhere on the web about netbsd folks trying
out an alternative compiler set (pcc).

did that not work out?

i have heard good things about pcc, mostly, except for perhaps the
fact that it doesn't yet support all the netbsd platforms which
gcc does.

so does that mean gcc would be the default compiler set for the
foreseeable future?

best,

~mayuresh
Martin Husemann
2014-06-18 06:19:04 UTC
Permalink
Post by Mayuresh Kathe
i have heard good things about pcc, mostly, except for perhaps the
fact that it doesn't yet support all the netbsd platforms which
gcc does.
And it has no C++ compiler.

We live with several compilers in-tree and try to officialy support
anything sane (even outside the tree, e.g. gcc 4.9 for playstation2
support, but that part is broken currently) - the exact choice depends,
as you note, on the architecture.

If you are building NetBSD for x86 or arm you can choose clang/llvm as
an alternative compiler, and you can compile big parts of NetBSD with pcc.
We are especially looking at pcc for m68k, as some machines (e.g. sun2)
are not able to execute modern gcc at all (or for anything > hello world
type of programs). Gcc is nice for cross-building those ports, but not as
a native compiler shipped with the system.


Martin
Mayuresh Kathe
2014-06-18 06:46:18 UTC
Permalink
Post by Martin Husemann
Post by Mayuresh Kathe
i have heard good things about pcc, mostly, except for perhaps the
fact that it doesn't yet support all the netbsd platforms which
gcc does.
And it has no C++ compiler.
We live with several compilers in-tree and try to officialy support
anything sane (even outside the tree, e.g. gcc 4.9 for playstation2
support, but that part is broken currently) - the exact choice depends,
as you note, on the architecture.
If you are building NetBSD for x86 or arm you can choose clang/llvm as
an alternative compiler, and you can compile big parts of NetBSD with pcc.
We are especially looking at pcc for m68k, as some machines (e.g. sun2)
are not able to execute modern gcc at all (or for anything > hello world
type of programs). Gcc is nice for cross-building those ports, but not as
a native compiler shipped with the system.
true, it has incomplete c++ support, but i think ragge is working on it.

i am looking to build as much of netbsd (without x11) with pcc as possible.
this is a purely tinkering and experimenting project.
may i know which parts of netbsd don't build with pcc? and why?

also, i'm still quite raw at netbsd, but, is it possible to eliminate
portions of the netbsd kernel and build a fresh, highly focused and optimised
system for amd64 architectures? and yet be able to tap into pkgsrc?

gcc is nice, but massive, on the other hand, pcc is quite nimble. :)

best,

~mayuresh
Martin Husemann
2014-06-18 07:04:42 UTC
Permalink
Post by Mayuresh Kathe
may i know which parts of netbsd don't build with pcc? and why?
Groff, atf (or parts of it), and libunwind probably - as they contain C++
code.
Post by Mayuresh Kathe
also, i'm still quite raw at netbsd, but, is it possible to eliminate
portions of the netbsd kernel and build a fresh, highly focused and optimised
system for amd64 architectures? and yet be able to tap into pkgsrc?
Yes, sure - look at your dmesg and remove everything from the config file
that is not needed. A trimmed down kernel does not affect userland or
pkgsrc usually (besides the obvious things: if you remove NFS, you won't
be able to use it, same goes for INET6 or some of the pseudo-devices like
bpf).

Martin
Thomas Mueller
2014-06-18 03:57:25 UTC
Permalink
Post by Mayuresh Kathe
i just read a note somewhere on the web about netbsd folks trying
out an alternative compiler set (pcc).
did that not work out?
i have heard good things about pcc, mostly, except for perhaps the
fact that it doesn't yet support all the netbsd platforms which
gcc does.
so does that mean gcc would be the default compiler set for the
foreseeable future?
I've seen some activity toward switching to llvm/clang, at least on i386, amd64 and evbarm-earm.

See http://releng.netbsd.org/cgi-bin/builds.cgi

FreeBSD has already switched to llvm/clang as the default compiler with 10.0 on i386 and amd64, and I think also sparc.

Tom
Matt Thomas
2014-06-18 07:13:11 UTC
Permalink
Post by Mayuresh Kathe
hello,
i just read a note somewhere on the web about netbsd folks trying
out an alternative compiler set (pcc).
did that not work out?
Actually, NetBSD has 3 possible compilers: gcc, clang/llvm, and pcc.
Each compiler works for its subsets of targets.
Post by Mayuresh Kathe
i have heard good things about pcc, mostly, except for perhaps the
fact that it doesn't yet support all the netbsd platforms which
gcc does.
so does that mean gcc would be the default compiler set for the
foreseeable future?
Probably. Though my aarch64 (64 bit arm) is currently clang/llvm only.
William D. Jones
2014-06-19 22:03:02 UTC
Permalink
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?

-----Original Message-----
From: Matt Thomas
Sent: Wednesday, June 18, 2014 3:13 AM
To: Mayuresh Kathe
Cc: netbsd-***@netbsd.org
Subject: Re: will netbsd be sticking with gcc?


Actually, NetBSD has 3 possible compilers: gcc, clang/llvm, and pcc.
Each compiler works for its subsets of targets.

--
William D. Jones
Rowan University | ECE | 2012
Member IEEE
Member Tau Beta Pi
***@comcast.net
Message sent using 'Windows Live Mail' client.
Martin Husemann
2014-06-20 07:05:33 UTC
Permalink
This post might be inappropriate. Click to display it.
Aaron J. Grier
2014-09-14 03:47:25 UTC
Permalink
And of course we would accept patches that make [NetBSD] work with yet
another compiler. Are there any out there you are interested in
especially?
anybody tried compiling NetBSD/amd64 with the Intel icc toolchain recently?
--
Aaron J. Grier | "Not your ordinary poofy goof." | ***@poofygoof.com
Christos Zoulas
2014-09-14 14:23:02 UTC
Permalink
Post by Aaron J. Grier
And of course we would accept patches that make [NetBSD] work with yet
another compiler. Are there any out there you are interested in
especially?
anybody tried compiling NetBSD/amd64 with the Intel icc toolchain recently?
Last time I checked it was fairly expensive, required a license server,
and the installer was nightmarish.

christos
Alexander Nasonov
2014-09-14 18:06:53 UTC
Permalink
Post by Christos Zoulas
Post by Aaron J. Grier
And of course we would accept patches that make [NetBSD] work with yet
another compiler. Are there any out there you are interested in
especially?
anybody tried compiling NetBSD/amd64 with the Intel icc toolchain recently?
Last time I checked it was fairly expensive, required a license server,
and the installer was nightmarish.
I don't see why anyone would want to compile the base with icc,
even if it's the latest version but you can try lang/icc11 if you
can still find distro files. It's free for non-commercial use.

I don't think I tried compiling the base with lang/icc11 but I
could compile and run many packages (but few were broken).

Alex
Aaron J. Grier
2014-09-14 23:26:22 UTC
Permalink
Post by Christos Zoulas
Post by Aaron J. Grier
And of course we would accept patches that make [NetBSD] work with
yet another compiler. Are there any out there you are interested in
especially?
anybody tried compiling NetBSD/amd64 with the Intel icc toolchain recently?
Last time I checked it was fairly expensive, required a license
server, and the installer was nightmarish.
which is your roundabout way of saying that you haven't tried it? :)
--
Aaron J. Grier | "Not your ordinary poofy goof." | ***@poofygoof.com
Christos Zoulas
2014-09-14 23:52:19 UTC
Permalink
Post by Aaron J. Grier
Post by Christos Zoulas
Post by Aaron J. Grier
And of course we would accept patches that make [NetBSD] work with
yet another compiler. Are there any out there you are interested in
especially?
anybody tried compiling NetBSD/amd64 with the Intel icc toolchain recently?
Last time I checked it was fairly expensive, required a license
server, and the installer was nightmarish.
which is your roundabout way of saying that you haven't tried it? :)
I have not tried it on NetBSD because I don't think it is worth it.
The version that used to be freely available is too buggy to have
me waste time with it.

No, it is my way of saying that although the quality of the compiler
is getting better, the licensing and installer are getting worse.

When it works, it usually is 10-20% faster than gcc and even more
when it handles the vectorization cases that gcc currently ignores.
Unfortunately it has some poor interaction with files that contain
both assembly and c... And sometimes it produces incorrect code,
but don't all compilers?

christos

Loading...