4 ms·
There are 2 different kinds of outputs here. A license that restricted or applied GPL to the object code emitted by the compiler would create gigantic waves.
by Nelson69 12y ago
There are 2 different kinds of outputs here. A license that restricted or applied GPL to the object code emitted by the compiler would create gigantic waves.
The compiler's AST isn't usually an output. This does seem like a dated issue, 20 years ago, there weren't as many C and C++ parsers, now there are a number of free ones. I feel pretty confident that 20 years ago, there would have been some proprietary compilers derived from GCC if they could emit the AST in an unrestricted sort of way. On more than a couple embedded projects I worked on some vendor distributed an absolutely PoS compiler because they had to to sell their parts and couldn't or wouldn't play ball with GCC. Honestly, now I'd think GCC's real value is in the optimizer, not so much the parser.
Seems like a fairly simple addendum to the license could GPL the GCC intermediate representation and their usage outside of GCC. That does create a logical loophole in that you don't want code compiled with GCC to be considered intermediate output and then GPLed by definition.
- sanxiyn 12y ago> I feel pretty confident that 20 years ago, there would have been some proprietary compilers derived from GCC if they could emit the AST in an unrestricted sort of way. Your confidence is 100% justified, because Open64 exists. It always has been possible to emit AST from GCC by simply modifying GCC yourself to do so. GCC is a free software after all. Open64 did that, and AMD used to sell a compiler using GCC frontend together with highly optimizing proprietary backend. More on http://tirania.org/blog/archive/2004/Apr-18.html http://tirania.org/blog/archive/2004/Apr-18.html What has not been possible is not to emit AST from GCC, but to emit AST from GCC and continue to benefit from GCC changes after that.