Programs made using GCC and it's included libs must be under GPL?

Geshtar

Limp Gawd
Joined
Apr 15, 2004
Messages
227
This is a question that has been bugging me for a long, long time. After searching I feel that I have found only a partial answer at best. Perhaps someone knows or can point me in the right direction.

Are programs you make with GCC required to be licensed under the GPL? What I have found on the GNU FAQ is that GNU tools do not impose the GPL on code you write. So that is nice, but what about the included standard libraries included with GCC? Aren't those under the GPL and using them(stuff like iostream, stdlib, etc) would force adoption of GPL terms for your program?

Thanks for any info.
 
Here is an example
Quake 4 for linux is compiled using GCC, but is not opensource, far from it.
It links dynamically to glibc, which is LGPL (different from GPL) which means that it doesn't need to use the license. Now if you link to software statically that is LGPL, you are supposed to open up the code I believe, or if you link to a GPL library dynamically or statically.

This is my understanding which could easily be wrong, and I suggest you read the licenses, but I can assure you that simply using a GPL is fine and dandy, and you don't have any thing to worry about, its when your modifying the code of a GPL or LGPL program/library that you are supposed to send that code into the maintainer(s) of the project.
 
Geshtar said:
This is a question that has been bugging me for a long, long time. After searching I feel that I have found only a partial answer at best. Perhaps someone knows or can point me in the right direction.

Are programs you make with GCC required to be licensed under the GPL? What I have found on the GNU FAQ is that GNU tools do not impose the GPL on code you write. So that is nice, but what about the included standard libraries included with GCC? Aren't those under the GPL and using them(stuff like iostream, stdlib, etc) would force adoption of GPL terms for your program?

Thanks for any info.

The GNU C libraries are under the LGPL. You don't have to open source your programs that link against them, only if you include them in your program (eg, static linking).

The GPL does not apply to the outputs of programs. A program is just the output of GCC, and as such does not fall under GCC's licensing.
 
Interesting, I will have learn how to do this dynamic linking stuff.

Thanks guys.
 
What gets funny is things like web applications - are you 'distributing' a modified application when you run it on your server & let people access it?
 
ameoba said:
What gets funny is things like web applications - are you 'distributing' a modified application when you run it on your server & let people access it?

Of course not, there no binaries.
Using != Giving
 
Pyrolistical said:
Of course not, there no binaries.
Using != Giving

How about having software installed on an office machine that you don't own?

The intent of the GPL is that "every user of a program gets the essential freedoms--to run it, to study and change the source code, to redistribute copies, and to publish modified versions" - being written in 1991 by a, at that time, pooly funded FSF, it's growing long in the teeth. This is why it's being rewritten and the next version of the license (GPL3) is expected to clarify & expand upon them.
 
ameoba said:
How about having software installed on an office machine that you don't own?

The intent of the GPL is that "every user of a program gets the essential freedoms--to run it, to study and change the source code, to redistribute copies, and to publish modified versions" - being written in 1991 by a, at that time, pooly funded FSF, it's growing long in the teeth. This is why it's being rewritten and the next version of the license (GPL3) is expected to clarify & expand upon them.


As long as your IT staff doesn't mind (and likely wouldn't for open source stuff), there shouldn't be any other issues.
 
I know more IT staffers who are afraid of open source than IT staffers who are against closed source, and most of what I hear from other people supports that bias. The campaigns by various companies against open source as a concept has been very effective in seeind fear, uncertainty, and doubt in the minds of IT professionals. Always check with your local IT people first, if you're not sure.
 
HorsePunchKid said:
I know more IT staffers who are afraid of open source than IT staffers who are against closed source, and most of what I hear from other people supports that bias. The campaigns by various companies against open source as a concept has been very effective in seeind fear, uncertainty, and doubt in the minds of IT professionals. Always check with your local IT people first, if you're not sure.


Funny, I did IT for awhile, and I'd recommend a lot of open source...too bad companys think that way.
 
GPL3 aims to change all this. Anything made using anything open source (this would include most distros linux that include anything under the GPL3) must release the code to their program.

So bottom line is that GPL3 (when it is finalized) will cause a tidlewave of forks and splits as soon as a few key pieces of software it up. Which in turn will further fragment the Linux community. This is not a good thing. :-/

So I urge you all to move to BSD style when releasing your code!
 
Pyrolistical said:
Funny, I did IT for awhile, and I'd recommend a lot of open source...too bad companys think that way.
Don't get me wrong, I do recommend it, but one has to be aware that some people just won't listen. There are times when you just want to leave out the fact that it's open source, and people can pretend it's just freeware or shareware or something. ;)
 
