User: Password:
|
|
Subscribe / Log in / New account

GCC, LLVM, and compiler plugins

GCC, LLVM, and compiler plugins

Posted Jan 31, 2014 7:59 UTC (Fri) by marcH (subscriber, #57642)
In reply to: GCC, LLVM, and compiler plugins by artem
Parent article: GCC, LLVM, and compiler plugins

> Static linking obviously has different implications when you are distributing the binary.

No, static versus dynamic linking does not make any "obvious" difference with respect to the GPL. In fact the FSF argues the exact opposite.

"- Hi, is your program/work combined with any GPL code?
- No, it's not, I used dynamic linking as a workaround. Now don't forget to make sure you have libGPLx.so and libGPLy.so installed; without these there is not a chance it can work"

Do I find this made up example completely ridiculous and nonsensical? Yes. Could some red-neck court validate this anyway? Sure, why not? The sky is the limit.

This question has been debated a million times already, let's not do it once again. Just Google "GPL+dynamic+linking"

https://www.gnu.org/licenses/lgpl-java.html

> Look at the difference between GPL and LGPL - does it seem silly to you too?

The LGPL is not defined in terms of static versus dynamic linking.


(Log in to post comments)

GCC, LLVM, and compiler plugins

Posted Jan 31, 2014 13:59 UTC (Fri) by mathstuf (subscriber, #69389) [Link]

Without the text here, IIRC, the LGPL states something along the lines of that the LGPL portion must be replaceable by the end user. In practice, this is easy for shared but hard for static builds (as you'd have to ship you intermediate .a files per platform to avoid source).

GCC, LLVM, and compiler plugins

Posted Jan 31, 2014 14:44 UTC (Fri) by oshepherd (guest, #90163) [Link]

Lets just say, for the purposes of example, that said GPLed library was libgcc.so.0 (We will ignore the existence of the runtime library exception for the purposes of this example)

Is my program bound by the terms of the GPL just because it was compiled with GCC, which linked it against libgcc.so.0?

What about if on <my|one of my user's> systems, libgcc.so.0 is a symlink to libcompiler-rt.so.0? We will note that the latter is under the MIT/X11 license.

One would not argue that Compiler-RT is derivative of libgcc, in spite of implementing exactly the same interface. (In fact to do so would be to claim that an API is copyrightable, which is both preposterous and has been proven false in at least one jurisdiction (the US))

What about if my application was linked against libgcc.so.0 in the year 2001, long before Compiler-RT was created as a project?

I find it hard to reconcile this collection of situations into a consistent rule set which doesn't imply that the claimed restrictions of the GPL on dynamic linking may be an exaggeration of the truth.

YMMV. IANAL, and all that.

GCC, LLVM, and compiler plugins

Posted Jan 31, 2014 21:17 UTC (Fri) by marcH (subscriber, #57642) [Link]

When confusion reigns, it can be useful to take a giant step back. AFAIK the founding principle of the GPL is: if you take (something GPL) then you must give back (to the GPL community). I think it's quite clear that this is the rationale behind the "Derived Work" / "Combined Work" wording.

Joe is maintaining a very portable and closed source C application that runs on AIX and Solaris. One day his boss asks him to compile it on Linux for some new customers. Thanks to the good people at POSIX everything just works. Without Joe realizing it, GCC has sneaked some statically linked libgcc binary into his program (most developers have never heard about things like libgcc). Then he ships his closed source application as a binary to his Linux customers.

Joe never touched GCC or any GPL software before. Even though he did not change one line in his application he now has to give his entire program "back" to the GPL community because of some (irrelevant) implementation detail he did not even need to be aware of? Sorry but that does not make any kind of sense. Joe did not take anything from the GPL community. You could rather argue he made the effort to support GNU/Linux.

Of course not every case is that simple. Yet this is one is perfectly realistic and makes the libgcc exception ridiculously pointless.

GCC, LLVM, and compiler plugins

Posted Jan 31, 2014 21:43 UTC (Fri) by anselm (subscriber, #2796) [Link]

It is a very widespread belief that distributing a proprietary program that includes GPLed parts means that the whole program must be put under the GPL. That belief is, however, incorrect.

You never »have to give your entire program to the GPL community« if you inadvertently distributed it with some GPL code linked into it. Putting your own code under the GPL is just one of the options; you can also remove the GPL code in question and replace it with something under a more suitable license, or negotiate a separate license deal with the copyright holder(s).

In the GCC case, the libgcc license contains explicit language allowing you to link your stuff with libgcc and propagate the result, so as far as GCC is concerned the issue is moot, anyway.

GCC, LLVM, and compiler plugins

Posted Feb 1, 2014 11:22 UTC (Sat) by hummassa (subscriber, #307) [Link]

Anyway, the example is weird, and it's easily shown:

Joe is maintaining a very portable and closed source C application that runs on AIX and Solaris. One day his boss asks him to compile it on Windows for some new customers. Thanks to the good people at POSIX everything just works. Without Joe realizing it, MSVC has sneaked some statically linked msvcrt binary into his program (most developers have never heard about things like libgcc). Then he ships his closed source application as a binary to his Windows customers.

Joe never touched Microsoft software before. Even though he did not change one line in his application he now has to obey arbitrary Microsoft licensing terms? Sorry but that does not make any kind of sense. Joe did not take anything from Microsoft. You could rather argue he made the effort to support Windows.

Now, even if libgcc was 100%, just-GPL, don't let proprietary software near me, it's Joe's boss responsibility to follow the license for some software his company uses. Because it would be a liability to do otherwise... It is quite simple.

GCC, LLVM, and compiler plugins

Posted Feb 1, 2014 12:39 UTC (Sat) by khim (subscriber, #9252) [Link]

Joe did not take anything from Microsoft.
Really? Where exactly msvcrt comes from?

You could rather argue he made the effort to support Windows.
Does not matter. He shipped code made by Microsoft, he must play by Microsoft rules.

It's not a new development. Think dBase II (thirty years old by now): if you compile you program using dBase II compiler and want to ship the resulting .exe you need to pay royalty! Even if you didn't knew anything about Ashton-Tate and wrote you program without prior knowleadge of dBase (pretty hard to do in 1981, but we are talking hyphothetical possibilities here, right?)—you still need to pay royalty because said .exe includes bits and pieces owned by Ashton-Tate!

License fee for runtime package may not be common today (software is cheaper today as a matter of course, some is even free), but it was the norm half-century ago. And if law can force you to pay actual money for the privilege (the ability to actually ship compiled binary is a privilege not right as law is concerned!) then why it can not force you to do other things, too?

GCC, LLVM, and compiler plugins

Posted Feb 6, 2014 9:51 UTC (Thu) by hummassa (subscriber, #307) [Link]

whooosh? The sound of the parody I made passing over?

My point exactly. GPL's terms + copyright law = if you want to distribute it, follow the terms of the license.

GCC, LLVM, and compiler plugins

Posted Feb 6, 2014 18:59 UTC (Thu) by Wol (guest, #4433) [Link]

This dBase II example is hilarious, given that there is a pretty nice sting in the tale :-)

You do know that the original dBase was Public Domain, don't you? And there was a lawsuit over copying, which Ashton Tate pretty resoundingly lost ...

Cheers,
Wol

GCC, LLVM, and compiler plugins

Posted Feb 6, 2014 19:54 UTC (Thu) by khim (subscriber, #9252) [Link]

Said lawsuid had nothing to do with dBase runtime and everything to do with dBase language and file format. Basically Ashton-Tate wanted to outlaw Clipper and FoxPro and failed. This defeat meant you could use Clipper runtime for free but if you wanted to use orginal dBase II runtime for whatever reason you still needed to pay even after that “resounding defeat”. And of course all that happened much, much later in an era of dBase IV, not dBase II.

GCC, LLVM, and compiler plugins

Posted Feb 1, 2014 13:25 UTC (Sat) by marcH (subscriber, #57642) [Link]

Since when Microsoft licences have anything in common with the GPL??

GCC, LLVM, and compiler plugins

Posted Feb 2, 2014 0:49 UTC (Sun) by mathstuf (subscriber, #69389) [Link]

That you must conform to the terms and conditions before redistributing?


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds