Slashdot Mirror


GCC 4.8.0 Release Marks Completion of C++ Migration

hypnosec writes "GCC 4.8.0 has been released (download), and with it, the developers of the GNU Compiler Collection have switched to C++ as the implementation language, a project the developers have been working for years. Licensed under the GPLv3 or later, version 4.8.0 of the GCC not only brings with it performance improvements but also adds memory error detector AddressSanitizer, and race condition detection tool the ThreadSanitizer. Developers wanting to build their own version of GCC should have at their disposal a C++ compiler that understands C++ 2003."

46 of 269 comments (clear)

  1. Congrats to the poster and editor by Anonymous Coward · · Score: 2, Funny

    For not using the word "dog food" in the summary.

    1. Re:Congrats to the poster and editor by K.+S.+Kyosuke · · Score: 4, Funny

      For not using the word "dog food" in the summary.

      This isn't Microsoft, so that would be more like "cat food" - FLOSS developers are more like cats (they're difficult to Hurd, or how you spell it).

      --
      Ezekiel 23:20
  2. All right, by Anonymous Coward · · Score: 3, Funny

    This should be in the Debian repositories by the end of the decade.

  3. Re:chicken or egg? by Jeremi · · Score: 5, Informative

    How was the first compiler compiled?

    With an assembler. (of course, real men didn't need an assembler, they toggled in the hexadecimal opcodes directly in hex, using a hickory switch and a quart of whiskey)

    --


    I don't care if it's 90,000 hectares. That lake was not my doing.
  4. Re:chicken or egg? by WWJohnBrowningDo · · Score: 4, Informative

    It wasn't. It was written in assembly language and was converted into machine code by an assembler.

  5. Re:chicken or egg? by timeOday · · Score: 4, Insightful

    It is like everything in modern life... how do you build a lathe without a lathe? Or a generator without electricity? It would take a thousand years to start from nothing and get back to where we are now.

  6. Re:chicken or egg? by scarboni888 · · Score: 2

    You make it sound so easy.

  7. Re:chicken or egg? by ShanghaiBill · · Score: 5, Informative

    You need to compile this compiler with a compiler which begs the question....

    Sigh. It raises the question. To "beg the question" means something completely different. Here is a simple rule of thumb of when that phrase should be used: never.

    How was the first compiler compiled?

    The first compilers (Fortran and Lisp) were written in assembler. Later compilers were written in Lisp or Fortran.

    New languages can be bootstrapped by first implementing a sufficient subset, and then expanding it. Ken Thompson explains this process (and how to subvert the process) in his Turing Award lecture on Trusting Trust.

  8. Re:chicken or egg? by Laxori666 · · Score: 5, Insightful

    Enough people use the term "beg the question" this way that I've just gotten used to it by now. It doesn't bother me anymore. It's over, man. The war is lost. It's in common use now. Rewire the part of your brain that gets annoyed by it. You will be happier in the long run.

  9. Nice new feature by EvanED · · Score: 5, Interesting

    From the changelog: "A new general optimization level, -Og, has been introduced. It addresses the need for fast compilation and a superior debugging experience while providing a reasonable level of runtime performance. Overall experience for development should be better than the default optimization level -O0."

    This actually sounds really attractive to me... I'll have to try it out.

    1. Re:Nice new feature by drinkypoo · · Score: 5, Funny

      A new general optimization level, -Og, has been introduced. It addresses the need for fast compilation and a superior gangsta experience while providing no need to use an AK.

      It sounds like today was a good day.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    2. Re:Nice new feature by Impy+the+Impiuos+Imp · · Score: 2

      We've released embedded products running in debug compiles precisely because that's where almost all our testing is done, it fits in the memory constraints, and we occasionally had bugs with the regular, optimized code.

      So we release what we beat the hell out of.

      --
      (-1: Post disagrees with my already-settled worldview) is not a valid mod option.
  10. Re:chicken or egg? by Anonymous Coward · · Score: 5, Funny

    Hexadecimal? You kids and your newfangled contraptions. Back in my day, we had to use BINARY, and we were always running out of 1's so we had to take the 0's to the blacksmith and have them cut down and straightened before we could use them.

  11. Re:chicken or egg? by Livius · · Score: 2

    Sigh. It raises the question. To "beg the question" means something completely different. Here is a simple rule of thumb of when that phrase should be used: never.

    "Beg" is just (in the context of questions) an old-fashioned word for 'ask'.

    The problem is people use it to mean
    a) an answer that merely restates the question (asking the same question a second time)
    or
    b) an answer that is incomplete without the answer to an immediate follow-up question (providing a deficient answer that merely raises a trivially new question without having provided any useful information).

    The ambiguity is annoying.

    Though not as much as other people overreacting to it.

  12. Re:chicken or egg? by qbast · · Score: 4, Insightful

    Could we? Easily accessible deposits of any useful ore or fuel has been mined out ages ago. We could find ourselves in situation when we need resources to build tools, but without those tools we cannot access resources.

  13. Re:chicken or egg? by deadzaphod · · Score: 2

    We should, but I don't think anyone has it well organized so far. This book is a good start though http://en.wikipedia.org/wiki/The_Way_Things_Work

  14. Re:chicken or egg? by smittyoneeach · · Score: 4, Funny

    My supervisor held the hickory switch while I was manning the AN/UYK-7. Manfully.

    --
    Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
  15. Re:chicken or egg? by demonlapin · · Score: 3, Interesting

    Dave Gingery's books will get you a machine shop. That's a good start. (The first thing you build is a charcoal foundry. The second is a lathe.)

    There are also blacksmithing groups where you can learn how to make things with iron. Presumably any post-apocalyptic society will have ample supplies of scrap iron to work with.

  16. Yessssss! by Greyfox · · Score: 4, Funny

    Now! Witness the power of this FULLY OPERATIONAL C++ Compiler! Muahahahahahaha! Erm... damn it... what's the flag for debug symbols again?

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

  17. Re:chicken or egg? by smittyoneeach · · Score: 2

    "Everything's easy when you know how to do it."--me

    --
    Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
  18. Does it dance yet? by Anonymous Coward · · Score: 3, Interesting

    From Wikipedia:

    > LLVM was originally intended to use GCC's front end, but GCC turned out to cause some problems for both the LLVM developers and Apple. GCC is a large and somewhat cumbersome system to develop; as one long-time GCC developer put it, "Trying to make the hippo dance is not really a lot of fun"[7] and a Google Summer of Code intern commented, "Reading GCC codebase has been a hard exercise for me. In fact it's the only project I know of that becomes more and more difficult as time passes."[8]

    I'm just wondering, is this still the case? It sounds like they haven't changed much of anything, merely ported their codebase to C++. Am I correct in assuming that the above is still true or is this new version supposed to usher in a new era of GCC prosperity and usability on things other then the command line?

    1. Re:Does it dance yet? by TheRaven64 · · Score: 2

      No. The front ends are still tied to the middle in a strange way (for example, doing constant folding in the parser, so you can't get an accurate parse tree to use in refactoring tools from the gcc front end). It's also interesting to note that two of the features that they highlighted in this release, Address Sanitizer and Thread Sanitizer are things that began life in Clang / LLVM. This is largely due to the progression of Google's shift from GCC to LLVM (these tools were developed at Google). Given that Google currently employs about half of the active GCC developers, it will be interesting to see what happens in the long run.

      --
      I am TheRaven on Soylent News
  19. Re:chicken or egg? by Kjella · · Score: 2

    It is like everything in modern life... how do you build a lathe without a lathe? Or a generator without electricity? It would take a thousand years to start from nothing and get back to where we are now.

    I think you vastly underestimate how much time and effort has been spent on pursuits that were futile or that were technically possible but nobody had discovered or knew the usefulness of doing. If the technology was already described to us we'd advance far more rapidly and planned. I'd expect a reboot to Amish levels in 100 years, the 1950s in another 50 and catching up to today 50 years after that at most.

    --
    Live today, because you never know what tomorrow brings
  20. Licensed under the GPLv3 or later by snikulin · · Score: 2

    Can it be used for non-OSS development and releases of compiled binaries to a customer?
    It's not trolling, I really need to know (embedded dev here).

    1. Re:Licensed under the GPLv3 or later by thirdpoliceman · · Score: 2

      I was going to say yes, and I'm fairly sure the answer is yes. But, I have not read the GPL3, so I do not really know the difference between it an GPL2. It seems unlikely that they would force people to release code under an open source license because you compiled it with GCC. In fact, that is probably not possible because you own the copyright on your code and any compiler should be able to make it work (depending on portability). So, I would say yes, you can compile non-OSS projects with GCC 4.8.0.

    2. Re:Licensed under the GPLv3 or later by Anonymous Coward · · Score: 2, Informative

      The license makes it perfectly clear that you can use the latest GCC on proprietary code. Specifically:

      The purpose of this Exception is to allow compilation of non-GPL (including proprietary) programs to use, in this way, the header files and runtime libraries covered by this Exception.

    3. Re:Licensed under the GPLv3 or later by donscarletti · · Score: 4, Informative
      The license for the runtime is here, and yes, binaries compiled with gcc can be distributed under any license the author chooses, even after linking with the gcc runtime.

      Interestingly, the exception only is valid if you use GCC or another GPL licensed compiler to link it, to prevent the runtime being shanghaied in its GPL compliant entirety by another compiler.

      Finally, you cannot accidentally license your software under the GPL through linking. Only the copyright holder may assign a license and copyright comes through authorship. If you link your software with GPL software but do not license your software under compatible terms you merely violate the GPL and are liable for whatever penalties come from distributing unlicensed software. This probably will be relatively low if it is accidental and one agrees to remove it, since actual damages are most likely to be zero, only statutory damages and punitive damages (impossible if not deliberate) apply.

      --
      When Argumentum ad Hominem falls short, try Argumentum ad Matrem
  21. Re:chicken or egg? by Bing+Tsher+E · · Score: 3, Informative

    Puhlease. Octal. On the front panel of a PDP-8e.

  22. Re:chicken or egg? by wonkey_monkey · · Score: 3, Funny

    Screw that. I'm going to continue pulling people up on this one irregardless.

    --
    systemd is Roko's Basilisk.
  23. Re:chicken or egg? by Greyfox · · Score: 4, Interesting
    Back in '87 in my assembly language class, which was on some ancient DEC machine (Think it was a PDP 11-03 or something,) our instructor gave us all a sheet with the bootstrap code we had to type in, in octal, to make the system jump to the OS instructions on our 8" floppy disks. He showed us how to use a table in our assembly language book to convert assembly code to machine code by hand. If all you're looking at is a slab of iron (Arrhn!) that's where you start! It's a little intimidating imagining having to start with nothing but a table of opcodes and a slab of raw iron that you can enter bits into somehow. I'd think you'd want a basic program loader, so you could save the assembler that you carve out of opcodes. Once you have your assembler stored on disk, you can write your initial C compiler (Not the standard library mind you, just the compiler!) At some point along the way, you compile EMACS.

    Of course, all those pokes in the back of Compute! magazine were really just hand-converted machine instructions to be stuffed into specific areas of memory, but I didn't realize that at the time. I forget exactly when I finally made that association. I think it was during that assembly class; I was like "Oh, the number is just an opcode! Derp!" I probably could have squeezed a lot more interesting stuff out of my first computer (A TI 99/4A) if I'd know that at the time.

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

  24. Re:chicken or egg? by Kielistic · · Score: 2

    Yes it has been mined and is now conveniently placed on the surface instead of buried beneath it. If we hit some global catastrophe all that ore and raw material isn't going to vaporise (unless of course that was the catastrophe). If we have to melt down some sky scrapers for ore so be it.

  25. Re:chicken or egg? by ShanghaiBill · · Score: 2

    Building new GCCs could be painful for a lot of people, probably have to build earlier GCC compilers first just to be able to build the later version.

    There is no need for that. You just use a cross compiler. You only need to bootstrap a language once.

  26. Re:chicken or egg? by badboy_tw2002 · · Score: 2

    And then when the operator comes looking for you to fix something, you can be all like "That aint my program! Shit doesn't even look like my code! A lot of dudes we're typing in all sorts of things there, go find one of them!"

  27. Re:chicken or egg? by alexo · · Score: 4, Insightful

    Enough people use the term "beg the question" this way that I've just gotten used to it by now. It doesn't bother me anymore. It's over, man. The war is lost. It's in common use now.

    The problem with that approach is that you lose an important idiom that doesn't have a good substitute.

    So, no, some things in the language are worth preserving (at least until a suitable alternative is found).

    Rewire the part of your brain that gets annoyed by it. You will be happier in the long run.

    You can educate people about the beauty of the language without being annoyed.

    You know what, English is my 3rd language. I only moved into an English-speaking country when I was in my 30s, and if I can appreciate its richness, I'm pretty sure that a native speaker can do so as well.

  28. Re:chicken or egg? by larry+bagina · · Score: 2

    I think it's shorthand for "bugger the questioner", i.e. if someone asks you a question, you sodomize them. It's some sort of British thing, I guess.

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  29. Re:chicken or egg? by Brannoncyll · · Score: 2
  30. Re:GCC vs. CLang by Anonymous Coward · · Score: 2, Funny

    blows were landed, they both got tired, and now they're at the neighborhood watering hole
    telling the story for the fourth time in increasingly slurred words

  31. Re:GCC vs. CLang by Anonymous Coward · · Score: 3, Informative

    They're pretty equal. Some things compiled with GCC run better, others with CLang run better.

    At this point (and I mean exactly this point, no comment for future potential,) it's mostly a matter of license, which is pretty much irrelivant for compilers since even the GPL's copyleft doesn't force you to go GPL to use their compiler.

    To me it seems like the major motivation behind LLVM / Clang were to make a great open source compiler that wasn't GPL. They've succeeded, whether or not you agree with their intention is mostly politics.

    Having competition is good in any case. I'm sure that while there are plenty of fanboys and zealots on each side, I wouldn't be surprised if the major players behind each compiler collection were pretty cordial with eachother.

  32. except that by decora · · Score: 2, Informative

    clang is a lot faster and uses a huge amount less memory than GCC when running. for some projects this is rather important.

    gcc has a lot of cross-build chains out there, and a lot of experienced users. but i have never seen a clang->arm cross chain.

    clang++ is still using GNU libraries for C++ stuff.

    clang is still a pain in the ass to compile, with unclear instructions, and a massive, huge compile time. gcc on the other hand is built by automated scripts quite frequently as part of, for example, cross-toolchain builds.

    clang has vastly better error messages than gcc. this is increasingly important with the popularity of huge complex template libraries like boost, eigen, cgal, etc etc etc.

    1. Re:except that by lordholm · · Score: 2

      "clang is still a pain in the ass to compile, with unclear instructions, and a massive, huge compile time. gcc on the other hand is built by automated scripts quite frequently as part of, for example, cross-toolchain builds."

      Clang is really easy to build, usually easier than building GCC which often requires you to checkout multiple additional libraries (mpfr etc). Clang only requires that you clone two repositories: llvm and clang, clang is checked out into llvm/tools and the build process of llvm will automatically build clang for you. You then use cmake or autotools to configure, the first one is usually faster. GCC does take quite some time to build, but a lot of that time is spent in the configuration process which is slow as hell.

      Clang does support multiple targets out of the box, but it is not very easy to use (you need to pass a lot of different compiler switches to set the host triple, target cpu, system include directories et.c.). GCC on the other hand requires one installation per cross target and supports spec files that configures all these flags (e.g. system include directories) using the -B option.

      --
      "Civis Europaeus sum!"
  33. Re:chicken or egg? by demonlapin · · Score: 5, Interesting

    I remember seeing a pretty cool 8080 program to zero memory. It went something like:
    LXI BC, 0000
    LXI HL, 0009
    LXI SP, 0008
    PUSH BC
    PCHL
    HL, BC, and SP (the stack pointer) are all 16-bit registers, and the first three instructions occupy 0x0000-0x0008 in memory. PUSH BC is one byte at 0x0009, and PCHL (another one-byte instruction) sets the program counter to the value of HL; essentially it allows you to jump to the address contained in the HL register. The PUSH operation decremented the stack pointer before storing each of the bytes, so you would set the stack pointer to one higher than the highest address you wanted to overwrite. Because the 8080 was little-endian, address 0x0008 was the upper byte of the third instruction's numeric value - it was already zero (if it were big-endian you could just throw in a NOP to get it to align properly). The final PUSH operation - after the program had cycled through all of memory - wiped out the PUSH BC and PCHL operations, and the computer would go to all NOPs.

  34. Re:chicken or egg? by dryeo · · Score: 3, Interesting

    You need to compile this compiler with a compiler which begs the question....

    Sigh. It raises the question. To "beg the question" means something completely different. Here is a simple rule of thumb of when that phrase should be used: never.

    Nice comment.
    Language evolves. This makes it nice and raises the question of what I mean by "nice comment" From http://etymonline.com/?term=nice,
    nice (adj.) Look up nice at Dictionary.com
            late 13c., "foolish, stupid, senseless," from Old French nice (12c.) "careless, clumsy; weak; poor, needy; simple, stupid, silly, foolish," from Latin nescius "ignorant, unaware," literally "not-knowing," from ne- "not" (see un-) + stem of scire "to know" (see science). "The sense development has been extraordinary, even for an adj." [Weekley] -- from "timid" (pre-1300); to "fussy, fastidious" (late 14c.); to "dainty, delicate" (c.1400); to "precise, careful" (1500s, preserved in such terms as a nice distinction and nice and early); to "agreeable, delightful" (1769); to "kind, thoughtful" (1830).

    --
    https://en.wikipedia.org/wiki/Inverted_totalitarianism
  35. Re:boot straps itself with the system compiler by rs79 · · Score: 2

    You find a compiler binary or cross-compile it on another system.

    --
    Need Mercedes parts ?
  36. Re:GPLv3 .... by kthreadd · · Score: 3, Informative

    It's worth pointing out that GCC has been under GPLv3 since version 4.2.2 back in 2007. If it's a problem for anyone then it has been a problem for over five years now.

    http://gcc.gnu.org/ml/gcc-announce/2007/msg00004.html

  37. Re:chicken or egg? by wonkey_monkey · · Score: 3, Funny

    Which begs the question of why you felt the need to post, thus bringing us full circle.

    --
    systemd is Roko's Basilisk.
  38. Several superior substitutes serve systematically by stoploss · · Score: 2

    The problem with that approach is that you lose an important idiom that doesn't have a good substitute.

    The idiom has already been lost, if only because communication is fundamentally about conveying concepts among those involved in discourse. The term "begs the question" at best is ambiguous now, but truly the original definition has been supplanted in common usage. Thus, using the idiom increases confusion in discourse (which is considered harmful).

    Besides, "begs the question" (original idiom) doesn't mesh with the common usage of the word "beg" anymore, unlike how the "begs the question" (modern idiom) does. I argue that it was a poor choice of term in the first place.

    Better to start promulgating the Latin term "petitio principii" for the fallacy, which should remain unambiguous forever. Or try "presumes the argument" or "presumes the point" instead, both of which are self-explanatory and are unlikely to become obsolete. Hell, the latter form has the same syllable count as "begs the question".