Slashdot Mirror


GCC Compiler Finally Supplanted by PCC?

Sunnz writes "The leaner, lighter, faster, and most importantly, BSD Licensed, Compiler PCC has been imported into OpenBSD's CVS and NetBSD's pkgsrc. The compiler is based on the original Portable C Compiler by S. C. Johnson, written in the late 70's. Even though much of the compiler has been rewritten, some of the basics still remain. It is currently not bug-free, but it compiles on x86 platform, and work is being done on it to take on GCC's job."

100 of 546 comments (clear)

  1. "Nothing for you to see here" indeed... by RLiegh · · Score: 4, Interesting

    I notice that TFS doesn't say that anyone is actually able to compile anything (other than PCC) with it. The BSD folks would love to have a BSD-licensed drop-in replacement for GCC; but it doesn't sound like this is it. Not yet at least.

    Wake me up when you're able to use PCC instead of GCC to do a 'make world' (or ./build.sh or whatever).

    1. Re:"Nothing for you to see here" indeed... by DiegoBravo · · Score: 3, Insightful

      ...Wake me up when you're able to use PCC instead of GCC to do a 'make bzImage'

    2. Re:"Nothing for you to see here" indeed... by Sigismundo · · Score: 2, Interesting

      Indeed, the linked article says that PCC is 5-10 times faster than GCC, but currently performs only one optimization... What use is speed of compilation of the binaries produced are slower?

    3. Re:"Nothing for you to see here" indeed... by MissP · · Score: 3, Insightful

      With respect to

      "The BSD folks would love to have a BSD-licensed drop-in replacement for GCC"

      could somebody provide a reference to verify that "the BSD folks" do in fact have such a desire?

      Thanks!

    4. Re:"Nothing for you to see here" indeed... by TheRaven64 · · Score: 5, Interesting
      This has been on Undeadly for a few days now. There was a very informative post by Marc Espie (who maintains GCC on OpenBSD) explaining this.

      This has been a long time coming. If you've ever looked at GCC code, you'll be familiar with the feeling of wanting to claw your eyes out (I had to for an article on the new Objective-C extensions *shudder*). I am somewhat surprised it's PCC not LLVM, but it makes sense. OpenBSD wants a C compiler in the base system, that can compile the base system and produces correct code. Support for C++, Objective-C, Java and Fortran would all be better off in ports. PCC is faster than GCC, smaller than GCC, more portable than GCC, easier to audit than GCC, and already compiles the OpenBSD userspace. I wouldn't be surprised if it replaces GCC in the OpenBSD base system soon. If it does, GCC (or maybe LLVM) will still probably be one of the first things I install from ports, but I'd still regard it as a good idea.

      --
      I am TheRaven on Soylent News
    5. Re:"Nothing for you to see here" indeed... by j-pimp · · Score: 3, Interesting

      ...Wake me up when you're able to use PCC instead of GCC to do a 'make bzImage'

      You bring up a good point. For years I have been looking for an open source compiler thats about the same quality as GCC, but is anything but GCC. I'm not too picky about the politics, as long as there a different set of politics from the GCC politics. I had great hope for Open Watcom, but the license was bad enough for debian to consider it non free, and they are not actively trying to be an alternative to GCC. Its quite a shame, but I really don't blame them. Technically Watcom is about ready for primetime on linux,they just need to get enough people to periodically try to compile there pet open source linux program with it and send a "I cant get this to work" mail to the list, but no one seems to care. PCC, on the other hand has a much larger set of people that have a reason to like PCC for reasons other than its not gcc./p>

      --
      --- Justin Dearing http://www.justaprogrammer.net/ We're just programmers.
    6. Re:"Nothing for you to see here" indeed... by Richard_at_work · · Score: 3, Informative

      At one point in GCC's history (infact, not all that long ago), you couldn't even use GCC to do that - there was a big issue about Red Hat shipping a version of GCC by default that could not compile the Linux kernel, you had to install another earlier version if you wanted to do that.

    7. Re:"Nothing for you to see here" indeed... by Sam · · Score: 2, Interesting

      It already compiles the majority of the OpenBSD source tree, and did so before it was imported. Work is now going on to make it compile everything.

      --
      29 Ways to decline a Date : 10 - I'd love to go out with you but I'm attending the opening of my garage door.
    8. Re:"Nothing for you to see here" indeed... by szo · · Score: 3, Interesting

      I don't follow politics, so care to explain what's wrong with gcc's politics? Or, what _is_ gcc's politics?

      --
      Red Leader Standing By!
    9. Re:"Nothing for you to see here" indeed... by j-pimp · · Score: 2, Interesting

      The page you linked to says a Linux and a FreeBSD port are undergoing.

      The linux compiler has worked at times and they went as far as writing a binary called owcc that takes standard posix flags for cc and executes wcc with the equivilant args. You can get working linux binaries and they will compile non trivial code if you try hard enough.

      The point is that yes Watom lacks in some areas technically. However, and this is especially true on windows where it works great, it more of an issue of lack of interest that makes it a GCC alternative.

      --
      --- Justin Dearing http://www.justaprogrammer.net/ We're just programmers.
    10. Re:"Nothing for you to see here" indeed... by synthespian · · Score: 4, Informative
      Here's the content (just so it stays in this Slashdot thread and gets archived here).

      Re: BSD Licensed PCC Compiler Imported (mod 21/25)
      by Marc Espie (213.41.185.88) (espie@openbsd.org) on Sun Sep 16 13:28:48 2007 (GMT)
                  > > I am saying think this through and carefully. Rewriting a giant suite of programs just because you don't agree with the philosophy behind it sounds awful to people who have no stakes in BSD licenses.
      >
      > It's not just the licence that is a concern about the GCC suite, it's dropping support for hardware that OpenBSD supports, it's fluctuating compilation quality and it's licence are all matters for concern to users.

      The licence is just the top of the iceberg.

      GCC is developed by people who have vastly different goals from us. If you go back and read the GCC lists, you'll notice several messages by me where I violently disagree with the direction it's following. Here is some *more* flame material.

      - GCC is mostly a commercial compiler, these days. Cygnus software has been bought by redhat. Most GCC development is done by commercial linux distributors, and also Apple. They mostly target *fast* i386 architectures and PowerPC. A lot of work has been done on specmarks, *but* the compiler is getting bigger and bigger, and slower and slower (very much so).

      - GCC warnings are not *really* useful. The -Wall flag shows many right things, and quite a few wrong issues.

      - There is a lot of churn in GCC which ends up with it no longer supporting some architectures that are still relevant to us.

      - The whole design of GCC is perverted so that someone cannot easily extract a front-end or back-end. This is broken by design, as the GPL people do believe this would make it easier for commercial entities to `steal' a front-end or back-end and attach it to a proprietary code-generator (or language). This is probably true. This also makes it impossible to write interesting tools, such as intermediate analyzers. This also makes it impossible to plug old legacy back-ends for old architectures into newer compilers.

      - As a result, you cannot have the new interesting stuff from newer GCC without also losing stuff... every GCC update is an engineering nightmare, because there is NO simple choice. You gain some capabilities, and you also lose some important stuff.

      - it's also very hard to do GCC development. Their branching system makes it very likely that some important work is falling between the cracks (and this happens all the time). If you develop code for GCC, you must do it on the most recent branch, which is kind of hard to do if your platform is currently broken (happens *all the time* if you're not running linux/i386). Even when you conform, it's hard to write code to the GNU coding standards, which are probably the most illegible coding guidelines for C. It's so obvious it was written by a lisp programmer. As a result, I've even lost interest into rewriting and getting in the GCC repository a few pieces.

      - some of their most recent advances do not have a chance to work on OpenBSD, like preparsed includes, which depend on mmap() at a fixed location.

      - there are quite a few places in GCC and G++ where you cannot have full functionality without having a glibc-equivalent around.

      - some of the optimisation choices are downright dangerous, and wrong for us (like optimizing memory fills away, even if they deal with crypto keys).

      - don't forget the total nightmare of autoconf/libtool/automake. Heck, even the GCC people have taken years to update their infrastructure to a recent autoconf. And GCC is *the only program in the ports tree* that actually uses its own libtool. Its configuration and reconfiguration fails abysmally when you try to use a system-wide libtool.

      I could actually go on for pages...

      I've actually been de facto maintainer of GCC on OpenBSD for a few years by now, and I will happily switch to another compiler, so frustrating has been the road with GCC.
      --
      Main difference between the BSD license and the GPL license: one is from California and the other is from Massachusetts
    11. Re:"Nothing for you to see here" indeed... by j-pimp · · Score: 2, Interesting

      I don't follow politics, so care to explain what's wrong with gcc's politics? Or, what _is_ gcc's politics?

      I honestly don't know. However, it is an old project maintained by people. They have very specific ideas of how things should work, just like linus has very specific ideas about development (no C++ code in the kernel, you could use something besides GIT, but you would be an idiot, etc.)

      Now I don't know much about the inner workings of GCC or Watcom, but I do know this. Several years ago I tried making a linux to windows cross compiler and failed. I think I put a decent amount of effort into my attempts and I definitely knew how toproduce a standard linux hosted linux targeted instance of GCC that would produce working binaries. A few years later I installed watcom and while it did not support Linux, I could install already working binaries that allowed me to compile dos, windows, os/2 and netware binaries from my windows machine.

      Now the reasons for this are largely political. GCC works just fine as a cross compiler, I'm sure today I could get it to work now that I have written a lot more code, compiled more tarballs, and generally know more than I did then. I was able to get a freebsd to windows cross compiler working just fine thanks to the ports collection. Watcom never got a ready for prime time linux compiler, but what they shipped to end users as "experimental" always was a windows hosted compiler targeting linux.

      Now there is no technical reason that gcc or a third party can't make the cross compiling process simpler, but other than poor college students that like to experiment, anyone who needs a cross compiler either can do it themselves, can hire someone that can, or has to do a lot of hoop jumping. Watcom, being open sourced abandon ware, creates binariy releases. Being it currently only supports one cpu and a handful of binary formats, the build system happens to build a compiler for each possible target.

      It all comes down to people and there opinions, and that by definition is politics. The people that use the products and control the development have different ideas and goals, and this reflects in the finished products.

      --
      --- Justin Dearing http://www.justaprogrammer.net/ We're just programmers.
    12. Re:"Nothing for you to see here" indeed... by pthisis · · Score: 2, Informative

      Several years ago I tried making a linux to windows cross compiler and failed.


      FWIW, if your issue was GCC politics that's pretty much what caused the egcs split (and re-merge eventually, with a new philosophy and maintenance crew in charge of GCC). So if you looked at things prior to the gcc 2.95 era, you were looking at a different set of maintainers (and politics/philosophy/etc) than what's there now.

      I think I put a decent amount of effort into my attempts and I definitely knew how toproduce a standard linux hosted linux targeted instance of GCC that would produce working binaries. A few years later I installed watcom and while it did not support Linux, I could install already working binaries that allowed me to compile dos, windows, os/2 and netware binaries from my windows machine.

      Now the reasons for this are largely political. GCC works just fine as a cross compiler, I'm sure today I could get it to work now that I have written a lot more code, compiled more tarballs, and generally know more than I did then. I was able to get a freebsd to windows cross compiler working just fine thanks to the ports collection. Watcom never got a ready for prime time linux compiler, but what they shipped to end users as "experimental" always was a windows hosted compiler targeting linux.

      Now there is no technical reason that gcc or a third party can't make the cross compiling process simpler, but other than poor college students that like to experiment, anyone who needs a cross compiler either can do it themselves, can hire someone that can, or has to do a lot of hoop jumping.


      Last time I did it it was pretty straightforward (as straightforward as cross-compilation can be), and the documentation included worked fine.

      The problem is that to get a full cross-compiler setup isn't just a gcc problem; you need a libc (with headers), and a linker (binutils) as well, and libc is a particular pain.

      I had no problems in the 2.96 era or thereabouts building a linux->windows cross-compiler using only the GCC-included instructions; I basically did:
      1. Build binutils (linker), using "./configure --target=i386-mingw32 --prefix=/usr/local" or whatever target you're using
      2. untar pre-built libc/headers in /usr/local
      3. Build gcc using "./configure --target=i386-mingw32 --prefix=/usr/local --with-gnu-as=i386-redhat-linux".

      The flags might be slightly wrong as that's from memory. Note that I didn't bother bootstrapping libc; if you want, that's also doable; see, e.g., http://www.libsdl.org/extras/win32/cross/README.txt if you want a simple hand-holding script to do it for you.
      --
      rage, rage against the dying of the light
    13. Re:"Nothing for you to see here" indeed... by VGPowerlord · · Score: 2, Informative

      As I recall, that was version 2.96, which was actually the development branch for 3.0. Not surprisingly, development versions have bugs, which is why they shouldn't be used by mainstream users.

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    14. Re:"Nothing for you to see here" indeed... by Crayon+Kid · · Score: 2, Insightful

      Please explain how the license for GCC affects code compiled by it.

      --
      i ate crayons when i was a kid and now i have two braincells and the blue ones taste nicer
    15. Re:"Nothing for you to see here" indeed... by mrsteveman1 · · Score: 2, Insightful

      What will actually happen is GCC will get forked at GPLv2, if the majority of people are behind the v2 fork the v3 version will become irrelevant.

      I do like the fact that we will (hopefully) have 2 good compilers, but people aren't going to simply start licensing things under BSD just because of GPLv3, they will just keep using GPLv2 because they were using GPL for a reason.

    16. Re:"Nothing for you to see here" indeed... by bm_luethke · · Score: 2

      The "problem" isn't Gcc's politics as much as GNU's. That is, the license is the issue.

      I've said for a long time that Linux will not become mainstream until it decides too - it has tried to straddle both the commercial world and the political activist world and one can not really do both. There needed to be a decision and one has recently been made.

      While what we call "Linux" still hasn't made such a decision, the tools it depends on has (GNU), and that is towards to political arena. That's fine, it is a valid choice and I can understand why people who donate their time would choose to do so (I know any donated stuff I do will). However things like Linux that depend on said tools now must also make the full choice which way to go - many want a more "BSD" type license that is much more commercial entity friendly.

      It's unclear how all of this is going to work out. My guess is that either some distro will eventually come out that bypasses GPL3 or GPL3 will not do what it is intended to do. As of right now we see articles saying companies like IBM are both really happy with it and they hate it. In my opinion if they are happy with it then it isn't going to appease the ones going for a political solution and changes almost nothing (and then why make a new one?), if they are unhappy with it then the new stuff will fade into hobbyist only.

      Eh - at least it is entertaining to watch :) At some point I believe something along the lines of Apple's OS (license wise) will win, it is just how many years and how much fighting it will take to get there.

      --
      ------- Sorry about the spelling, I suffer from two problems. Dyslexia makes it difficult to spell well, lazy makes it
    17. Re:"Nothing for you to see here" indeed... by realnowhereman · · Score: 2, Interesting

      Having a closed, BSD-licensed compiler helps restrict competition in their markets, and the BSD license allows this. GPL does not.

      Wow, that sounds great. Sign me up.

      Embedded work is far better when the toolchain is based on GCC. Every proprietary compiler I've used has been a fight just to get started. I recently tried out avr-gcc and was delighted, all the GCC experience I had just dropped straight in.

      Shame on any manufacturer who doesn't add a GCC backend for their CPU.
      --
      Carpe Daemon
    18. Re:"Nothing for you to see here" indeed... by NickFortune · · Score: 2, Insightful

      I am not sure what you are suggesting here... Should people who feel that the GPL license is heading in a disastrous direction just STFU?

      Well, no. On the other hand, the post to which the GP was responding seems to be implying that a GPLv3 GCC will infect its output, on account of its being "poisonous and viral". Either that, or it's a screaming non-sequiteur and totally off topic. You can't blame the GP for giving a poster the benefit of the doubt.

      It really doesn't matter if the new license affects the compiled code.

      What a strange thing to say! I most certainly does matter if a compiler imposes its licencing terms on any programs it compiles. This would be a major show stopper for all sorts of deployment scenarios.

      Happily, GCC has never imposed such restrictions. You could argue that the point is moot in this case, but it's hardly unimportant.

      In this case the message is that BSD licensing looks better every day.

      I can't see why. It's not like the FSF will (or could) discontinue the GPLv2. If it was a good licence before v3 (and it was) then GPLv2 is still a good licence now.

      --
      Don't let THEM immanentize the Eschaton!
  2. Kind of depends... by KingSkippus · · Score: 4, Insightful

    ...and most importantly, BSD Licensed...

    Kind of depends on who you ask, doesn't it?

  3. Not for NetBSD for sure by gambolt · · Score: 5, Funny

    OK, so it compiles C on x86. What do I use when I want to compile objective C on my microwave?

    1. Re:Not for NetBSD for sure by Aladrin · · Score: 4, Informative

      This got modded funny, but I'm sure it deserves insightful instead.

      GCC compiles on a LOT of different architectures. Does PCC? Does it do as good a job at compiling? Can we plop our current GCC-compiled source on PCC and have it compile without huge headaches?

      And what about these bugs that are even referenced in the summary? How could it POSSIBLY supplant GCC if it's that buggy? In fact, how could it have supplanted GCC if it hasn't taken GCC's place AT ALL yet?

      Try these headlines:

      GCC Compiler Finally Has 'Free' Competition
      New Compiler To Supplant Gnu Compiler?
      Battle of the licenses: Does the license of your compiler MATTER AT ALL!?

      --
      "If you make people think they're thinking, they'll love you; But if you really make them think, they'll hate you." - DM
    2. Re:Not for NetBSD for sure by TheRaven64 · · Score: 4, Insightful

      Actually, support for different architectures is one of the main reasons OpenBSD is looking at it. GCC has a habit of dropping architectures because 'nobody uses them,' which causes some OpenBSD (and NetBSD) ports to remain stuck with old versions of GCC. The x86 backend for PCC was written in three weeks by one person, so it seems reasonable to assume it should be possible to add support for the other required platforms relatively easily.

      It's worth remembering that in BSD-land, things are divided into the base system and third party packages. The base system needs a C compiler that is capable of compiling the userland (which PCC already does for OpenBSD), is small, portable, and easy to audit. Packages have quite different requirements; they need support for more languages, etc. PCC is likely to replace GCC in the BSD base systems, but that doesn't mean that people won't install GCC or LLVM for compiling other things.

      --
      I am TheRaven on Soylent News
    3. Re:Not for NetBSD for sure by Secret+Rabbit · · Score: 2, Informative

      And what about these bugs that are even referenced in the summary? How could it POSSIBLY supplant GCC if it's that buggy? In fact, how could it have supplanted GCC if it hasn't taken GCC's place AT ALL yet?
      Easy. Read the rest of the summary.

      and work is being done on it to take on GCC's job.
  4. Quick! by perbu · · Score: 5, Funny

    Someone relicense it under the GPL!

  5. One OT clarification: by Anonymous Coward · · Score: 2, Informative

    "NetBSD's" pkgsrc is really everyone's pkgsrc. Try it on what you're running right now.

    It's my primary package manager on Interix, Mac OS X, Linux, and NetBSD.

  6. Answer by christurkel · · Score: 3, Insightful

    GCC Compiler Finally Supplanted by PCC?

    No. Next question.

    --

    CDE open sourced! https://sourceforge.net/projects/cdesktopenv/
  7. Interesting... by cromar · · Score: 4, Insightful

    I really don't see any point in implementing a new C compiler under the BSD lisence. There's no reason to duplicate effort: it's not like the compiled binaries would be under the GPL. And any GPL libraries you link to, you wouldn't need to distribute (thus avoiding the GPL). So, really, there's no point in duplicating effort on a BSD lisenced compiler. Correct me if I'm wrong.

    1. Re:Interesting... by everphilski · · Score: 4, Insightful

      Principle?

      I don't know, I'm not a BSD user, but as much as RMS likes to claim that 'linux' is GNU/linux, maybe BSD users want their OS to be self reliant?

      Would you like to compile Linux using a microsoft compiler? :)

    2. Re:Interesting... by Anonymous Coward · · Score: 5, Interesting

      It has less to do with the license and more to do with GCC's increasingly spotty support for some of the hardware platforms that NetBSD and OpenBSD run on. That and GCC internals are a maintenance nightmare, and its development process is getting even less commmunity-driven than it was before (which was never that much). Asking for a new compiler warning might take anywhere from a day to years just to get a response. The license is definitely gravy though.

      The BSD license that PCC is under, I understand, is actually a problem even to the BSD folks: PCC is actually extremely old (it was originally written for the PDP11!) and apparently it still carries the advertising clause.

    3. Re:Interesting... by Anonymous Coward · · Score: 5, Insightful

      Would you like to compile Linux using a microsoft compiler? :) If it produced the best code, why not? People already compile Linux using the Intel compiler.

    4. Re:Interesting... by WindBourne · · Score: 2, Insightful

      or
      3. they object to the restriction on their freedom?

      Look, I am a Linux user and Hacker, but even I understand BSD need to have their code be free.

      --
      I prefer the "u" in honour as it seems to be missing these days.
    5. Re:Interesting... by Brandybuck · · Score: 3, Insightful

      Reason 1) Avoid a monoculture

      Reason 2) Competition

      Reason 3) Choice

      Reason 4) Tweak Stallman's nose

      --
      Don't blame me, I didn't vote for either of them!
    6. Re:Interesting... by mrchaotica · · Score: 2, Funny

      You just restated point #2.

      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    7. Re:Interesting... by Jose · · Score: 2, Insightful

      Look, I am a Linux user and Hacker, but even I understand BSD need to have their code be free.

      to me, it is the GPL that ensures that the *code* remains free, while the BSD license ensures that it is the *user* that remains free.

      I really like both licenses, but they serve different purposes, and it highlights the priorities of the different groups.

      --
      The basic sleazeware produced in a drunken fury by a bunch of UCBerkeley grad students was still the core of BIND. --PV
    8. Re:Interesting... by Jeff+DeMaagd · · Score: 2, Insightful

      The difference is that both are open source and no matter what level of hot air that RMS can emit, he can't force anyone to do anything other than abide by the license of his software.

      He can't force people to change the name of Linux, it's just that people decided to go along with it on their own. The GNU/Linux thing was kind of retarded given that Linux distributions feature code from a lot of different licenses, and GNU is the only one that's mentioned?

    9. Re:Interesting... by Tim+C · · Score: 3, Insightful

      The GNU/Linux thing was kind of retarded given that Linux distributions feature code from a lot of different licenses, and GNU is the only one that's mentioned?

      The justification I've usually seen for that is that GNU is the single biggest "contributor", as it were, particularly with respect to gcc, the command tools, etc. More than just that, though, it could be argued that without GNU, Linux would just be a kernel, with no user space to run. Of course, it could equally be argued that without Linux, the GNU user space tools would just be a nice collection of tools with no OS to run on...

    10. Re:Interesting... by sunwukong · · Score: 5, Interesting

      I believe it was de Raadt that once mentioned he'd prefer a non-optimizing compiler that produced simple, bullet-proof, bug-free code, i.e., in terms of the OS and its base tools, he prefers correct to fast.

    11. Re:Interesting... by Anonymous Coward · · Score: 4, Funny

      And he continues to write code in C...why?

    12. Re:Interesting... by jc42 · · Score: 3, Insightful

      or
      3. they object to the restriction on their freedom?


      or
      4. they like competition and choice, even if the "market leader" is pretty good.

      or
      5. they've learned that a monoculture isn't good for the ecology (even if the "market leader" is pretty good).

      --
      Those who do study history are doomed to stand helplessly by while everyone else repeats it.
    13. Re:Interesting... by Omnifarious · · Score: 4, Insightful

      The real reason that Stallman wants this is that he early on correctly perceived that Linus is totally ideology agnostic, and so he wanted to put the idea of GNU/Linux out there so people would talk about the ideology. I don't think this is bad or anything. I think the ideology needs to be heard more widely.

      It could also be argued that without the GNU project, Linus wouldn't have had a license ready to use for Linux, and I think that contribution by the GNU project weighs at least as much as all the userspace tools which someone would likely have eventually written anyway.

    14. Re:Interesting... by j-pimp · · Score: 4, Interesting

      And he continues to write code in C...why?

      Auctually if I could write in C as well as him, I would do so more often. The problem is not him writing in C, its other people writing in C that are not as good as him. Do to the scope of his work, him writing in C does not lead to more bad C being written. So I'm auctually thankful he is coding in C.

      That being said, he should encourage lesser programmers (including myself) to specifically not code in C.

      --
      --- Justin Dearing http://www.justaprogrammer.net/ We're just programmers.
    15. Re:Interesting... by afidel · · Score: 2, Insightful

      Of course, it could equally be argued that without Linux, the GNU user space tools would just be a nice collection of tools with no OS to run on...

      Not true, they run just fine on Solaris including Open Solaris which is OSS. In fact I MUCH prefer Solaris with the GNU tools loaded, the old SysV tools suck by comparison and I only use them for the rare script that breaks on the GNU tools (They are overall very good about preserving backward compatibility and man will almost always tell you when they don't). I know many of the stogy Solaris admin's don't like to load anything that didn't come on the first install disk, but if you have control of your environment and have linux experience it is really nice to load the GNU toolset.

      --
      There are 4 boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order. Starting now.
    16. Re:Interesting... by Selivanow · · Score: 2, Interesting

      If you read Linus' early posts about the Linux kernel you will notice that he had originally licensed it under its own license. He didn't switch to the GPL until later. It is hard to say whether or not Linux would have taken off without the GPL. It probably would have been fine using a BSD userland even if a userland wasn't quite available yet. In fact, if the kernel wasn't now so dependant on the GNU userland (binutils, glibc, etc.) it would be pretty easy to usethe BSD userland. (I can't recall if there was a BSD lisenced userland in existance in 1991)

      --
      -- ...trying to make digital files uncopyable is like trying to make water not wet. -Bruce Schneier
    17. Re:Interesting... by Thuktun · · Score: 2, Insightful

      Of course, it could equally be argued that without Linux, the GNU user space tools would just be a nice collection of tools with no OS to run on... It could not be successfully argued.

      GNU tools ran fine on other OSes long before Linux became so popular, including Solaris (and SunOS before it), AIX, HP/UX, IRIX, NEXTSTEP, Ultrix, and so on.
    18. Re:Interesting... by Chandon+Seldon · · Score: 2, Informative

      The GNU/Linux thing was kind of retarded given that Linux distributions feature code from a lot of different licenses, and GNU is the only one that's mentioned?

      Let's at least get RMS's position right: The GNU project was founded in 1984 to create a free operating system. In 1991, they were almost completely finished - they had written every essential component of a Unix-like operating system except for a kernel. Linus came along, wrote the Linux kernel, combined it with the almost-complete GNU system, and called the whole thing Linux. The GNU people were rightly upset that they were getting no credit for their work (to build a complete Unix-like OS).

      The counter argument from Linus is that the term "Operating System" means "kernel", and that anything outside the kernel is just "userspace tools". That's a difficult position to defend - the simplest counter argument being that operating systems run programs and that Linux can't even run "Hello World" without GNU System components like GNU Libc.

      --
      -- The act of censorship is always worse than whatever is being censored. Always.
    19. Re:Interesting... by Austerity+Empowers · · Score: 3, Insightful

      But modifying, even forking GCC is practical and rational, whereas making your own, new, compiler and supporting it for all eternity is not. I can understand much of the BSD bent on licenses, but in this case...I don't see it. Compilers are never "done", and writing one with a license that does not ensure other people's updates make it in is just ensuring that the author is perpetually supporting this himself.

      I can understand some applications having closed source licenses...but a compiler is a means, not an end...it really just seems painful.

    20. Re:Interesting... by Anonymous Coward · · Score: 5, Insightful

      I am the GPP, incidentally, and while I'm pleased I got modded up, I certainly wasn't going for funny :). I'm sorry, but C is just a poor choice for ensuring correctness.

      First of all, open up your copy of the C standard (any of them will do) and grep for the phrase "undefined behaviour". C was standardized in a time when everyone and their dog had their own C compiler. Each C compiler did things in a different way, often in contradictory ways. The C standard came along and said "hey, you know what? You're ALL right". I'm being facetious, and the C standard has done a great job in promoting C, but the C standard has really not evolved very far in terms of guaranteeing semantics.

      I don't mean to bring this up to say that "you can't write correct code" in C or such nonsense. Obviously it's easy with good habits (I recommend comp.lang.c as the best place to pick up these habits) to write conforming and well-defined code. But, if you're trying to verify code that's already been written, either by hand or via some automated tool like a static analyzer, it is painful.

      The second problem with C is that it allows a lot of features that make verification of semantics difficult. Pointer aliasing, global variables (even "extern" global variables!!), etc. make static analysis dreadful. If you want to perform static analysis properly on C programs, it's hard to get around whole-program analysis, which is why no one uses static analysis with C code :). Seriously, what does C have beyond lint? How many people even use lint? It's not very useful.

      Of course static analysis is not the end-all be-all of ensuring correct code. There's good coding habits and testing and profiling and whatnot too. But, I would argue that whatever effort can be put into verifying C code can be better put into code in other languages. The semantics of C are sometimes loosely defined, and very often far-reaching, preventing the use of modular reasoning. Whole-program analysis is not your friend.

      What would be really cool is to see from someone like the OpenBSD crowd, if they're so keen on C, develop some verification tools that maybe only work on a very, very restricted subset of C. Any code which does not conform to this restricted "more easily verifiable" subset of C in the core OS would be rejected. I don't know how practical it would be, but it would be cool to see :). I mean as an academic, obviously I think we should all be using Z, but I understand this doesn't make good sense in a lot of real-world projects. But you want to get serious about correctness, don't pussy foot around: get serious about correctness.

    21. Re:Interesting... by Splab · · Score: 2, Insightful

      It often depends on what you are doing, some programs need fast over reliable - others need stuff like strong exception safety, there should be room for both crowds.

    22. Re:Interesting... by Nevyn · · Score: 4, Insightful

      Let's at least get RMS's position right:

      Better idea, let's just get history correct.

      The GNU project was founded in 1984 to create a free operating system.

      Ok, true enough.

      In 1991, they were almost completely finished - they had written every essential component of a Unix-like operating system except for a kernel.

      Sure, and I've almost created a free engery device ... I've done everything apart from this one bit that creates energy for free. Also, GNU did not "create" everything else apart from the kernel ... they created some pieces and were doing the distribution work, so other people "donated" their work.

      Linus came along, wrote the Linux kernel,

      True enough.

      combined it with the almost-complete GNU system, and called the whole thing Linux.

      Not even close to true, Linux has only ever distributed the kernel ... other people combined it and called the whole things like "Red Hat Linux" or "Slackware Linux", GNU should/could have done this but had not bothered to do the work to make a usable distribution (as more than a collection of tarballs) and were happily ignoring Linux and telling everyone else to ignore it and use GNU-Hurd when it would be ready "any time now". This was pretty obvious naming at the time, we didn't call Solaris "GNU/Solaris" when we installed GCC, GNU-tar etc. on it.

      The GNU people were rightly upset that they were getting no credit for their work (to build a complete Unix-like OS).

      They got a huge amount of credit, for the work they did. They just didn't get their name in lights ... because they refused to do the work required for that. Then they complained and wanted more recognition than anyone else got who'd done the same amount of work as they had (like Perl or Xorg etc.) ... this created a "slight" backlash by people who actually know what happened.

      --
      ustr: Managed string API with ave. 44% overhead over strdup(), for 0-20B
    23. Re:Interesting... by Goaway · · Score: 3, Informative

      But modifying, even forking GCC is practical You haven't looked at the gcc codebase, have you?
    24. Re:Interesting... by peacefinder · · Score: 2, Insightful

      "Or, I understand the philosophy, but I think that particular way of putting it is a bit of FUD slinging."

      I don't think it's meant as FUD. Actually the idea that the code itself has been emancipated, so that no one can bind it or its children with the chains of ownership ever again, is quite an attractive and appealing idea.* Stallman was a bloody genius to come up with such a wild abstraction. He's freed the slaves all over again, it's just that these slaves are not human.**

      However, while this philosophy maximizes the freedom of the code itself, it does so at some cost to other interests. One cannot bind the software with the chains of ownership again - that's the whole point - which is a bit of a problem if one wishes to write code that can be used by any human for any purpose even if it means some of the code's children can be chained up again by some bloody-minded capitalist while others remain free. The BSD license maximizes the freedom of people, while not providing complete protection from slavery for all of the code's children.

      Both licenses attempt to maximize freedom, but they do so in different ways and for different interests; to secure those different freedoms they must make different tradeoffs.

      [*: When I say this I definitely do not mean to spread Fear, Uncertainty, or Doubt. It's meant as a compliment... although there are of course some who will view Stallman's grand idea as just bizarre philosophical wanking.]
      [**: And if you think this debate is interesting, just wait until the GPL philosophy meets seemingly self-aware robots! See also Asimov's book "I, Robot".]

      --
      With reasonable men I will reason; with humane men I will plead; but to tyrants I will give no quarter. -- William Lloyd
    25. Re:Interesting... by evilviper · · Score: 2, Insightful

      GNU is the single biggest "contributor", as it were,

      At what point are you forced to grant credit? Shall we call it KDE/QT/GNU/Linux?

      it could be argued that without GNU, Linux would just be a kernel, with no user space to run.

      No it couldn't. The comparable BSD tools have been around longer than the Linux kernel.

      Of course, it could equally be argued that without Linux, the GNU user space tools would just be a nice collection of tools with no OS to run on...

      Before Linux, it was pretty common to install several of the GNU tools on the closed-source Unix systems of the day. Problems with the GNU tools on Minix was in fact the motivation for creating Linux. Today, everyone that has to use a Solaris system for any length of time installs the GNU tools and tries very hard to forget that the Solaris crap even exists. Bash, if nothing else, is a common install on any Unix system (even though OpenBSD's branch of pdksh, and ksh93 are actually better shells, IMO).
      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
    26. Re:Interesting... by lyberth · · Score: 2, Insightful

      didn't you read, that this is work done from all the way back in the 70'ties?
      Also why should they not be allowed to make a new compiler, Toyota started to make cars long after Ford made theirs - even though - eeh - Ford already made cars that did all the things that the Toyota cars did.
      What license doesn't ensure , oh, let me turn it around - what license ensures that committed code makes it in? The manager of a project allows or disallows for code to be committed, not the license.

      A compiler is an application, an application that compiles source code.

      A lot of people in the bsd developer teams are tired of gcc becomming more and more complex and becoming slower and slower at compiling. This might indicate why some are trying to find alternatives.

      --

      There isn't much like the scent of a fresh harddisk
    27. Re:Interesting... by Cro+Magnon · · Score: 2, Insightful

      Toyota started to make cars long after Ford made theirs - even though - eeh - Ford already made cars that did all the things that the Toyota cars did.


      In fact, Fords do something Toyotas don't do, namely explode. :)

      Although GCC doesn't do that (that I know of), I see no problem with having an alternative. There are competing applications for everything else, from desktops (Gnome/KDE) to kernels (Linux/BSD), so why not compilers?
      --
      Slow down, cowboy! It has been 4 hours since you last posted. You must wait another few hours.
    28. Re:Interesting... by j-pimp · · Score: 2, Informative

      What would be really cool is to see from someone like the OpenBSD crowd, if they're so keen on C, develop some verification tools that maybe only work on a very, very restricted subset of C. Any code which does not conform to this restricted "more easily verifiable" subset of C in the core OS would be rejected. I don't know how practical it would be, but it would be cool to see :). I mean as an academic, obviously I think we should all be using Z, but I understand this doesn't make good sense in a lot of real-world projects. But you want to get serious about correctness, don't pussy foot around: get serious about correctness.

      I think you miss the point. The OpenBSD people are married to Unix and C, in much the same way as Bjarne believes the answer is to fix C++, and not to use Java and C#. Yes your right, it would be nice if one of them "sees the light" and programs in something where you just can't create a buffer overflow so easily. That being said, they should write the lcompiler/vm/interperter/kernel that runs under that as they have proven themselves to be one of the few chosen by $DIETY to write decent C. Until a cpu is created where you can handle arrays in a non dangerous manner on the machine code level, someone will have to write in C or assembly.

      --
      --- Justin Dearing http://www.justaprogrammer.net/ We're just programmers.
    29. Re:Interesting... by fatal+wound · · Score: 3, Interesting

      I'm sorry, but C is just a poor choice for ensuring correctness.

      Far too true, however for working with flexible or hazy requirements or looking to make code that is fast, C is very hard to beat. Also, just because this is true today, doesn't make it something that will be true forever.

      F... "hey, you know what? You're ALL right". I'm being facetious, and the C standard has done a great job in promoting C, but the C standard has really not evolved very far in terms of guaranteeing semantics.

      Once again, totally on the money. The standards group was too concerned to fix things like bitfields to make them useful, or standardize the method of determining the size of an "int". I think the standard evolved more to making the compiler writers happy than to make any real effort at fixing vague semantics that are quite prevalent and cause any number of problems.

      But, if you're trying to verify code that's already been written, either by hand or via some automated tool like a static analyzer, it is painful.

      This is so true that it is painful to hear! I worked a couple of years with a tool to analyze code for customers. The variability in the compilers, environments, implementation details, user hacks, or compiler switches that affect code is dizzying. Has anyone else enjoyed the declaration "char myvar[0]" construct?

      However, before you condemn all of the analysis tools, check out tools that perform "semantic analysis" (that what it was called when I was there) of C code. You may be pleasantly surprised. But it is still a challenge to wholly analyze any project. C++ is hideously complex, as is Ada (even the more recent revision, Ada95 I think).

      Once again, no panacea of code correctness tools, but with the body of work that has been placed in C; it would be foolish to just "walk away". I've worked with a number of languages; both object oriented and procedural. Many arcane assembly languages as well. In my work, I've come to the simple conclusion that *ALL* languages have issues in many areas. Something like the old adage "all dogs have fleas"...

      cheers!

    30. Re:Interesting... by pthisis · · Score: 2, Informative

      But modifying, even forking GCC is practical
      You haven't looked at the gcc codebase, have you?


      It may not be forkable for the average person off the street, but if actual compiler developers are unhappy enough with something then forking GCC is certainly practical and we have plenty of examples of that happening.

      egcs forked gcc effectively enough that the fork displaced the original. Several bounds-checking gcc forks have been used in production systems. Apple and others have periodically forked (and sometimes re-merged).
      --
      rage, rage against the dying of the light
    31. Re:Interesting... by Bluesman · · Score: 2, Insightful

      The code base to GCC is huge and complex, not to mention sparsely documented. Going through the entire thing to make sure it's perfectly secure is likely a harder task than starting from scratch.

      It's not like a C compiler is a very difficult thing to write. GCC is much more than than just a C compiler. But if a C compiler is all you need...maybe GCC is overkill.

      --
      If moderation could change anything, it would be illegal.
    32. Re:Interesting... by DragonWriter · · Score: 2, Interesting

      The GNU System is an OS developed by the GNU project, therefore it would be polite to refer to it by its name. (the RMS position)


      No, the RMS position is not that, since Linux is not the OS developed by the GNU project. It is an OS that's common feature is the Linux kernel; as usually distributed, it includes various tools from the GNU project. The RMS position is, roughly, "The GNU System is an OS developed by the GNU Project, and therefore every project that incorporates any components from that system is also morally obligated to include 'GNU' in the name of there product, even though they have express written permission to distribute the product without doing so."

      But even that's not exactly right, because this argument is only applied to Linux, not to other products that incorporate GNU tools.

      The GNU project's own OS doesn't have a general release yet, though its been coming Real Soon Now for my entire adult life.

      The GNU System is an OS developed by the GNU project, but people who redistribute it can call it whatever they want. (the jerk position)


      Actually, that is, properly speaking, "the GPL position", since the GPL does not have any provision requiring adhering to upstream naming conventions or request. If the GNU project had wanted to make that a condition of distribution, they ought to have incorporated it into the license under which they authorized people to redistribute their code and create derivative works.

      Complaining about people doing something you've given them express, written legal permission to do is somewhat childish, especially when you've (since you began complaining) revised the legal terms offered more than once without addressing the thing you keep complaining about.

      The idea of "the GNU system" is foolish. The GNU project just wrote some tools. Operating System is just another word for Kernel anyway. (the Linus position)


      The GNU project may or may not have written an operating system, but Linux isn't it. An operating system is more than a kernel, but a kernel is an indispensable portion of the operating system. Using some OS components GNU developed and some other OS components doesn't make the result the same OS GNU developed. Its something else. Distributors are free to call it things that highlight the kernel by including its name ("Red Hat Enterprise Linux"), things that evoke the name of the kernel without actually using it exactly ("Lindows"), or things that don't mention the kernel at all ("Knoppix"). They could do the same thing with the GNU toolchain. The fact that none of the distributors wan't to label the OS in a way that highlights the GNU toolchain may be disappointing to the members of the GNU project, but since they've expressly (and repeatedly, given the revisions to the GPL) given distributors permission to do exactly what they are doing, they don't really have any leg to stand on in complaining about it.
    33. Re:Interesting... by Goaway · · Score: 2, Interesting

      My point was more that if you might just be better off in the long run by starting from scratch, instead of taking on the maintenance nightmare that is gcc.

    34. Re:Interesting... by tepples · · Score: 2

      Yes, writing to hardware registers and doing memory management needs pretty low level access to the hardware. Hardly anything else does, yet most C code out there is doing other stuff. I develop for a battery-powered device that has been under-clocked to save battery power and given less RAM to make the device cheaper to replicate. On this device, even code that doesn't access the hardware must run fast, or the user gets annoyed. What's better than C for an environment with a 67 MHz ARM CPU and 4 MB of RAM?
    35. Re:Interesting... by tepples · · Score: 2, Insightful

      Of course, it could equally be argued that without Linux, the GNU user space tools would just be a nice collection of tools with no OS to run on... Without Linux, the Linux developers would be working on HURD. Without Linux and without HURD, we'd likely be using GNU over Solaris, *BSD, or Minix (all of which are Free by now).
    36. Re:Interesting... by Hal_Porter · · Score: 2, Funny

      And he continues to write code in C...why?

      Because maintaining a secure system written in C requires paranoia, obsessive concentration on small details and merciless flaming of n00bs when they screw up.

      --
      echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
  8. Stupid waste of time by th0mas.sixbit.org · · Score: 4, Insightful

    Seriously. Let's duplicate the wheel twice: once for GPL, once for BSD, and then bicker amongst ourselves. Stuff like this stands in the way of actual progress being made. Neither side is right, I don't have a solution, but this is just dumb.

    --
    twitter.com/gravitronic
    1. Re:Stupid waste of time by sinnergy · · Score: 3, Funny

      Your argument holds no water. If that were the case, one could make the same arguments about operating systems. Why bother developing Linux in an attempt to "keep up with the Jones'" when Windows already exists.

      I'm just sayin'...

    2. Re:Stupid waste of time by TheRaven64 · · Score: 2, Informative
      There's also an option three:

      - It has different goals to GCC.

      --
      I am TheRaven on Soylent News
    3. Re:Stupid waste of time by MoxFulder · · Score: 2, Interesting

      - it is better than GCC. If this is the case, then its too bad the GNU folk cannot benefit from whatever it has that GCC doesn't. Not like they'll admit it's superiority I'd presume.


      Actually... the BSD license is GPLv2 or GPLv3-compatible, because it doesn't impose any restrictions beyond those included in GPLv2 or GPLv3. So BSD code can be incorporated into a GPL program (Theo de Radt's recent rants notwithstanding).
    4. Re:Stupid waste of time by YU+Nicks+NE+Way · · Score: 3, Informative

      No: taking the BSD license OFF the code drives us nuts. You're free to incorporate our code and give us no credit. We object if you take that right from a downstream user. If you dual license, you don't take that freedom away. If you replace the license, you do.

      We want to encourage people to use our code if it's the best code for the task. Period. You want to undermine copyright. Well, you're free to do that, but some of us don't think that's a good idea, and others of us don't think it's that important.

    5. Re:Stupid waste of time by YU+Nicks+NE+Way · · Score: 2, Informative

      Our license entails the statement "If you distribute this source code, then any recipient can take it private. If you don't redistribute this source code, then you can do anything you please." What that means is that those who choose to redistribute the source (e.g. you folks) have burdens not borne by those who take the code private.

      Yes, that really does mean what it says -- you can take our code private as a binary without given us a thing, but if you preserve the source, you have to give us credit.

  9. *yawn* by blackcoot · · Score: 4, Funny

    call me when pcc does something useful, like, say, working.

  10. Re:GNUless Linux by RLiegh · · Score: 2, Insightful

    Not really; you already have the sun and intel compilers for Linux (I've been told that the intel compiler has even been tweaked so you can build a bzImage with it).

    But you're still stuck with using glibc if you want to be able to compile anything. You do have different libcs floating around, uclibc, etc; but they're all gnu and they're all meant for embedded market. I doubt you'd be able to recompile the linux kernel with any of them.

  11. That's dumb. by imbaczek · · Score: 4, Interesting

    pcc will take YEARS to get the functionality and optimizations that gcc has. Even if it compiles slowly and sometimes generates dumb code.

    Either way, they'd much, much better off if they imported LLVM and redirected their compiler brain power to clang.

    1. Re:That's dumb. by TheRaven64 · · Score: 2, Informative

      PCC and LLVM have different goals. LLVM is intended to be a replacement for GCC with a modern architecture. PCC is intended to be a simple C compiler, not too heavy on the optimisation, but easy to audit and able to produce correct code. LLVM is about an order of magnitude bigger than PCC, making it much harder to audit. PCC would be great for the OpenBSD base system, while LLVM would make a good choice for compiling packages. It's all about choosing the right tool for the job.

      --
      I am TheRaven on Soylent News
  12. LLVM / clang by sabre · · Score: 4, Interesting

    PCC is interesting, but it's based on technology from the 70's, doesn't support a lot of interesting architectures, and has no optimizer to speak of.

    If you're interested in advanced compiler technology, check out LLVM, which is an ground up redesign of an optimizer and retargettable code generator. LLVM supports interprocedural cross-file optimizations, can be used for jit compilation (or not, at your choice) and has many other capabilities. The LLVM optimizer/code generator can already beat the performance of GCC compiled code in many cases, sometimes substantially.

    For front-ends, LLVM supports two major ones for C family of languages: 1) llvm-gcc, which uses the GCC front-end to compile C/C++/ObjC code. This gives LLVM full compatibility with a broad range of crazy GNU extensions as well as full support for C++ and ObjC. 2) clang, which is a ground-up rewrite of a C/ObjC frontend (C++ will come later) that provides many advantages over GCC, including dramatically faster compilation and better warning/error information.

    While LLVM is technologically ahead of both PCC and GCC, the biggest thing it has going is both size of community and the commercial contributors that are sponsoring work on the project.

    -Chris

    1. Re:LLVM / clang by sabre · · Score: 2, Interesting

      clang is fairly early on, but so is PCC. PCC supports almost no GCC extensions (e.g. inline asm, attributes, etc), doesn't support C99 fully, and has many other problems. The clang parser is basically done for C and clang has support for several other source analysis tools other than "just code generation". See the slides linked of http://clang.llvm.org/ for details. I'd expect clang to be fully ready for C use in the next year.

      llvm-gcc is quite mature (it has built huge amounts of code, including apps like Qt and Mozilla), supports C/C++/ObjC and bits of FORTRAN/Ada if that is your thing. Using llvm-gcc you get the advantages of the LLVM optimizer and code generator with the GCC front-end.

      -Chris

  13. The licence is just the top of the iceberg by DiegoBravo · · Score: 3, Informative

    "So, really, there's no point in duplicating effort on a BSD lisenced compiler. Correct me if I'm wrong."

    From the discussion of TFA:

    The licence is just the top of the iceberg

    1. Re:The licence is just the top of the iceberg by Anonymous+Conrad · · Score: 5, Insightful

      The whole design of GCC is perverted so that someone cannot easily extract a front-end or back-end. This is broken by design, as the GPL people do believe this would make it easier for commercial entities to `steal' a front-end or back-end and attach it to a proprietary code-generator (or language). That's entirely wrong. RMS has been worried about this, and he (through the FSF who own the copyright) have previously objected to any patches that serialize the GCC's intermediate state for just this reason. (Although GCC's new link-time optimization work will change this.)

      GCC's intermediate formats GIMPLE and GENERIC are based on a research compiler, not a deliberate perversion. There's no technical steps to stop reuse, and indeed it has been done - Sun distribute the GCC 4.0.4 front-end altered to use their own SPARC code generator as a back-end.
    2. Re:The licence is just the top of the iceberg by julesh · · Score: 5, Interesting

      Well that explains a lot. And here I was thinking that all modern compilers were designed correctly with a front-end and back-end. So much for academics.

      Actually, the post you're replying to is total bollocks. GCC has had a clear divide between front and back end (not to mention a source-language independent middle layer for performing optimizations) since I first looked at it in about 1996. Each layer is hideously complex, but they are all there.

    3. Re:The licence is just the top of the iceberg by bockelboy · · Score: 2, Informative

      Gah, that's a bit of a flame. If you look at the architecture, there's good front-end / back-end separation. The front and back ends are necessarily extremely complicated, but you can rip the entire front end and compile your code to GIMPLE, or whatever their SSA form is called. There also have been several different languages (Java, C, C++, Ada, Obj-C) that are production frontends to GCC's backend.

      I do know that I wrote an intermediate analyzer for a semester-length class, along with another grad student. In fact, the prof suggested we use GCC because several others have done the exact same thing, going back many years. It's not easy, but it's possible.

      Sounds like whoever posted that was just extremely frustrated and wanted to blow off some steam. It can happen. GCC used to be a lot worse, and a lot further behind academia. There have been growing pains in the last couple of years getting it to "catch up". Perhaps that's what he was frustrated with?

  14. We need to replace gcc ... why? by joe_n_bloe · · Score: 3, Interesting

    Let me get this straight. A compiler that has been production-quality for over 15 years, compiles everything on every architecture, and has been continuously improved every minute of its existence needs to be replaced by ... Son of pcc? Because of a license?

    Sure, I prefer BSD-style licenses, and so do some other people, but what drives gcc development is the GNU license. I think I'll stick to the compiler that's debugged. Oh, that's right, I forgot, it comes with a debugger too. If you like that sort of thing.

    1. Re:We need to replace gcc ... why? by evilviper · · Score: 5, Interesting

      A compiler that has been production-quality for over 15 years, compiles everything on every architecture, and has been continuously improved every minute of its existence needs to be replaced by ... Son of pcc? Because of a license?

      You couldn't have gotten that statement any MORE WRONG if you had tried.

      GCC's "production quality" is an on-again, off-again thing. Through most of v3.x it had too many bugs to count, and was inherently unreliable. It couldn't even compile ITSELF with the most basic optimizations or the resulting binary would generate incorrect code. Up until v4 it also misaligned stack variable. It had, and still has, MANY bugs. That GCC successfully compiles code at all is almost entirely due to it being so popular that everyone knows it, and works around its bugs without even thinking about it.

      It has never had GOOD support for any other platforms than x86. Remember the RedHat GCC2.96 fiasco? They forked it because they needed it to support more platforms than it currently did. And even through v3.x the non-x86 ports of GCC had even more bugs than on x86, commonly falling apart if you attempt to use any optimizations. Now, they're DROPPING support for those platform entirely, which is a big problem for developers of operating systems for those platforms.

      "Improved" is pretty vague. HURD has probably been "improved" for every minute of it's existence as well... Meanwhile the far younger ICC (Intel's compiler) beats the pants off of GCC without even trying.

      What's more, GCC's "improvements" come at great cost. If you're a full-time developer, for the final release you want optimized code, but while developing, you want to compile and be able to test code frequently, and so as quickly as humanly possible. GCCv3+, even with all optimizations disabled, takes far, far longer to compile binaries than even older versions of GCC, and as it says, something like 10X slower than PCC.

      The license issue is only incidental. These (and other) problems pushed them away from using GCC. Since they happen to be BSD developers, they'd prefer their work to be BSD licensed, and so it is.
      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
  15. Yay for more compiler choices! by FranTaylor · · Score: 2, Insightful

    Even if a compiler generates miserably inefficient code, it is valuable if the code is correct. It ia a valuable tool to use for the verification of other compilers. It can also be used as part of a compiler bootstrapping process. Since its code size is probably a small fraction of GCC's, it may make a better teaching tool. If people are actually going to use it, given that it must coexist in a world with much more mature compilers, it will itself probably become much more mature in a relatively short period of time. GCC currently has no competitors in the free realm and has suffered from neglect in the past. A little competition may keep the developers on their toes and prevent another egcs.

  16. "production-quality"? - not quite by pigiron · · Score: 2, Informative

    GCC has been continuously changed not continuously improved. With each new chip that it optimizes for it seems to drop support for an older one. Plus it is dog slow.

  17. Re:Increasingly extremeist? by IamTheRealMike · · Score: 3, Insightful

    The reason they look increasingly extremist is because the FSF tends to make up policies and rules which bind GCC development in order to avoid the theoretical risk of making GPL violations easier. As compiler technology advances these restrictions have become increasingly burdensome, in particular, several of the technical advantages of LLVM are things the GCC team would have liked to do but RMS nixed because it would have made it too easy to circumvent the license.

  18. Re:The end of GNU ? by Garridan · · Score: 2, Funny

    Please. I think RMS would prefer, GNU/NetBSD != GNU/Linux. Obey the beard!

  19. Re:Why? by TheRaven64 · · Score: 4, Informative
    License aside, the biggest benefit is that it's small. The OpenBSD (for example) base system is a self-contained operating system, including everything required to build it from source. It has the following requirements from its compiler:
    • Must compile C code (GCC does this).
    • Must support all of the platforms OpenBSD targets (GCC has a habit of dropping support for various platforms).
    • Must be easy to add new backends for new architectures (GCC makes this really hard).
    • Must be easy to audit for security (GCC is a tangled mess).
    Maybe a few I've missed. GCC is like Linux; it's a fairly good solution for a lot of problems, but it's rarely the best solution for any given problem. PCC is a better fit for the needs of the OpenBSD base system.
    --
    I am TheRaven on Soylent News
  20. Re:For the license wars! by nuzak · · Score: 2, Funny

    > It's like that phony debate between "great taste" and "more filling"

    That's "tastes great" and "LESS filling". Clearly you're trying to push a "tastes great" agenda by deliberately misrepresenting the opposing viewpoint. Typical tactics for the tasteistas.

    (imagine Daffy Duck saying all that)

    --
    Done with slashdot, done with nerds, getting a life.
  21. not every architecture by DreadSpoon · · Score: 4, Informative

    The biggest reason for the new compiler (despite the jackass article submitter's position) is that GCC does *NOT* support every architecture. GCC drops architectures frequently as the core contributors lose interest, which hurts OSes like NetBSD that try to support more than the mainstream architectures. NetBSD relies on a combination of GCC 2, 3, and 4 to compile the OS on all of the architectures it supports.

    The idea with PCC is not that it will be BSD licensed (nobody really gives a fuck what license the compiler is under), but that it will be supported directly by the BSD community, including the NetBSD hackers who have their bazillion architectures to support.

    1. Re:not every architecture by tajribah · · Score: 2, Insightful

      If they are interested in these architectures, they should help GCC folks maintain them instead of resurrecting obsolete compilers.

  22. sensationalist bullshit yet again by DreadSpoon · · Score: 5, Informative

    First: PCC has not YET supplanted GCC. The BSDs are hoping it will in the future.

    Second: The biggest attraction of PCC is NOT the license. The article submitter who stated otherwise is a jackass.

    Third: There are techical reasons why GCC is actaully unusable by some BSDs, such as NetBSD, which aims to support many architectures that GCC has dropped. NetBSD uses a combination of GCC 2, 3, and 4 to compile all of its different architectures. The NetBSD developers would rather have a single compiler that handles them all. Obviously PCC is nowhere near that level yet, of course.

    Fourth: GCC politics are a pain in the ass for many BSD developers who just want to submit patches to a compiler without the overhead of GNU's policies and GCC's management.

    Fifth: GCC produces crappy code more often than anyone would like. GCC bugs are far from unheard of, performance of generated code is often unpredictable between releases, and in many less commonly used architectures or sources GCC will produce incorrect code. Yes, these cases are very rare, but the BSD folks have hit the problem often enough for it to be a concern. PCC, being simpler and less bloated with cruft from multiple rewrites of the internals will hopefully produce correct and predictable code more often than GCC.

    Sixth: PCC actually works today. It can compile most of the NetBSD userspace, as I recall, and the kernel will be ready to roll soon after some inline assembler problems are fixed. This isn't some theoretical hacky project - it works right now. It's not ready to replace GCC just yet, by any means, but it's a lot more than some Slashdotters seem to think it is.

  23. Re:Does it crash less? by Mr+Z · · Score: 3, Insightful

    while the person you're responding to *is* a troll, I guess it's worth pointing out that GCC and other highly optimizing compilers will "break" some apps that a simpler compiler won't break. Why?

    Many optimizations rely on careful reading of the standard, and explicitly taking the liberties that the standard lets you take. For instance, the following loop terminates on a simple compiler, but becomes infinite on some optimizing compilers:

    int i = 1;

    while (i > 0)
    . . . i = i * 2;

    The ANSI C standard states specifically that signed integer overflow behavior is implementation defined. If you were expecting 'i' to go negative after 30 iterations, and for that to terminate the loop, you could be in for a nasty surprise.

    Suppose an application relied on this behavior, and now it misbehaves when compiled with GCC. Did GCC "break" that application? In some sense, yes: The app functions correctly with compiler (a) but not with compiler (b), so the app must be compiled with compiler (a). The breakage, however, happened because the application its not strictly conforming. It uses compiler dependent semantics, and that's hardly GCC's fault.

    Simpler compilers also don't reorder code as much, and don't optimize away as much "dead code." Stuff that really should have memory barriers, explicit synchronization and perhaps the volatile keyword applied to them run just fine without all those things when compiled with a simple compiler and run on a scalar, in-order CPU. The source code is also easier to read, because in the end the semantics are much more restricted--meaning the compiled output more closely resembles the source input. Give that code to a highly optimizing compiler, though, and run it on a super-scalar, out-of-order machine, and it'll break left, right and center. Is it the compiler's fault? Is it the CPU's fault? It's really the gap between the semantics the programmer thought he had (and happened to have in the simpler environment), and what C actually guarantees.

    Simpler compilers implement simpler semantics that are easier to understand, but only because they're compiling a very restricted form of C that offers way more implicit guarantees than the C standard actually does. Personally, unless that's made explicit (and therefore truly guaranteed forevermore by the compiler), I suspect it's actually a recipe for disaster. If nothing else, it could lead to code that's significantly harder to move to different platforms, since it'll start to rely on these simpler, "easier" semantics. Of course, then again, super-scalar out-of-order CPUs still strip a bunch of that away, so who knows, it might not be that bad.

    --Joe
  24. Does speed of compilation really matter to pros? by otis+wildflower · · Score: 2, Insightful

    Seriously, if you're writing code for a living, especially performance-critical code, isn't hardware/platform optimization for the end-use binary far more important than speed of compilation? Particularly if that binary gets blown out to hundreds or (of?) thousands of boxes. If I had to choose between a slow, but hand-tuned GCC for my platform or a quick other compiler that made correct but mediocre-performing (no SSE?/3DNow/VMX/VIS or whatever) binary code, I'd say GCC no contest.

    And frankly, slower compilers mean secksier hardware requirements for workstations.. ("Yes, GCC4 is slow, that's why I need that dual quad-core Xeon with 4GB RAM!!")

    Meh.

  25. GCC by MrCopilot · · Score: 2, Funny
    So is there an Arm-Linux-Pcc? CrossCompiler? Will I have to change my code?

    Then the answer is no. I may be alone in the world but I'm perfectly happy with the gcc compiler and have been for years. It does what its supposed to, It is FREE, It is crossplatform (MingW), and it annoys the BSD guys.

    Clear Winner. GCC

    It has been pointed out here, that people who choose a compiler based on its license are idiots. Well if I'm working on windows I use MingW specifically because of its license. If I'm working in Linux and I usually am, I choose GPL above all others. Count me as an Idiot if you like, But you can shove the alternatives. I know what I am getting and have a reasonable expectation what is coming in the future, and if I need to modify it (Heaven Forbid) I can. BSD is a fine license for people who NEED it. I don't. When given the choice I choose GPL. GCC Slower, maybe so. Code works and I get paid. If it takes 3 hrs for QT to compile. I bill for 3Hrs.

    Sorry but, I'm a pragmatist in all things except freedom. I've been burned enough. (Admittedly, I've personally never been burned by BSD code, unless you count Windows.)

    --
    OSGGFG - Open Source Gamers Guide to Free Games
  26. GCC is the Microsoft Windows of compilers... by argent · · Score: 4, Funny

    Think about it. Getting a new compiler into free UNIX and the open source community is going to be as hard as getting a new platform on the desktop to compete with Windows. And for similar reasons.

    You're not going to supplant GCC until you get all the code that depends on GCC-specific features modified to be standard portable C. That's a barrier to entry as steep as Microsoft's application barrier to entry. Now it's not as bad as it was in the early '90s when GCC was sprouting new C extensions everywhere (like the ability to have declarations not at the start of blocks, or the ability to leave the second element out of the trinary conditional operator, or things like alloca), and a lot of those features have now become common and even standardized (and others, like the shortcut trinary, have been deprecated). But it's not as easy as just having a good compiler, or even a good language translating ecosystem like Tendra... the playing field is anything but level.

  27. Pure ISO C99 has limitations when writing a kernel by tepples · · Score: 4, Insightful

    That's not a good test, given that Linux depends on gcc-isms. It's not written in any standardised form of C, which would be a far fairer test. How can a kernel be written in a standardized form of the C language? The C language does not specify any mechanism for alignment, struct packing, code sections, CPU-specific function calling conventions, or any of the various other attributes, nor does it allow for the kinds of inline assembly language needed to talk to the memory mapper or the I/O hardware.
  28. Debian GNU/kFreeBSD by tepples · · Score: 2, Interesting

    What happened to the Linux distro with the BSD userspace - haven't heard about that in a while now... I believe it was the other way around.
  29. Re:Your are misinformed by DrJimbo · · Score: 2, Insightful

    The license doesn't explicitly say you can't modify it because it goes without saying that you are not allowed to modify it. If the default was for licenses to be freely modifyable by recipients then they would all be worthless. Also, it would be asinine for the default to be that you can freely modify the license because then every single license would have to have a standard clause that says you can't modify it.

    The same rule applies to copyright notices. You are not allowed to modify the copyright notice on a work even though it doesn't explicitly say such modifications are forbidden. The BSD license reminds recipients that they have to keep the copyright intact, but this is done as a courtesy and is not required.

    As for your Wikipedia quote, I already gave a detailed explanation of how BSD licensed code can be distributed along with code that has a more restrictive license because this might be what has caused the widespread misunderstanding that you are still suffering from.

    The rule is trivially simple: unless you are given explicit permission from the original author, you can't change the license or copyright notice on someone else's work. Period.

    --
    We don't see the world as it is, we see it as we are.
    -- Anais Nin
  30. Re:Does it crash less? by Mr+Z · · Score: 2, Insightful

    It is extremely difficult and next to pointless to write code that is strictly conforming. It is in fact quite useful, for instance, to use unions to re-interpret bit patterns. (Note that "portable" is something rather different than "strictly conforming," or even "conforming." Many non-conforming programs are still highly portable because of commonalities among implementations.)

    For example, suppose you want to bit-reverse an entire array in memory. That is, bit 0 of the first element in the array swaps locations with bit N-1 of the last element of the array, bit 1 swaps locations with bit N-2, etc., all the way down to the middle of the array. How would you implement that as a strictly conforming ANSI C program? It turns out to be rather difficult to do correctly. (Why would you want to? Well, it's a handy way to flip bitmaps for one thing.)

    First, you have to know how many bits are in each unsigned char. There could be from 8 to who-knows-how-many bits in an unsigned char. (Yes, 256-bit unsigned char are legal in ANSI C, as long as there's at least as many bits in a short int, int, long int and long long int.) So, you can't rely on any fast, cute implementations such as this ever-popular word-reversal routine:

    unsigned int bitrev(unsigned int x)
    {
    x = ((x & 0xFFFF0000U) >> 16) | ((x & 0x0000FFFFU) << 16);
    x = ((x & 0xFF00FF00U) >> 8 ) | ((x & 0x00FF00FFU) << 8 );
    x = ((x & 0xF0F0F0F0U) >> 4 ) | ((x & 0x0F0F0F0FU) << 4 );
    x = ((x & 0xCCCCCCCCU) >> 2 ) | ((x & 0x33333333U) << 2 );
    x = ((x & 0xAAAAAAAAU) >> 1 ) | ((x & 0x55555555U) << 1 );
    return x;
    }

    That code is implementation defined. It cannot be part of a strictly conforming program. It can be part of a conforming program, though it only works as expected on machines whose unsigned int is 32 bits. (That happens to be over 90% of the PCs and *NIX boxes people work with these days, but that wasn't true as recently as 10 years ago.)

    What about other undefined things? Well, sometimes an implementation defines them usefully. For example, consider this bit of code:

    union
    {
    unsigned int word;
    unsigned char bytes[4];
    } foo;

    foo.word = 0x01020304;

    if (foo.bytes[0] == 1 && foo.bytes[1] == 2 && foo.bytes[2] == 3 && foo.bytes[3] == 4) printf("Big endian\n");
    else if (foo.bytes[3] == 1 && foo.bytes[2] == 2 && foo.bytes[1] == 3 && foo.bytes[0] == 4) printf("Little endian\n");
    else printf("Unknown endian\n");

    This is useful code. Chances are nearly every compiler you meet (at least, which offers 32-bit ints) will handle this correctly and tell you the endianness of the machine. That means it's reasonably portable. It also happens to be quite undefined.

    Sure, it fails miserably on oddball machines with non-standard word sizes, but most programs only care to be portable amongst the vast majority of machines that have 8-bit char, 16-bit short, 32-bit int. (This is part of the reason why LP64 machines are more popular than ILP64 machines.)

    In general, compilers implement a superset of the standard by providing reasonable semantics to expressions that the standard leaves undefined. For instance, on most compilers, signed arithmetic wraps around the same as unsigned arithmetic, and the values you get are exactly what you'd expect from 2s complement arithmetic, despite the fact that the standard leaves those results undefined. Heck, until the adoption of C9x, C++ style comments were not technically legal in C programs, but most compilers accepted them.

    --Joe
  31. Re: Right on by Hal_Porter · · Score: 2, Interesting

    Unfortunately, Microsoft made a decision not to use the boundary protection in their new operating system called "Windows". They ignored most of the work that Intel did providing support in the silicon for a decent micro operating system. The boundary protection could have been built into the programming language and runtime. Things would have been much better in the long term.

    16 bit Windows did use it, but just not for protection.

    Originally 8086s had a simple segmentation mode without protection. Each address was built up of seg<<16|offset. Since both segment and offset were 16 bit, this limited the address space to 1MB. Famously, the designers of the IBM PC reservered the upper 384K for IO, and this is where the 640K limit came from.

    Later on the 80286, protected mode was supported, where the value you loaded into a segment register was a selector, and index into a table of segments. The CPU supported different privilege levels called Rings with only the highly privileged ones allowed to create entries in this table.

    16 bit Windows did used 286 protected mode - it had to to get access to memory above 1MB. When it loaded it would install a DOS extender which would switch the PC into protected mode and allow 16 bit protected mode tasks to run on top of DOS. Since the 286 didn't allow you to switch back, each call into DOS used a triple fault to reset the processor and some Bios code to jump back into Windows.

    It was even possible to allocate buffers bigger than 64K. In that case, windows would set up an array of selectors for each 64K chunk. If C code wanted to access an arbitrary location in the buffer, the compiler would work out which 64K chunk it was in, load a segment register with the corrrect selector (this was a very slow operation since microcode in the 286 had to check permissions), calculate the offset and load it into one of the normal registers and then do the segment read. This was an incredibly slow process.

    It's also worth pointing out that 16 bit Windows used protected mode to get access to more memory, the like Dos the OS didn't protect itself from being damaged by third party applications. And it didn't stop third party applications damaging each other. As Walter Oney put it the philosphy was that it's a personal computer after all - If you're a programmer you can do what you like to it, just like you're free to run your car without oil until it seizes up.

    Once the 386 came out and allowed offsets into segments to be bigger than 64K Windows would even set the limit on the first selector to allow you to access the whole buffer with operand size overides. The 386 also supported Virtual 8086 mode, so protected mode could jump into DOS and segments would work like a 8086. But loading segment registers was still a very slow operation, and Windows NT and Linux which are both designed to stop applications corrupting each other or the system both used page tables to do it instead. But page tables don't protect against buffer overruns.

    Mind you segmentation only protects against buffer overruns if you malloc the buffers. Automatic variables on the stack are not protected. And allocing a stack variable is just a subtract instruction - it is orders of magnitude faster than calling into the OS, switching to Ring 0, allocating the memory, filling in the segment table and the returning to the caller who would load the selector into a segment register. Worse, there are very few segment registers, an each time you access any buffer you need to reload one. On a 286 there is CS,DS,ES.CS and DS are needed for near code and data, so only ES is free for far pointers. The 386 has FS and GS too, but three registers with very slow loads is not a recipe for a speedy machine.

    So Microsoft tried it and it was slow. If they'd have used it enough to avoid buffer overruns - i.e. malloc every buffer rather than allocating some on the stack it would have been really slow. And so all modern OSs rely on the page table for protection instead of segments so they can run on multiple processors. In x64 mode, segment limits aren't even checked by hardware anymore.

    --
    echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;