Xenarchy said:
GPL3 aims to change all this. Anything made using anything open source (this would include most distros linux that include anything under the GPL3) must release the code to their program.

So bottom line is that GPL3 (when it is finalized) will cause a tidlewave of forks and splits as soon as a few key pieces of software it up. Which in turn will further fragment the Linux community. This is not a good thing. :-/

So I urge you all to move to BSD style when releasing your code!

The Linux Kernel have taken out the clause stating that it can/will be upgraded to a newer version of the GPL (so I suppose its locked at v2). I don't see GPL3 gaining a whole lot of momentum, and anything I personally release from now on is actually going to be LGPL if I can help it, since I've had a hell of a time finding libs that will allow me freedom of my code (LGPL, BSD, Public, etc). I'm not too keen on releasing things as BSD since it gives away a bit too much for my taste.
 
Xenarchy said:
GPL3 aims to change all this. Anything made using anything open source (this would include most distros linux that include anything under the GPL3) must release the code to their program.

So bottom line is that GPL3 (when it is finalized) will cause a tidlewave of forks and splits as soon as a few key pieces of software it up. Which in turn will further fragment the Linux community. This is not a good thing. :-/

So I urge you all to move to BSD style when releasing your code!

I take it you're saving "GPL3 eats babies!!!" for another post?

The GPL deals with copyright. Copyright limits how you can distribute a program, not what you can do with the output. If you right code in a GPL3 text editor, it does not mean your code falls under the GPL3. In the same way, compiling a program with GCC will not cause it to be under the GPL.

Also, when you say "made with anything open source"...are you saying that the GPL is the only open source license? If so, I call shenanigans.
 
Lews_Therin said:
I take it you're saving "GPL3 eats babies!!!" for another post?

The GPL deals with copyright. Copyright limits how you can distribute a program, not what you can do with the output. If you right code in a GPL3 text editor, it does not mean your code falls under the GPL3. In the same way, compiling a program with GCC will not cause it to be under the GPL.

Also, when you say "made with anything open source"...are you saying that the GPL is the only open source license? If so, I call shenanigans.

Read the post above you for what I was hinting at. The point is that if GCC releases a compiler under GPL3 then all code compiled with that version must also be under GPL3 and so on. The GPL is a very viral license.
 
Xenarchy said:
Read the post above you for what I was hinting at. The point is that if GCC releases a compiler under GPL3 then all code compiled with that version must also be under GPL3 and so on. The GPL is a very viral license.

You still seem to be confused as to what the GPL is. Running an input through a GPL program does not make the input or output fall under the GPL, no matter what those might be.

Only if you were to use code from that compiler in your own program would your code fall under the restrictions of the GPL.
 
It's unusual for a program to not use code from the development tools that created them. Programs will require routines from the libraries that implement called CRTL functions, and even implement language features like static constructors.

Indeed, if I run some text through a GPL version of grep then I don't expect the GPL to attach to my output file. But if I run C++ source, I do wonder if the GPL has attached to my executable image becasue there's GPL-covered code, from printf() to whatever calls main(), in the image.
 
mikeblas said:
It's unusual for a program to not use code from the development tools that created them. Programs will require routines from the libraries that implement called CRTL functions, and even implement language features like static constructors.

Indeed, if I run some text through a GPL version of grep then I don't expect the GPL to attach to my output file. But if I run C++ source, I do wonder if the GPL has attached to my executable image becasue there's GPL-covered code, from printf() to whatever calls main(), in the image.
And what you're talking about here is really GLIB not GCC. And GLIB is released as LGPL. THE OUTPUT OF A GPL PROGRAM IS NOT FORCED TO BE GPL. The only exception to that would be if the license specifically adds a clause stating that. GCC does not. So no, programs compiled with GCC or other GPL compilers is in no danger of becoming GPL unless the compiler uses a GPL license on the C libraries used (GLIB).
 
Sgarissta said:
And what you're talking about here is really GLIB not GCC.

Could be. A compiler may emit stock, boilerplate code that isn't a part of its runtime libraries; intrinsic functions, for example.

I'm not much of a GCC user; I just fire it up for comparative analysis once in a while. So I can't say how much it relies on intrinsic functions for implementation or support, but I haven't used a compiler in a long time that didn't do this and I know the GCC does it at least a little.

Nor am I a lawyer; I'm not sure how to interpret the different flavors of the GPL.

I think this speaks to one of the core problems of the computer indsutry, though; EULAs have become increasingly complex and harder to understand. I sometimes wonder how companies that write these documents expect small businesses or individuals to even understand them.

The GPL tried to be simple, and it was, at first -- but it's succumbed to increasing complexity, too.
 
mikeblas said:
I sometimes wonder how companies that write these documents expect small businesses or individuals to even understand them.
The legal firms or departments that prepare these documents probably do not expect end users to understand them. In fact, I imagine that they intend EULAs to be incomprehensible. I'd bet that in the vast majority of cases, if IT managers actually understood the license terms, they would not be willing to use the software.
 
Lews_Therin said:
You still seem to be confused as to what the GPL is. Running an input through a GPL program does not make the input or output fall under the GPL, no matter what those might be.

Only if you were to use code from that compiler in your own program would your code fall under the restrictions of the GPL.

look my point isn't about GPL2 it is about GPL3 .. they are not the same. /sigh
 
mikeblas said:
Could be. A compiler may emit stock, boilerplate code that isn't a part of its runtime libraries; intrinsic functions, for example.

I'm not much of a GCC user; I just fire it up for comparative analysis once in a while. So I can't say how much it relies on intrinsic functions for implementation or support, but I haven't used a compiler in a long time that didn't do this and I know the GCC does it at least a little.

Nor am I a lawyer; I'm not sure how to interpret the different flavors of the GPL.

I think this speaks to one of the core problems of the computer indsutry, though; EULAs have become increasingly complex and harder to understand. I sometimes wonder how companies that write these documents expect small businesses or individuals to even understand them.

The GPL tried to be simple, and it was, at first -- but it's succumbed to increasing complexity, too.

No, he is correct, every distribution of Linux out there uses Glibc and its c++ counter part, and by default gcc dynamically links any programs compiled to use it, this means it doesn't have to be GPL.

Just look at the examples, such as Quake 4, Doom 3, UT 2004, or UT 2003, etc. are all close source programs, but have no licensing issues because they dynamically link to glibc, and any other LGPL (library GPL) licensed library in the system, like Quake4 and libSDL.

As for Xenarchy, quit it with the FUD, the GPL (in ANY variation) is only ever about the code written under that license, not about the program it creates. Its a way of copywriting your code, and the one main difference I have even heard of for GPL3 is its requirement of not using patented code. Also, any program currently written using GPL normally has a clause stating that the code can be worked with in the GPLs current variation OR whatever one is INCLUDED with the source (one of the things every GPL program does, is include the license itself), it doesn't require you to use the most recent, only that you can if you want. If GPL3 causes any problems, most of the community will just stick with GPL2, its not that hard, as it can't be phased out forcibly

Ahh, found a good little artical
http://www.onlamp.com/pub/a/onlamp/2005/09/22/gpl3.html

to quote
A lot of free software projects choose to use the following phrase in every of their program files:

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

But this means:

1. The user will choose which particular version of GPL he prefers, not the original software author.
2. The user could choose this moving target (GPL 2.0, 2.1, 2.x, 3.x) appropriately in case of a lawsuit.

Oh, another nice little tidbit
http://billgatliff.com/drupal/node/30
In an interview of Richard Stallman by CNET writer by Ingrid Marson [zdnet], RMS describes how the Free Software Foundation's GPL3 may address this risk. In my opinion, the proposed approach is a creative, even-handed solution that strikes a nice balance with web service providers and software developers while still protecting the fundamental objectives of the FSF. I hope something similar to what RMS describes in that interview makes it into the final GPL3 text.

Put simply, under GPL3 if a software program provides a mechanism that allows the user of the program to download a copy of the source code for the program, then recipients of that software won't be allowed to remove that functionality. That's all there is to it.
 
Wow, after this fell off the first page I thought it was a dead topic. Interesting discussion. Sounds like there isn't much to worry about using GCC and the libs that come with it, though I need to understand this linking stuff better so I don't ever accidentally statically link...still makes me a bit uneasy. I'm also gonna see if Boost and STLport can replace all the standard libs......just because I am always a bit paranoid when I'm not an expert on the subject.

Good link Xipher, it was a good read.
 
Geshtar said:
Wow, after this fell off the first page I thought it was a dead topic. Interesting discussion. Sounds like there isn't much to worry about using GCC and the libs that come with it, though I need to understand this linking stuff better so I don't ever accidentally statically link...still makes me a bit uneasy. I'm also gonna see if Boost and STLport can replace all the standard libs......just because I am always a bit paranoid when I'm not an expert on the subject.

Good link Xipher, it was a good read.

You have to manually specify a compiler flag to statically link stuff, if I remember correctly. Actually, it might be to create a static lib...I don't know, since I never use them.
 
if you want to know what libraries a program requires, you can use the program ldd to find out what it links too at runtime.
 
Back
Top