Having fun with bzr

Post Syndicated from Lennart Poettering original https://0pointer.net/blog/projects/bizarre-fun.html

#nocomments y

So I wanted to hack proper channel mapping query support into libsndfile, something I have had
on my TODO list for years. The first step was to find the source code
repository for it
. That was easy. Alas the VCS used is bzr. There are some
very vocal folks on the Internet who claim that the bzr user interface is
stupendously easy to use in contrast to git which apparantly is the very
definition of complexity. And if it is stated on the Internet it must be true.
I think I mastered git quite well, so yeah, checking out the sources with bzr
can’t be that difficult for my limited brain capacity.

So let’s do what Erik suggests for checking out the sources:

$ bzr get http://www.mega-nerd.com/Bzr/libsndfile-pub/

Calling this I get a nice percentage counter that starts at 0% and ends at, … uh, 0%. That gives me a real feeling of progress. It takes a while, and then I get an error:

bzr: ERROR: Not a branch: "http://www.mega-nerd.com/Bzr/libsndfile-pub/".

Now that’s a useful error message. They even include an all-caps word! I guess that error message is right — it’s not a branch, it is a repository. Or is it not?

So what do we do about this? Maybe get is not actually the right verb. Let’s try to play around a bit. Let’s use the verb I use to get sources with in git:

$ bzr clone http://www.mega-nerd.com/Bzr/libsndfile-pub/

Hmm, this results in exactly same 0% to 0% progress counter, and the same useless error message.

Now I remember that bzr is actually more inspired by Subversion’s UI than by git’s, so let’s try it the SVN way.

$ bzr checkout http://www.mega-nerd.com/Bzr/libsndfile-pub/

Hmm, and of course, I get exactly the same results again. A counter that counts from 0% to 0% and the same useless error message.

Ok, maybe that error is bzr’s standard reply? Let’s check this out:

$ bzr waldo http://www.mega-nerd.com/Bzr/libsndfile-pub/
bzr: ERROR: unknown command "waldo"

Apparently not. bzr actually knows more than one error message.

Ok, I admit doing this by trial-and-error is a rather lame approach. RTFM! So let’s try this.

$ man bzr-get
No manual entry for bzr-get

Ouch. No man page? How awesome. Ah, wait, maybe they have only a single unreadable mega man page for everything. Let’s try this:

$ man bzr

Wow, this actually worked. Seems to list all commands. Now let’s look for the help on bzr get:

/bzr get
Pattern not found  (press RETURN)

Hmm, no documentation for their most important command? That’s weird! Ok, let’s try it again with our git vocabulary:

/bzr clone
Pattern not found  (press RETURN)

Ok, this not funny anymore. Apparently the verbs are listed in alphabetical order.
So let’s browse to the letter g as in get. However it doesn’t
exist. There’s bzr export, and then the next entry is bzr
help
(Oh, irony!) — but no get in-between.

Ok, enough of this shit. Maybe the message wants to tell us that the repo
actually doesn’t exist (even though it confusingly calls it a “branch”). Let’s
go back to the original page at Erik’s site and read things again. Aha, the
“main archive archive can be found at (yes, the directory looks empty, but
it isn’t): http://www.mega-nerd.com/Bzr/libsndfile-pub/“.

Hmm, indeed — that URL looks very empty when it is accessed. How weird though
that in bzr a repo is an empty directory!

And at this point I gave up and downloaded the tarball to make my patches
against. I have still not managed to check out the sources from the repo.
Somehow I get the feeling the actual repo really isn’t available anymore under that address.

So why am I blogging about this? Not so much to start another flamefest, to
nourish the fanboys, nor because it is so much fun to bash other people’s work or
simply to piss people off. It’s more for two reasons:

Firstly, simply to make
the point that folks can claim a thousand times that git’s UI sucks and bzr’s
UI is awesome. It’s simply not true. From what I experienced it is not the
tiniest bit better. The error messages useless, the documentation incomplete,
the interfaces surprising and exactly as redundant as git’s. The only
effective difference I noticed is that it takes a bit longer to show those
error messages with bzr — the Python tax. To summarize this more positively: git excels as much as bzr does. Both’ documentation, their error messages and their user interface are the best in their class. And they have all the best chances for future improvement.

And the second reason of course is that I’d still like to know what the correct way to get the sources is. But for that I should probably ask Erik himself.

Generating Copyright Headers from git History

Post Syndicated from Lennart Poettering original https://0pointer.net/blog/projects/copyright.html

Here’s a little a little tool I
wrote
that automatically generates copyright headers for source files in a
git repository based on the git history.

Run it like this:

~/projects/pulseaudio$ copyright.py src/pulsecore/sink.c src/pulsecore/core-util.c

And it will give you this:

File: src/pulsecore/sink.c
	Copyright 2004, 2006-2009 Lennart Poettering
	Copyright 2006-2007 Pierre Ossman
	Copyright 2008-2009 Marc-Andre Lureau
File: src/pulsecore/core-util.c
	Copyright 2004, 2006-2009 Lennart Poettering
	Copyright 2006-2007 Pierre Ossman
	Copyright 2008 Stelian Ionescu
	Copyright 2009 Jared D. McNeill
	Copyright 2009 Marc-Andre Lureau

This little script could use love from a friendly soul to make it crawl entire source trees and patch in appropriate copyright headers. Anyone up for it?

Tagging Audio Streams

Post Syndicated from Lennart Poettering original https://0pointer.net/blog/projects/tagging-audio.html

So you are hacking an audio application and the audio data you are
generating might eventually end up in PulseAudio before it is played. If that’s the case then please make sure
to read this!

Here’s the quick summary for Gtk+ developers:

PulseAudio can enforce all kinds of policy on sounds. For example, starting
in 0.9.15, we will automatically pause your media player while a phone call is
going on. To implement this we however need to know what the stream you
are sending to PulseAudio should be categorized as: is it music? Is it a
movie? Is it game sounds? Is it a phone call stream?

Also, PulseAudio would like to show a nice icon and an application name next
to each stream in the volume control. That requires it to be able to deduce
this data from the stream.

And here’s where you come into the game: please add three lines like the
following next to the beginning of your main() function to your Gtk+
application:

...
g_set_application_name(_("Totem Movie Player"));
gtk_window_set_default_icon_name("totem");
g_setenv("PULSE_PROP_media.role", "video", TRUE);
...

If you do this then the PulseAudio client libraries will be able to figure out the rest for you.

There is more meta information (aka “properties”) you can set for your application or for your streams that is useful to PulseAudio. In case you want to know more about them or you are looking for equivalent code to the above example for non-Gtk+ applications, make sure to read the mentioned page.

Thank you!

Oh, and even if your app doesn’t do audio, calling g_set_application_name() and gtk_window_set_default_icon_name() is always a good idea!

How to Version D-Bus Interfaces Properly and Why Using / as Service Entry Point Sucks

Post Syndicated from Lennart Poettering original https://0pointer.net/blog/projects/versioning-dbus.html

So you are designing a D-Bus interface and want to make it future-proof. Of
course, you thought about versioning your stuff. But you wonder how to do that
best. Here are a few things I learned about versioning D-Bus APIs which might
be of general interest:

Version your interfaces! This one is pretty obvious. No explanation
needed. Simply include the interface version in the interface name as suffix.
i.e. the initial release should use org.foobar.AwesomeStuff1, and if
you do changes you should introduce org.foobar.AwesomeStuff2, and so
on, possibly dropping the old interface.

When should you bump the interface version? Generally, I’d recommend only
bumping when doing incompatible changes, such as function call signature
changes. This of course requires clients to handle the
org.freedesktop.DBus.Error.UnknownMethod error properly for each function
you add to an existing interface. That said, in a few cases it might make sense
to bump the interface version even without breaking compatibility of the calls.
(e.g. in case you add something to an interface that is not directly visible in
the introspection data)

Version your services! This one is almost as obvious. When you
completely rework your D-Bus API introducing a new service name might be a
good idea. Best way to do this is by simply bumping the service name. Hence,
call your service org.foobar.AwesomeService1 right from the beginning
and then bump the version if you reinvent the wheel. And don’t forget that you
can acquire more than one well-known service name on the bus, so even if you
rework everything you can keep compatibilty. (Example: BlueZ 3 to BlueZ 4 switch)

Version your ‘entry point’ object paths! This one is far from
obvious. The reasons why object paths should be versioned are purely technical,
not philosophical: for signals sent from a service D-Bus overwrites the
originating service name by the unique name (e.g. :1.42) even if you
fill in a well-known name (e.g. org.foobar.AwesomeService1). Now,
let’s say your application registers two well-known service names, let’s say
two versions of the same service, versioned like mentioned above. And you have
two objects — one on each of the two service names — that implement a generic
interface and share the same object path: for the client there will be no way
to figure out to which service name the signals sent from this object path
belong. And that’s why you should make sure to use versioned and hence
different paths for both objects. i.e. start with
/org/foobar/AwesomeStuff1 and then bump to
/org/foobar/AwesomeStuff2 and so on. (Also see David’s comments about this.)

When should you bump the object path version? Probably only when you
bump the service name it belongs to. Important is to version the ‘entry point’
object path. Objects below that don’t need explicit versioning.

In summary: For good D-Bus API design you should version all three: D-Bus interfaces, service names and ‘entry point’ object paths.

And don’t forget: nobody gets API design right the first time. So even if
you think your D-Bus API is perfect: version things right from the beginning
because later on it might turn out you were not quite as bright as you thought
you were.

A corollary from the reasoning behind versioning object paths as described
above is that using / as entry point object path for your service is a
bad idea. It makes it very hard to implement more than one service or service
version on a single D-Bus connection. Again: Don’t use / as entry
point object path. Use something like /org/foobar/AwesomeStuff!

Writing Volume Control UIs is Hard

Post Syndicated from Lennart Poettering original https://0pointer.net/blog/projects/writing-volume-control-uis.html

Writing modern volume control UIs (i.e. ‘mixer tools’) is much harder to get
right than it might appear at first. Because that is the way it is I’ve put
together a rough
guide what to keep in mind when writing them for PulseAudio
. Originally
just intended to be a bit of help for the gnome-volume-control guys I believe
this could be an interesting read for other people as well.

It touches a lot of topics: volumes in general, how to present them,
what to present, base volumes, flat volumes, what to do about multichannel
volumes, controlling clients, controlling cards, handling default devices,
saving/restoring volumes/devices, sound event sliders, how to monitor PCM and
more.

So make sure to give it at least a quick peek! If you plan to write a volume
control for ncurses or KDE (hint, hint!) even more so, it’s a must read.

Maybe this might also help illustrating why I think that abstracting volume
control interfaces inside of abstraction layers such as Phonon or GStreamer is
doomed to fail, and just not even worth the try.

And now, without further ado I give you ‘Writing Volume Control UIs’.

Oh Nine Fifteen

Post Syndicated from Lennart Poettering original https://0pointer.net/blog/projects/oh-nine-fifteen.html

Last week I’ve released a
test version
for the upcoming 0.9.15 release of PulseAudio. It’s going to be a major one,
so here’s a little overview what’s new from the user’s perspective.

Flat Volumes

Based on code originally contributed by Marc-André Lureau we now
support Flat Volumes. The idea behind flat volumes has been
inspired by how Windows Vista handles volume control: instead of
maintaining one volume control per application stream plus one device
volume we instead fix the device volume automatically to the “loudest”
application stream volume. Sounds confusing? Actually it’s right the contrary, it feels pretty natural and
easy to use and brings us a big step forward to reduce a bit the
number of volume sliders in the entire audio pipeline from the application to what you hear.

The flat volumes logic only applies to devices where we know the
actual multiplication factor of the hardware volume slider. That’s
most devices supported by the ALSA kernel drivers except for a few
older devices and some cheap USB hardware that exports invalid
dB information.

On-the-fly Reconfiguration of Devices (aka “S/PDIF Support”)

PulseAudio will now automatically probe all possible combinations
of configurations how to use your sound card for playback and
capturing and then allow on-the-fly switching of the
configuration. What does that mean? Basically you may now switch
beetween “Analog Stereo”, “Digital S/PDIF Stereo”, “Analog Surround
5.1” (… and so on) on-the-fly without having to reconfigure PA on
the configuration file level or even having to stop your streams. This
fixes a couple of issues PA had previously, including proper SPDIF
support, and per-device configuration of the channel map of
devices.

Unfortunately there is no UI for this yet, and hence you need to
use pactl/pacmd on the command line to switch between the
profiles. Typing list-cards in pacmd will tell you
which profiles your card supports.

In a later PA version this functionality will be extended to also
allow input connector switching (i.e. microphone vs. line-in) and
output connector switching (i.e. internal speakers vs. line-out)
on-the-fly.

Native support for 24bit samples

PA now supports 24bit packed samples as well as 24bit stored in
the LSBs of 32bit integers natively. Previously these formats were
always converted into 32bit MSB samples.

Airport Express Support

Colin Guthrie contributed native Airport Express support. This will
make the RAOP
audio output of ApEx routers appear like local sound devices
(unfortunately sound devices with a very long latency), i.e. any
application connecting to PulseAudio can output audio to ApEx devices
in a similar way to how iTunes can do it on MacOSX.

Before you ask: it is unlikely that we will ever make PulseAudio be
able to act as an ApEx compatible device that takes connections from
iTunes (i.e. becoming a RAOP server instead of just an RAOP client).
Apple has an unfriendly attitude of dongling their devices to their
applications: normally iTunes has to cryptographically authenticate
itself to the device and the device to iTunes. iTunes’ key has been
recovered by the infamous Jon Lech
Johansen
, but the device key is still unknown. Without that key it
is not realistically possible to disguise PA as an ApEx.

Other stuff

There have been some extensive changes to natively support
Bluetooth audio devices well by directly accessing BlueZ. This code
was originally contributed by the GSoC student João Paulo Rechi
Vita. Initially, 0.9.15 was intended to become the version were BT audio
just works. Unfortunately the kernel is not really up to that yet, and
I am not sure everything will be in place so that 0.9.15 will ship
with well working BT support.

There have been a lot of internal changes and API additions. Most of
these however are not visible to the user.

Pascal,

Post Syndicated from Lennart Poettering original https://0pointer.net/blog/projects/pascal-terjan.html

replacing integral parts of a system is always a bit of a dilemma. If we
replace it only after all the other software/drivers that interface with it is known
to work well with it then nobody will bother doing all that compatbility work
since they can say “Nobody uses it yet, so why should I bother?” — and hence
the change can never take place.

If we replace it before everything works perfectly well with it, then folks
will complain: “Oh my god, it doesn’t work with my software/drivers, you suck!” — like you just did (though in more polite words).

Hence regardless which way we do it we will do it the wrong way. Biting the
bullet and doing the change is however still the better, the only path to
improvement. With the limited amount of manpower we have pushing things out
knowing that there is some software/drivers that don’t work well with it is our only
option — especially if the software in question is unfixable by us since it is
closed source.

Hence, if we’d do as you wish and not make the distributions adopt
PulseAudio right now we can forget about fixing audio on Linux entirely and it
will stagnate forever.

As mentioned by J5 this was the same story with D-Bus, HAL, with udev, and other stuff.

And again, folks may claim that PulseAudio is very buggy. While it certainly
has bugs, like every software has, most of the issues reported are not things
we can or should fix/work-around in PulseAudio, but that are in other layers of
the system. In ALSA, in the drivers, in the client applications. However only
PA makes them become visible since it depends on a lot more functionality to
work properly than any other program before. And quite frankly we use a lot of stuff exactly nobody has used
before and that of course was broken due that (in ALSA as one example).

Having said all this. Just pointing to other folks to blame doesn’t really
solve the problem. I did a lot of testing on different sound chips, making
sure PulseAudio works fine on them. Of course it’s a limited testing set (six
cards right now to be exact, a seventh model currently being sent to me by my
employer, Red Hat.). The list of cards that are currently known to be
problematic are listed
in our Wiki
.

I am not saying that the points you make are rubbish. However, please see the big picture before getting vocal about it.

Welcome (Finally!) to the GCC Runtime Library Exception

Post Syndicated from Bradley M. Kuhn original http://ebb.org/bkuhn/blog/2009/01/27/gcc-exception.html

For the past sixteen months, I participated in a bit of a “mini-GPLv3
process” among folks at the FSF, SFLC, the GNU Compiler Collection
Steering Committee (GCC SC), and the GCC community at large. We’ve been
drafting an important GPLv3 license exception (based on a concept by
David Edelsohn and Eben Moglen, that they invented even before the
GPLv3 process itself started).
Today, that
GCC Runtime Library Exception for GPLv3 went into production
.

I keep incessant track of my hours spent on various projects, so I have
hard numbers that show I personally spent 188 hours — a full month
of 40-hour weeks — on this project. I’m sure my colleagues
have spent similar amounts, too. I am proud of this time, and I think
it was absolutely worthwhile. I hope the discussion gives you a flavor
of why FLOSS license exception drafting is both incredibly important and
difficult to get right without the greatest of care and attention to
detail.

Why GPL Exceptions Exist

Before I jump into discussion of this GCC Runtime Library exception,
some background is needed. Exceptions have been a mainstay of copyleft
licensing since the inception of the GNU project, and once you’ve seen
many examples over many years, they become a standard part of FLOSS
licensing. However, for the casual FLOSS developer who doesn’t wish to
be a licensing wonk (down this path lies madness, my friends, run
screaming with your head covered!), exceptions are a rare discovery in a
random source file or two, and they do not command great attention. An
understandable reaction, but from a policy perspective, they are an
essential part of the copyleft system.

From the earliest days of the copyleft, it was understood that copyleft
was a merely a strategy to reach the goal of software freedom. The GPL
is a tool that implements this strategy, but like any tool, it doesn’t
fit every job.

In some sense, the LGPL was the earliest and certainly the most widely
known “GPL exception”. (Indeed, my friend Richard Fontana
came up with the idea to literally make LGPL an exception to
GPLv3, although in the v2 world, LGPLv2 was a fully separate license
from GPLv2.) Discussions on why the LGPL exists are beyond the scope of
this blog post
(although I’ve
written about them before
). Generally speaking, though, LGPL is
designed to be a tool when you don’t want the full force of copyleft for
all derivative works. Namely, you want to permit the creation of some
proprietary (or partly proprietary) derivative works because allowing
those derivations makes strategic sense in pursuing the goal of software
freedom.

Aside from the LGPL, the most common GPL exceptions are usually what we
generally categorize as “linking exceptions”. They allow
the modifier to take some GPL’d object code and combine it in some way
with some proprietary code during the compilation process. The simplest
of these exceptions is found when you, for example, write a GPL’d
program in a language with only a proprietary implementation, (e.g.,
VisualBasic) and you want to allow the code to combine with the
VisualBasic runtime libraries. You use your exclusive right as
copyright holder on the new program to grant downstream users,
redistributors and modifiers the right combine with those proprietary
libraries without having those libraries subject to copyleft.

In essence, copyleft exceptions are the scalpels of copyleft. They
allow you to create very carefully constructed carve-outs of permission
when pure copyleft is too blunt an instrument to advance the goal of
software freedom. Many software freedom policy questions require this
fine cutting work to reach the right outcome.

The GCC Exception

The GCC Exception (well, exceptions, really) have
always been a particularly interesting and complex use of a copyleft
exception. Initially, they were pragmatically needed to handle a
technological reality about compilers that interacts in a strange way
with copyright derivative works doctrine. Specifically, when you
compile a program with gcc, parts of GCC itself, called the runtime
library (and before that, crt0), are combined directly with your program
in the output binary. The binary, therefore, is both a derivative work
of your source code and a derivative work of the runtime library. If
GCC were pure GPL, every binary compiled with GCC would need to be
licensed under the terms of GPL.

Of course, when RMS was writing the first GCC, he realized immediately
this licensing implication and created an exception to avoid this.
Versions of that exception has been around and improved since the late
1980s. The task that our team faced in late 2007 was to update that
exception, both to adapt it to the excellent new GPLv3 exceptions
infrastructure (as Fontana did for LGPLv3), and to handle a new policy
question that has been kicking around the GCC world since 2002.

The Plugin Concern

For years, compiler experimentalists and researchers have been
frustrated by GCC. It’s very difficult to add a new optimization to GCC
because you need quite a deep understanding of the codebase to implement
one. Indeed I tried myself, as a graduate student in programming
languages in the mid-1990s, to learn enough about GCC to do this, but
gave up when a few days of study got me nowhere. Advancement of
compiler technology can only happen when optimization experimentation
can happen easily.

To make it easy to try new optimizations out, GCC needs a plugin
architecture. However, the GCC community has resisted this because of
the software freedom implications of such an architecture: if plugins
are easy to write, then it will be easy to write out to disk a version
of GCC’s internal program representation (sometimes called the
intermediate representation, or IR). Then, proprietary programs could
be used to analyze and optimize this IR, and a plugin could be used to
read the file back into GCC.

From a licensing perspective, such an optimizing proprietary program
will usually not be a derivative work of GCC; it merely reads and writes
some file format. It’s analogous to OpenOffice reading and writing
Microsoft Word files, which doesn’t make it a derivative of Word by any
means! The only parts that are covered by GPL are the actual plugins to
GCC to read and write the format, just as OpenOffice’s Word reader and
writer are Free Software, but Microsoft Word is not.

This licensing implication is a disaster for the GCC community. It
would mean the advent of “compilation processes” that were
“mixed”, FaiF and proprietary. The best, most difficult and
most interesting parts of that compilation process — the
optimizations — could be fully proprietary!

This outcome is unacceptable from a software freedom policy
perspective, but difficult to handle in licensing. Eben Moglen, David
Edelsohn, and a few others, however, came up with an innovative idea:
since all binaries are derivative of GCC anyway, set up the exception so
that proprietary binary output from GCC is permitted only when the
entire compilation process involves Free Software. In other words, you
can do these proprietary optimization plugins all you want, but if you
do, you’ll not be able to compile anything but GPL’d software with
them!

The Drafting and the Outcome

As every developer knows, the path from “innovative idea”
to “working implementation” is a long road. It’s just as
true with licensing policy as it is with code. Those 188 hours that
I’ve spent, along with even more hours spent by a cast of dozens, have
been spent making a license exception that implements that idea
accurately without messing up the GCC community or its licensing
structure.

With jubilation today, I link to
the announcement
from the
FSF
, the
FAQ and Rationale for the exception
and
the final
text of the exception itself
. This sixteen-month long cooperation
between the FSF, the SFLC, the GCC SC, and the GCC community has
produced some fine licensing policy that will serve our community well
for years to come. I am honored to have been a part of it, and a bit
relieved that it is complete.

Welcome (Finally!) to the GCC Runtime Library Exception

Post Syndicated from Bradley M. Kuhn original http://ebb.org/bkuhn/blog/2009/01/27/gcc-exception.html

For the past sixteen months, I participated in a bit of a “mini-GPLv3
process” among folks at the FSF, SFLC, the GNU Compiler Collection
Steering Committee (GCC SC), and the GCC community at large. We’ve been
drafting an important GPLv3 license exception (based on a concept by
David Edelsohn and Eben Moglen, that they invented even before the
GPLv3 process itself started).
Today, that
GCC Runtime Library Exception for GPLv3 went into production
.

I keep incessant track of my hours spent on various projects, so I have
hard numbers that show I personally spent 188 hours — a full month
of 40-hour weeks — on this project. I’m sure my colleagues
have spent similar amounts, too. I am proud of this time, and I think
it was absolutely worthwhile. I hope the discussion gives you a flavor
of why FLOSS license exception drafting is both incredibly important and
difficult to get right without the greatest of care and attention to
detail.

Why GPL Exceptions Exist

Before I jump into discussion of this GCC Runtime Library exception,
some background is needed. Exceptions have been a mainstay of copyleft
licensing since the inception of the GNU project, and once you’ve seen
many examples over many years, they become a standard part of FLOSS
licensing. However, for the casual FLOSS developer who doesn’t wish to
be a licensing wonk (down this path lies madness, my friends, run
screaming with your head covered!), exceptions are a rare discovery in a
random source file or two, and they do not command great attention. An
understandable reaction, but from a policy perspective, they are an
essential part of the copyleft system.

From the earliest days of the copyleft, it was understood that copyleft
was a merely a strategy to reach the goal of software freedom. The GPL
is a tool that implements this strategy, but like any tool, it doesn’t
fit every job.

In some sense, the LGPL was the earliest and certainly the most widely
known “GPL exception”. (Indeed, my friend Richard Fontana
came up with the idea to literally make LGPL an exception to
GPLv3, although in the v2 world, LGPLv2 was a fully separate license
from GPLv2.) Discussions on why the LGPL exists are beyond the scope of
this blog post
(although I’ve
written about them before
). Generally speaking, though, LGPL is
designed to be a tool when you don’t want the full force of copyleft for
all derivative works. Namely, you want to permit the creation of some
proprietary (or partly proprietary) derivative works because allowing
those derivations makes strategic sense in pursuing the goal of software
freedom.

Aside from the LGPL, the most common GPL exceptions are usually what we
generally categorize as “linking exceptions”. They allow
the modifier to take some GPL’d object code and combine it in some way
with some proprietary code during the compilation process. The simplest
of these exceptions is found when you, for example, write a GPL’d
program in a language with only a proprietary implementation, (e.g.,
VisualBasic) and you want to allow the code to combine with the
VisualBasic runtime libraries. You use your exclusive right as
copyright holder on the new program to grant downstream users,
redistributors and modifiers the right combine with those proprietary
libraries without having those libraries subject to copyleft.

In essence, copyleft exceptions are the scalpels of copyleft. They
allow you to create very carefully constructed carve-outs of permission
when pure copyleft is too blunt an instrument to advance the goal of
software freedom. Many software freedom policy questions require this
fine cutting work to reach the right outcome.

The GCC Exception

The GCC Exception (well, exceptions, really) have
always been a particularly interesting and complex use of a copyleft
exception. Initially, they were pragmatically needed to handle a
technological reality about compilers that interacts in a strange way
with copyright derivative works doctrine. Specifically, when you
compile a program with gcc, parts of GCC itself, called the runtime
library (and before that, crt0), are combined directly with your program
in the output binary. The binary, therefore, is both a derivative work
of your source code and a derivative work of the runtime library. If
GCC were pure GPL, every binary compiled with GCC would need to be
licensed under the terms of GPL.

Of course, when RMS was writing the first GCC, he realized immediately
this licensing implication and created an exception to avoid this.
Versions of that exception has been around and improved since the late
1980s. The task that our team faced in late 2007 was to update that
exception, both to adapt it to the excellent new GPLv3 exceptions
infrastructure (as Fontana did for LGPLv3), and to handle a new policy
question that has been kicking around the GCC world since 2002.

The Plugin Concern

For years, compiler experimentalists and researchers have been
frustrated by GCC. It’s very difficult to add a new optimization to GCC
because you need quite a deep understanding of the codebase to implement
one. Indeed I tried myself, as a graduate student in programming
languages in the mid-1990s, to learn enough about GCC to do this, but
gave up when a few days of study got me nowhere. Advancement of
compiler technology can only happen when optimization experimentation
can happen easily.

To make it easy to try new optimizations out, GCC needs a plugin
architecture. However, the GCC community has resisted this because of
the software freedom implications of such an architecture: if plugins
are easy to write, then it will be easy to write out to disk a version
of GCC’s internal program representation (sometimes called the
intermediate representation, or IR). Then, proprietary programs could
be used to analyze and optimize this IR, and a plugin could be used to
read the file back into GCC.

From a licensing perspective, such an optimizing proprietary program
will usually not be a derivative work of GCC; it merely reads and writes
some file format. It’s analogous to OpenOffice reading and writing
Microsoft Word files, which doesn’t make it a derivative of Word by any
means! The only parts that are covered by GPL are the actual plugins to
GCC to read and write the format, just as OpenOffice’s Word reader and
writer are Free Software, but Microsoft Word is not.

This licensing implication is a disaster for the GCC community. It
would mean the advent of “compilation processes” that were
“mixed”, FaiF and proprietary. The best, most difficult and
most interesting parts of that compilation process — the
optimizations — could be fully proprietary!

This outcome is unacceptable from a software freedom policy
perspective, but difficult to handle in licensing. Eben Moglen, David
Edelsohn, and a few others, however, came up with an innovative idea:
since all binaries are derivative of GCC anyway, set up the exception so
that proprietary binary output from GCC is permitted only when the
entire compilation process involves Free Software. In other words, you
can do these proprietary optimization plugins all you want, but if you
do, you’ll not be able to compile anything but GPL’d software with
them!

The Drafting and the Outcome

As every developer knows, the path from “innovative idea”
to “working implementation” is a long road. It’s just as
true with licensing policy as it is with code. Those 188 hours that
I’ve spent, along with even more hours spent by a cast of dozens, have
been spent making a license exception that implements that idea
accurately without messing up the GCC community or its licensing
structure.

With jubilation today, I link to
the announcement
from the
FSF
, the
FAQ and Rationale for the exception
and
the final
text of the exception itself
. This sixteen-month long cooperation
between the FSF, the SFLC, the GCC SC, and the GCC community has
produced some fine licensing policy that will serve our community well
for years to come. I am honored to have been a part of it, and a bit
relieved that it is complete.

Welcome (Finally!) to the GCC Runtime Library Exception

Post Syndicated from Bradley M. Kuhn original http://ebb.org/bkuhn/blog/2009/01/27/gcc-exception.html

For the past sixteen months, I participated in a bit of a “mini-GPLv3
process” among folks at the FSF, SFLC, the GNU Compiler Collection
Steering Committee (GCC SC), and the GCC community at large. We’ve been
drafting an important GPLv3 license exception (based on a concept by
David Edelsohn and Eben Moglen, that they invented even before the
GPLv3 process itself started).
Today, that
GCC Runtime Library Exception for GPLv3 went into production
.

I keep incessant track of my hours spent on various projects, so I have
hard numbers that show I personally spent 188 hours — a full month
of 40-hour weeks — on this project. I’m sure my colleagues
have spent similar amounts, too. I am proud of this time, and I think
it was absolutely worthwhile. I hope the discussion gives you a flavor
of why FLOSS license exception drafting is both incredibly important and
difficult to get right without the greatest of care and attention to
detail.

Why GPL Exceptions Exist

Before I jump into discussion of this GCC Runtime Library exception,
some background is needed. Exceptions have been a mainstay of copyleft
licensing since the inception of the GNU project, and once you’ve seen
many examples over many years, they become a standard part of FLOSS
licensing. However, for the casual FLOSS developer who doesn’t wish to
be a licensing wonk (down this path lies madness, my friends, run
screaming with your head covered!), exceptions are a rare discovery in a
random source file or two, and they do not command great attention. An
understandable reaction, but from a policy perspective, they are an
essential part of the copyleft system.

From the earliest days of the copyleft, it was understood that copyleft
was a merely a strategy to reach the goal of software freedom. The GPL
is a tool that implements this strategy, but like any tool, it doesn’t
fit every job.

In some sense, the LGPL was the earliest and certainly the most widely
known “GPL exception”. (Indeed, my friend Richard Fontana
came up with the idea to literally make LGPL an exception to
GPLv3, although in the v2 world, LGPLv2 was a fully separate license
from GPLv2.) Discussions on why the LGPL exists are beyond the scope of
this blog post
(although I’ve
written about them before
). Generally speaking, though, LGPL is
designed to be a tool when you don’t want the full force of copyleft for
all derivative works. Namely, you want to permit the creation of some
proprietary (or partly proprietary) derivative works because allowing
those derivations makes strategic sense in pursuing the goal of software
freedom.

Aside from the LGPL, the most common GPL exceptions are usually what we
generally categorize as “linking exceptions”. They allow
the modifier to take some GPL’d object code and combine it in some way
with some proprietary code during the compilation process. The simplest
of these exceptions is found when you, for example, write a GPL’d
program in a language with only a proprietary implementation, (e.g.,
VisualBasic) and you want to allow the code to combine with the
VisualBasic runtime libraries. You use your exclusive right as
copyright holder on the new program to grant downstream users,
redistributors and modifiers the right combine with those proprietary
libraries without having those libraries subject to copyleft.

In essence, copyleft exceptions are the scalpels of copyleft. They
allow you to create very carefully constructed carve-outs of permission
when pure copyleft is too blunt an instrument to advance the goal of
software freedom. Many software freedom policy questions require this
fine cutting work to reach the right outcome.

The GCC Exception

The GCC Exception (well, exceptions, really) have
always been a particularly interesting and complex use of a copyleft
exception. Initially, they were pragmatically needed to handle a
technological reality about compilers that interacts in a strange way
with copyright derivative works doctrine. Specifically, when you
compile a program with gcc, parts of GCC itself, called the runtime
library (and before that, crt0), are combined directly with your program
in the output binary. The binary, therefore, is both a derivative work
of your source code and a derivative work of the runtime library. If
GCC were pure GPL, every binary compiled with GCC would need to be
licensed under the terms of GPL.

Of course, when RMS was writing the first GCC, he realized immediately
this licensing implication and created an exception to avoid this.
Versions of that exception has been around and improved since the late
1980s. The task that our team faced in late 2007 was to update that
exception, both to adapt it to the excellent new GPLv3 exceptions
infrastructure (as Fontana did for LGPLv3), and to handle a new policy
question that has been kicking around the GCC world since 2002.

The Plugin Concern

For years, compiler experimentalists and researchers have been
frustrated by GCC. It’s very difficult to add a new optimization to GCC
because you need quite a deep understanding of the codebase to implement
one. Indeed I tried myself, as a graduate student in programming
languages in the mid-1990s, to learn enough about GCC to do this, but
gave up when a few days of study got me nowhere. Advancement of
compiler technology can only happen when optimization experimentation
can happen easily.

To make it easy to try new optimizations out, GCC needs a plugin
architecture. However, the GCC community has resisted this because of
the software freedom implications of such an architecture: if plugins
are easy to write, then it will be easy to write out to disk a version
of GCC’s internal program representation (sometimes called the
intermediate representation, or IR). Then, proprietary programs could
be used to analyze and optimize this IR, and a plugin could be used to
read the file back into GCC.

From a licensing perspective, such an optimizing proprietary program
will usually not be a derivative work of GCC; it merely reads and writes
some file format. It’s analogous to OpenOffice reading and writing
Microsoft Word files, which doesn’t make it a derivative of Word by any
means! The only parts that are covered by GPL are the actual plugins to
GCC to read and write the format, just as OpenOffice’s Word reader and
writer are Free Software, but Microsoft Word is not.

This licensing implication is a disaster for the GCC community. It
would mean the advent of “compilation processes” that were
“mixed”, FaiF and proprietary. The best, most difficult and
most interesting parts of that compilation process — the
optimizations — could be fully proprietary!

This outcome is unacceptable from a software freedom policy
perspective, but difficult to handle in licensing. Eben Moglen, David
Edelsohn, and a few others, however, came up with an innovative idea:
since all binaries are derivative of GCC anyway, set up the exception so
that proprietary binary output from GCC is permitted only when the
entire compilation process involves Free Software. In other words, you
can do these proprietary optimization plugins all you want, but if you
do, you’ll not be able to compile anything but GPL’d software with
them!

The Drafting and the Outcome

As every developer knows, the path from “innovative idea”
to “working implementation” is a long road. It’s just as
true with licensing policy as it is with code. Those 188 hours that
I’ve spent, along with even more hours spent by a cast of dozens, have
been spent making a license exception that implements that idea
accurately without messing up the GCC community or its licensing
structure.

With jubilation today, I link to
the announcement
from the
FSF
, the
FAQ and Rationale for the exception
and
the final
text of the exception itself
. This sixteen-month long cooperation
between the FSF, the SFLC, the GCC SC, and the GCC community has
produced some fine licensing policy that will serve our community well
for years to come. I am honored to have been a part of it, and a bit
relieved that it is complete.

Welcome (Finally!) to the GCC Runtime Library Exception

Post Syndicated from Bradley M. Kuhn original http://ebb.org/bkuhn/blog/2009/01/27/gcc-exception.html

For the past sixteen months, I participated in a bit of a “mini-GPLv3
process” among folks at the FSF, SFLC, the GNU Compiler Collection
Steering Committee (GCC SC), and the GCC community at large. We’ve been
drafting an important GPLv3 license exception (based on a concept by
David Edelsohn and Eben Moglen, that they invented even before the
GPLv3 process itself started).
Today, that
GCC Runtime Library Exception for GPLv3 went into production
.

I keep incessant track of my hours spent on various projects, so I have
hard numbers that show I personally spent 188 hours — a full month
of 40-hour weeks — on this project. I’m sure my colleagues
have spent similar amounts, too. I am proud of this time, and I think
it was absolutely worthwhile. I hope the discussion gives you a flavor
of why FLOSS license exception drafting is both incredibly important and
difficult to get right without the greatest of care and attention to
detail.

Why GPL Exceptions Exist

Before I jump into discussion of this GCC Runtime Library exception,
some background is needed. Exceptions have been a mainstay of copyleft
licensing since the inception of the GNU project, and once you’ve seen
many examples over many years, they become a standard part of FLOSS
licensing. However, for the casual FLOSS developer who doesn’t wish to
be a licensing wonk (down this path lies madness, my friends, run
screaming with your head covered!), exceptions are a rare discovery in a
random source file or two, and they do not command great attention. An
understandable reaction, but from a policy perspective, they are an
essential part of the copyleft system.

From the earliest days of the copyleft, it was understood that copyleft
was a merely a strategy to reach the goal of software freedom. The GPL
is a tool that implements this strategy, but like any tool, it doesn’t
fit every job.

In some sense, the LGPL was the earliest and certainly the most widely
known “GPL exception”. (Indeed, my friend Richard Fontana
came up with the idea to literally make LGPL an exception to
GPLv3, although in the v2 world, LGPLv2 was a fully separate license
from GPLv2.) Discussions on why the LGPL exists are beyond the scope of
this blog post
(although I’ve
written about them before
). Generally speaking, though, LGPL is
designed to be a tool when you don’t want the full force of copyleft for
all derivative works. Namely, you want to permit the creation of some
proprietary (or partly proprietary) derivative works because allowing
those derivations makes strategic sense in pursuing the goal of software
freedom.

Aside from the LGPL, the most common GPL exceptions are usually what we
generally categorize as “linking exceptions”. They allow
the modifier to take some GPL’d object code and combine it in some way
with some proprietary code during the compilation process. The simplest
of these exceptions is found when you, for example, write a GPL’d
program in a language with only a proprietary implementation, (e.g.,
VisualBasic) and you want to allow the code to combine with the
VisualBasic runtime libraries. You use your exclusive right as
copyright holder on the new program to grant downstream users,
redistributors and modifiers the right combine with those proprietary
libraries without having those libraries subject to copyleft.

In essence, copyleft exceptions are the scalpels of copyleft. They
allow you to create very carefully constructed carve-outs of permission
when pure copyleft is too blunt an instrument to advance the goal of
software freedom. Many software freedom policy questions require this
fine cutting work to reach the right outcome.

The GCC Exception

The GCC Exception (well, exceptions, really) have
always been a particularly interesting and complex use of a copyleft
exception. Initially, they were pragmatically needed to handle a
technological reality about compilers that interacts in a strange way
with copyright derivative works doctrine. Specifically, when you
compile a program with gcc, parts of GCC itself, called the runtime
library (and before that, crt0), are combined directly with your program
in the output binary. The binary, therefore, is both a derivative work
of your source code and a derivative work of the runtime library. If
GCC were pure GPL, every binary compiled with GCC would need to be
licensed under the terms of GPL.

Of course, when RMS was writing the first GCC, he realized immediately
this licensing implication and created an exception to avoid this.
Versions of that exception has been around and improved since the late
1980s. The task that our team faced in late 2007 was to update that
exception, both to adapt it to the excellent new GPLv3 exceptions
infrastructure (as Fontana did for LGPLv3), and to handle a new policy
question that has been kicking around the GCC world since 2002.

The Plugin Concern

For years, compiler experimentalists and researchers have been
frustrated by GCC. It’s very difficult to add a new optimization to GCC
because you need quite a deep understanding of the codebase to implement
one. Indeed I tried myself, as a graduate student in programming
languages in the mid-1990s, to learn enough about GCC to do this, but
gave up when a few days of study got me nowhere. Advancement of
compiler technology can only happen when optimization experimentation
can happen easily.

To make it easy to try new optimizations out, GCC needs a plugin
architecture. However, the GCC community has resisted this because of
the software freedom implications of such an architecture: if plugins
are easy to write, then it will be easy to write out to disk a version
of GCC’s internal program representation (sometimes called the
intermediate representation, or IR). Then, proprietary programs could
be used to analyze and optimize this IR, and a plugin could be used to
read the file back into GCC.

From a licensing perspective, such an optimizing proprietary program
will usually not be a derivative work of GCC; it merely reads and writes
some file format. It’s analogous to OpenOffice reading and writing
Microsoft Word files, which doesn’t make it a derivative of Word by any
means! The only parts that are covered by GPL are the actual plugins to
GCC to read and write the format, just as OpenOffice’s Word reader and
writer are Free Software, but Microsoft Word is not.

This licensing implication is a disaster for the GCC community. It
would mean the advent of “compilation processes” that were
“mixed”, FaiF and proprietary. The best, most difficult and
most interesting parts of that compilation process — the
optimizations — could be fully proprietary!

This outcome is unacceptable from a software freedom policy
perspective, but difficult to handle in licensing. Eben Moglen, David
Edelsohn, and a few others, however, came up with an innovative idea:
since all binaries are derivative of GCC anyway, set up the exception so
that proprietary binary output from GCC is permitted only when the
entire compilation process involves Free Software. In other words, you
can do these proprietary optimization plugins all you want, but if you
do, you’ll not be able to compile anything but GPL’d software with
them!

The Drafting and the Outcome

As every developer knows, the path from “innovative idea”
to “working implementation” is a long road. It’s just as
true with licensing policy as it is with code. Those 188 hours that
I’ve spent, along with even more hours spent by a cast of dozens, have
been spent making a license exception that implements that idea
accurately without messing up the GCC community or its licensing
structure.

With jubilation today, I link to
the announcement
from the
FSF
, the
FAQ and Rationale for the exception
and
the final
text of the exception itself
. This sixteen-month long cooperation
between the FSF, the SFLC, the GCC SC, and the GCC community has
produced some fine licensing policy that will serve our community well
for years to come. I am honored to have been a part of it, and a bit
relieved that it is complete.

Welcome (Finally!) to the GCC Runtime Library Exception

Post Syndicated from Bradley M. Kuhn original http://ebb.org/bkuhn/blog/2009/01/27/gcc-exception.html

For the past sixteen months, I participated in a bit of a “mini-GPLv3
process” among folks at the FSF, SFLC, the GNU Compiler Collection
Steering Committee (GCC SC), and the GCC community at large. We’ve been
drafting an important GPLv3 license exception (based on a concept by
David Edelsohn and Eben Moglen, that they invented even before the
GPLv3 process itself started).
Today, that
GCC Runtime Library Exception for GPLv3 went into production
.

I keep incessant track of my hours spent on various projects, so I have
hard numbers that show I personally spent 188 hours — a full month
of 40-hour weeks — on this project. I’m sure my colleagues
have spent similar amounts, too. I am proud of this time, and I think
it was absolutely worthwhile. I hope the discussion gives you a flavor
of why FLOSS license exception drafting is both incredibly important and
difficult to get right without the greatest of care and attention to
detail.

Why GPL Exceptions Exist

Before I jump into discussion of this GCC Runtime Library exception,
some background is needed. Exceptions have been a mainstay of copyleft
licensing since the inception of the GNU project, and once you’ve seen
many examples over many years, they become a standard part of FLOSS
licensing. However, for the casual FLOSS developer who doesn’t wish to
be a licensing wonk (down this path lies madness, my friends, run
screaming with your head covered!), exceptions are a rare discovery in a
random source file or two, and they do not command great attention. An
understandable reaction, but from a policy perspective, they are an
essential part of the copyleft system.

From the earliest days of the copyleft, it was understood that copyleft
was a merely a strategy to reach the goal of software freedom. The GPL
is a tool that implements this strategy, but like any tool, it doesn’t
fit every job.

In some sense, the LGPL was the earliest and certainly the most widely
known “GPL exception”. (Indeed, my friend Richard Fontana
came up with the idea to literally make LGPL an exception to
GPLv3, although in the v2 world, LGPLv2 was a fully separate license
from GPLv2.) Discussions on why the LGPL exists are beyond the scope of
this blog post
(although I’ve
written about them before
). Generally speaking, though, LGPL is
designed to be a tool when you don’t want the full force of copyleft for
all derivative works. Namely, you want to permit the creation of some
proprietary (or partly proprietary) derivative works because allowing
those derivations makes strategic sense in pursuing the goal of software
freedom.

Aside from the LGPL, the most common GPL exceptions are usually what we
generally categorize as “linking exceptions”. They allow
the modifier to take some GPL’d object code and combine it in some way
with some proprietary code during the compilation process. The simplest
of these exceptions is found when you, for example, write a GPL’d
program in a language with only a proprietary implementation, (e.g.,
VisualBasic) and you want to allow the code to combine with the
VisualBasic runtime libraries. You use your exclusive right as
copyright holder on the new program to grant downstream users,
redistributors and modifiers the right combine with those proprietary
libraries without having those libraries subject to copyleft.

In essence, copyleft exceptions are the scalpels of copyleft. They
allow you to create very carefully constructed carve-outs of permission
when pure copyleft is too blunt an instrument to advance the goal of
software freedom. Many software freedom policy questions require this
fine cutting work to reach the right outcome.

The GCC Exception

The GCC Exception (well, exceptions, really) have
always been a particularly interesting and complex use of a copyleft
exception. Initially, they were pragmatically needed to handle a
technological reality about compilers that interacts in a strange way
with copyright derivative works doctrine. Specifically, when you
compile a program with gcc, parts of GCC itself, called the runtime
library (and before that, crt0), are combined directly with your program
in the output binary. The binary, therefore, is both a derivative work
of your source code and a derivative work of the runtime library. If
GCC were pure GPL, every binary compiled with GCC would need to be
licensed under the terms of GPL.

Of course, when RMS was writing the first GCC, he realized immediately
this licensing implication and created an exception to avoid this.
Versions of that exception has been around and improved since the late
1980s. The task that our team faced in late 2007 was to update that
exception, both to adapt it to the excellent new GPLv3 exceptions
infrastructure (as Fontana did for LGPLv3), and to handle a new policy
question that has been kicking around the GCC world since 2002.

The Plugin Concern

For years, compiler experimentalists and researchers have been
frustrated by GCC. It’s very difficult to add a new optimization to GCC
because you need quite a deep understanding of the codebase to implement
one. Indeed I tried myself, as a graduate student in programming
languages in the mid-1990s, to learn enough about GCC to do this, but
gave up when a few days of study got me nowhere. Advancement of
compiler technology can only happen when optimization experimentation
can happen easily.

To make it easy to try new optimizations out, GCC needs a plugin
architecture. However, the GCC community has resisted this because of
the software freedom implications of such an architecture: if plugins
are easy to write, then it will be easy to write out to disk a version
of GCC’s internal program representation (sometimes called the
intermediate representation, or IR). Then, proprietary programs could
be used to analyze and optimize this IR, and a plugin could be used to
read the file back into GCC.

From a licensing perspective, such an optimizing proprietary program
will usually not be a derivative work of GCC; it merely reads and writes
some file format. It’s analogous to OpenOffice reading and writing
Microsoft Word files, which doesn’t make it a derivative of Word by any
means! The only parts that are covered by GPL are the actual plugins to
GCC to read and write the format, just as OpenOffice’s Word reader and
writer are Free Software, but Microsoft Word is not.

This licensing implication is a disaster for the GCC community. It
would mean the advent of “compilation processes” that were
“mixed”, FaiF and proprietary. The best, most difficult and
most interesting parts of that compilation process — the
optimizations — could be fully proprietary!

This outcome is unacceptable from a software freedom policy
perspective, but difficult to handle in licensing. Eben Moglen, David
Edelsohn, and a few others, however, came up with an innovative idea:
since all binaries are derivative of GCC anyway, set up the exception so
that proprietary binary output from GCC is permitted only when the
entire compilation process involves Free Software. In other words, you
can do these proprietary optimization plugins all you want, but if you
do, you’ll not be able to compile anything but GPL’d software with
them!

The Drafting and the Outcome

As every developer knows, the path from “innovative idea”
to “working implementation” is a long road. It’s just as
true with licensing policy as it is with code. Those 188 hours that
I’ve spent, along with even more hours spent by a cast of dozens, have
been spent making a license exception that implements that idea
accurately without messing up the GCC community or its licensing
structure.

With jubilation today, I link to
the announcement
from the
FSF
, the
FAQ and Rationale for the exception
and
the final
text of the exception itself
. This sixteen-month long cooperation
between the FSF, the SFLC, the GCC SC, and the GCC community has
produced some fine licensing policy that will serve our community well
for years to come. I am honored to have been a part of it, and a bit
relieved that it is complete.

Welcome (Finally!) to the GCC Runtime Library Exception

Post Syndicated from Bradley M. Kuhn original http://ebb.org/bkuhn/blog/2009/01/27/gcc-exception.html

For the past sixteen months, I participated in a bit of a “mini-GPLv3
process” among folks at the FSF, SFLC, the GNU Compiler Collection
Steering Committee (GCC SC), and the GCC community at large. We’ve been
drafting an important GPLv3 license exception (based on a concept by
David Edelsohn and Eben Moglen, that they invented even before the
GPLv3 process itself started).
Today, that
GCC Runtime Library Exception for GPLv3 went into production
.

I keep incessant track of my hours spent on various projects, so I have
hard numbers that show I personally spent 188 hours — a full month
of 40-hour weeks — on this project. I’m sure my colleagues
have spent similar amounts, too. I am proud of this time, and I think
it was absolutely worthwhile. I hope the discussion gives you a flavor
of why FLOSS license exception drafting is both incredibly important and
difficult to get right without the greatest of care and attention to
detail.

Why GPL Exceptions Exist

Before I jump into discussion of this GCC Runtime Library exception,
some background is needed. Exceptions have been a mainstay of copyleft
licensing since the inception of the GNU project, and once you’ve seen
many examples over many years, they become a standard part of FLOSS
licensing. However, for the casual FLOSS developer who doesn’t wish to
be a licensing wonk (down this path lies madness, my friends, run
screaming with your head covered!), exceptions are a rare discovery in a
random source file or two, and they do not command great attention. An
understandable reaction, but from a policy perspective, they are an
essential part of the copyleft system.

From the earliest days of the copyleft, it was understood that copyleft
was a merely a strategy to reach the goal of software freedom. The GPL
is a tool that implements this strategy, but like any tool, it doesn’t
fit every job.

In some sense, the LGPL was the earliest and certainly the most widely
known “GPL exception”. (Indeed, my friend Richard Fontana
came up with the idea to literally make LGPL an exception to
GPLv3, although in the v2 world, LGPLv2 was a fully separate license
from GPLv2.) Discussions on why the LGPL exists are beyond the scope of
this blog post
(although I’ve
written about them before
). Generally speaking, though, LGPL is
designed to be a tool when you don’t want the full force of copyleft for
all derivative works. Namely, you want to permit the creation of some
proprietary (or partly proprietary) derivative works because allowing
those derivations makes strategic sense in pursuing the goal of software
freedom.

Aside from the LGPL, the most common GPL exceptions are usually what we
generally categorize as “linking exceptions”. They allow
the modifier to take some GPL’d object code and combine it in some way
with some proprietary code during the compilation process. The simplest
of these exceptions is found when you, for example, write a GPL’d
program in a language with only a proprietary implementation, (e.g.,
VisualBasic) and you want to allow the code to combine with the
VisualBasic runtime libraries. You use your exclusive right as
copyright holder on the new program to grant downstream users,
redistributors and modifiers the right combine with those proprietary
libraries without having those libraries subject to copyleft.

In essence, copyleft exceptions are the scalpels of copyleft. They
allow you to create very carefully constructed carve-outs of permission
when pure copyleft is too blunt an instrument to advance the goal of
software freedom. Many software freedom policy questions require this
fine cutting work to reach the right outcome.

The GCC Exception

The GCC Exception (well, exceptions, really) have
always been a particularly interesting and complex use of a copyleft
exception. Initially, they were pragmatically needed to handle a
technological reality about compilers that interacts in a strange way
with copyright derivative works doctrine. Specifically, when you
compile a program with gcc, parts of GCC itself, called the runtime
library (and before that, crt0), are combined directly with your program
in the output binary. The binary, therefore, is both a derivative work
of your source code and a derivative work of the runtime library. If
GCC were pure GPL, every binary compiled with GCC would need to be
licensed under the terms of GPL.

Of course, when RMS was writing the first GCC, he realized immediately
this licensing implication and created an exception to avoid this.
Versions of that exception has been around and improved since the late
1980s. The task that our team faced in late 2007 was to update that
exception, both to adapt it to the excellent new GPLv3 exceptions
infrastructure (as Fontana did for LGPLv3), and to handle a new policy
question that has been kicking around the GCC world since 2002.

The Plugin Concern

For years, compiler experimentalists and researchers have been
frustrated by GCC. It’s very difficult to add a new optimization to GCC
because you need quite a deep understanding of the codebase to implement
one. Indeed I tried myself, as a graduate student in programming
languages in the mid-1990s, to learn enough about GCC to do this, but
gave up when a few days of study got me nowhere. Advancement of
compiler technology can only happen when optimization experimentation
can happen easily.

To make it easy to try new optimizations out, GCC needs a plugin
architecture. However, the GCC community has resisted this because of
the software freedom implications of such an architecture: if plugins
are easy to write, then it will be easy to write out to disk a version
of GCC’s internal program representation (sometimes called the
intermediate representation, or IR). Then, proprietary programs could
be used to analyze and optimize this IR, and a plugin could be used to
read the file back into GCC.

From a licensing perspective, such an optimizing proprietary program
will usually not be a derivative work of GCC; it merely reads and writes
some file format. It’s analogous to OpenOffice reading and writing
Microsoft Word files, which doesn’t make it a derivative of Word by any
means! The only parts that are covered by GPL are the actual plugins to
GCC to read and write the format, just as OpenOffice’s Word reader and
writer are Free Software, but Microsoft Word is not.

This licensing implication is a disaster for the GCC community. It
would mean the advent of “compilation processes” that were
“mixed”, FaiF and proprietary. The best, most difficult and
most interesting parts of that compilation process — the
optimizations — could be fully proprietary!

This outcome is unacceptable from a software freedom policy
perspective, but difficult to handle in licensing. Eben Moglen, David
Edelsohn, and a few others, however, came up with an innovative idea:
since all binaries are derivative of GCC anyway, set up the exception so
that proprietary binary output from GCC is permitted only when the
entire compilation process involves Free Software. In other words, you
can do these proprietary optimization plugins all you want, but if you
do, you’ll not be able to compile anything but GPL’d software with
them!

The Drafting and the Outcome

As every developer knows, the path from “innovative idea”
to “working implementation” is a long road. It’s just as
true with licensing policy as it is with code. Those 188 hours that
I’ve spent, along with even more hours spent by a cast of dozens, have
been spent making a license exception that implements that idea
accurately without messing up the GCC community or its licensing
structure.

With jubilation today, I link to
the announcement
from the
FSF
, the
FAQ and Rationale for the exception
and
the final
text of the exception itself
. This sixteen-month long cooperation
between the FSF, the SFLC, the GCC SC, and the GCC community has
produced some fine licensing policy that will serve our community well
for years to come. I am honored to have been a part of it, and a bit
relieved that it is complete.

Welcome (Finally!) to the GCC Runtime Library Exception

Post Syndicated from Bradley M. Kuhn original http://ebb.org/bkuhn/blog/2009/01/27/gcc-exception.html

For the past sixteen months, I participated in a bit of a “mini-GPLv3
process” among folks at the FSF, SFLC, the GNU Compiler Collection
Steering Committee (GCC SC), and the GCC community at large. We’ve been
drafting an important GPLv3 license exception (based on a concept by
David Edelsohn and Eben Moglen, that they invented even before the
GPLv3 process itself started).
Today, that
GCC Runtime Library Exception for GPLv3 went into production
.

I keep incessant track of my hours spent on various projects, so I have
hard numbers that show I personally spent 188 hours — a full month
of 40-hour weeks — on this project. I’m sure my colleagues
have spent similar amounts, too. I am proud of this time, and I think
it was absolutely worthwhile. I hope the discussion gives you a flavor
of why FLOSS license exception drafting is both incredibly important and
difficult to get right without the greatest of care and attention to
detail.

Why GPL Exceptions Exist

Before I jump into discussion of this GCC Runtime Library exception,
some background is needed. Exceptions have been a mainstay of copyleft
licensing since the inception of the GNU project, and once you’ve seen
many examples over many years, they become a standard part of FLOSS
licensing. However, for the casual FLOSS developer who doesn’t wish to
be a licensing wonk (down this path lies madness, my friends, run
screaming with your head covered!), exceptions are a rare discovery in a
random source file or two, and they do not command great attention. An
understandable reaction, but from a policy perspective, they are an
essential part of the copyleft system.

From the earliest days of the copyleft, it was understood that copyleft
was a merely a strategy to reach the goal of software freedom. The GPL
is a tool that implements this strategy, but like any tool, it doesn’t
fit every job.

In some sense, the LGPL was the earliest and certainly the most widely
known “GPL exception”. (Indeed, my friend Richard Fontana
came up with the idea to literally make LGPL an exception to
GPLv3, although in the v2 world, LGPLv2 was a fully separate license
from GPLv2.) Discussions on why the LGPL exists are beyond the scope of
this blog post
(although I’ve
written about them before
). Generally speaking, though, LGPL is
designed to be a tool when you don’t want the full force of copyleft for
all derivative works. Namely, you want to permit the creation of some
proprietary (or partly proprietary) derivative works because allowing
those derivations makes strategic sense in pursuing the goal of software
freedom.

Aside from the LGPL, the most common GPL exceptions are usually what we
generally categorize as “linking exceptions”. They allow
the modifier to take some GPL’d object code and combine it in some way
with some proprietary code during the compilation process. The simplest
of these exceptions is found when you, for example, write a GPL’d
program in a language with only a proprietary implementation, (e.g.,
VisualBasic) and you want to allow the code to combine with the
VisualBasic runtime libraries. You use your exclusive right as
copyright holder on the new program to grant downstream users,
redistributors and modifiers the right combine with those proprietary
libraries without having those libraries subject to copyleft.

In essence, copyleft exceptions are the scalpels of copyleft. They
allow you to create very carefully constructed carve-outs of permission
when pure copyleft is too blunt an instrument to advance the goal of
software freedom. Many software freedom policy questions require this
fine cutting work to reach the right outcome.

The GCC Exception

The GCC Exception (well, exceptions, really) have
always been a particularly interesting and complex use of a copyleft
exception. Initially, they were pragmatically needed to handle a
technological reality about compilers that interacts in a strange way
with copyright derivative works doctrine. Specifically, when you
compile a program with gcc, parts of GCC itself, called the runtime
library (and before that, crt0), are combined directly with your program
in the output binary. The binary, therefore, is both a derivative work
of your source code and a derivative work of the runtime library. If
GCC were pure GPL, every binary compiled with GCC would need to be
licensed under the terms of GPL.

Of course, when RMS was writing the first GCC, he realized immediately
this licensing implication and created an exception to avoid this.
Versions of that exception has been around and improved since the late
1980s. The task that our team faced in late 2007 was to update that
exception, both to adapt it to the excellent new GPLv3 exceptions
infrastructure (as Fontana did for LGPLv3), and to handle a new policy
question that has been kicking around the GCC world since 2002.

The Plugin Concern

For years, compiler experimentalists and researchers have been
frustrated by GCC. It’s very difficult to add a new optimization to GCC
because you need quite a deep understanding of the codebase to implement
one. Indeed I tried myself, as a graduate student in programming
languages in the mid-1990s, to learn enough about GCC to do this, but
gave up when a few days of study got me nowhere. Advancement of
compiler technology can only happen when optimization experimentation
can happen easily.

To make it easy to try new optimizations out, GCC needs a plugin
architecture. However, the GCC community has resisted this because of
the software freedom implications of such an architecture: if plugins
are easy to write, then it will be easy to write out to disk a version
of GCC’s internal program representation (sometimes called the
intermediate representation, or IR). Then, proprietary programs could
be used to analyze and optimize this IR, and a plugin could be used to
read the file back into GCC.

From a licensing perspective, such an optimizing proprietary program
will usually not be a derivative work of GCC; it merely reads and writes
some file format. It’s analogous to OpenOffice reading and writing
Microsoft Word files, which doesn’t make it a derivative of Word by any
means! The only parts that are covered by GPL are the actual plugins to
GCC to read and write the format, just as OpenOffice’s Word reader and
writer are Free Software, but Microsoft Word is not.

This licensing implication is a disaster for the GCC community. It
would mean the advent of “compilation processes” that were
“mixed”, FaiF and proprietary. The best, most difficult and
most interesting parts of that compilation process — the
optimizations — could be fully proprietary!

This outcome is unacceptable from a software freedom policy
perspective, but difficult to handle in licensing. Eben Moglen, David
Edelsohn, and a few others, however, came up with an innovative idea:
since all binaries are derivative of GCC anyway, set up the exception so
that proprietary binary output from GCC is permitted only when the
entire compilation process involves Free Software. In other words, you
can do these proprietary optimization plugins all you want, but if you
do, you’ll not be able to compile anything but GPL’d software with
them!

The Drafting and the Outcome

As every developer knows, the path from “innovative idea”
to “working implementation” is a long road. It’s just as
true with licensing policy as it is with code. Those 188 hours that
I’ve spent, along with even more hours spent by a cast of dozens, have
been spent making a license exception that implements that idea
accurately without messing up the GCC community or its licensing
structure.

With jubilation today, I link to
the announcement
from the
FSF
, the
FAQ and Rationale for the exception
and
the final
text of the exception itself
. This sixteen-month long cooperation
between the FSF, the SFLC, the GCC SC, and the GCC community has
produced some fine licensing policy that will serve our community well
for years to come. I am honored to have been a part of it, and a bit
relieved that it is complete.

Welcome (Finally!) to the GCC Runtime Library Exception

Post Syndicated from Bradley M. Kuhn original http://ebb.org/bkuhn/blog/2009/01/27/gcc-exception.html

For the past sixteen months, I participated in a bit of a “mini-GPLv3
process” among folks at the FSF, SFLC, the GNU Compiler Collection
Steering Committee (GCC SC), and the GCC community at large. We’ve been
drafting an important GPLv3 license exception (based on a concept by
David Edelsohn and Eben Moglen, that they invented even before the
GPLv3 process itself started).
Today, that
GCC Runtime Library Exception for GPLv3 went into production
.

I keep incessant track of my hours spent on various projects, so I have
hard numbers that show I personally spent 188 hours — a full month
of 40-hour weeks — on this project. I’m sure my colleagues
have spent similar amounts, too. I am proud of this time, and I think
it was absolutely worthwhile. I hope the discussion gives you a flavor
of why FLOSS license exception drafting is both incredibly important and
difficult to get right without the greatest of care and attention to
detail.

Why GPL Exceptions Exist

Before I jump into discussion of this GCC Runtime Library exception,
some background is needed. Exceptions have been a mainstay of copyleft
licensing since the inception of the GNU project, and once you’ve seen
many examples over many years, they become a standard part of FLOSS
licensing. However, for the casual FLOSS developer who doesn’t wish to
be a licensing wonk (down this path lies madness, my friends, run
screaming with your head covered!), exceptions are a rare discovery in a
random source file or two, and they do not command great attention. An
understandable reaction, but from a policy perspective, they are an
essential part of the copyleft system.

From the earliest days of the copyleft, it was understood that copyleft
was a merely a strategy to reach the goal of software freedom. The GPL
is a tool that implements this strategy, but like any tool, it doesn’t
fit every job.

In some sense, the LGPL was the earliest and certainly the most widely
known “GPL exception”. (Indeed, my friend Richard Fontana
came up with the idea to literally make LGPL an exception to
GPLv3, although in the v2 world, LGPLv2 was a fully separate license
from GPLv2.) Discussions on why the LGPL exists are beyond the scope of
this blog post
(although I’ve
written about them before
). Generally speaking, though, LGPL is
designed to be a tool when you don’t want the full force of copyleft for
all derivative works. Namely, you want to permit the creation of some
proprietary (or partly proprietary) derivative works because allowing
those derivations makes strategic sense in pursuing the goal of software
freedom.

Aside from the LGPL, the most common GPL exceptions are usually what we
generally categorize as “linking exceptions”. They allow
the modifier to take some GPL’d object code and combine it in some way
with some proprietary code during the compilation process. The simplest
of these exceptions is found when you, for example, write a GPL’d
program in a language with only a proprietary implementation, (e.g.,
VisualBasic) and you want to allow the code to combine with the
VisualBasic runtime libraries. You use your exclusive right as
copyright holder on the new program to grant downstream users,
redistributors and modifiers the right combine with those proprietary
libraries without having those libraries subject to copyleft.

In essence, copyleft exceptions are the scalpels of copyleft. They
allow you to create very carefully constructed carve-outs of permission
when pure copyleft is too blunt an instrument to advance the goal of
software freedom. Many software freedom policy questions require this
fine cutting work to reach the right outcome.

The GCC Exception

The GCC Exception (well, exceptions, really) have
always been a particularly interesting and complex use of a copyleft
exception. Initially, they were pragmatically needed to handle a
technological reality about compilers that interacts in a strange way
with copyright derivative works doctrine. Specifically, when you
compile a program with gcc, parts of GCC itself, called the runtime
library (and before that, crt0), are combined directly with your program
in the output binary. The binary, therefore, is both a derivative work
of your source code and a derivative work of the runtime library. If
GCC were pure GPL, every binary compiled with GCC would need to be
licensed under the terms of GPL.

Of course, when RMS was writing the first GCC, he realized immediately
this licensing implication and created an exception to avoid this.
Versions of that exception has been around and improved since the late
1980s. The task that our team faced in late 2007 was to update that
exception, both to adapt it to the excellent new GPLv3 exceptions
infrastructure (as Fontana did for LGPLv3), and to handle a new policy
question that has been kicking around the GCC world since 2002.

The Plugin Concern

For years, compiler experimentalists and researchers have been
frustrated by GCC. It’s very difficult to add a new optimization to GCC
because you need quite a deep understanding of the codebase to implement
one. Indeed I tried myself, as a graduate student in programming
languages in the mid-1990s, to learn enough about GCC to do this, but
gave up when a few days of study got me nowhere. Advancement of
compiler technology can only happen when optimization experimentation
can happen easily.

To make it easy to try new optimizations out, GCC needs a plugin
architecture. However, the GCC community has resisted this because of
the software freedom implications of such an architecture: if plugins
are easy to write, then it will be easy to write out to disk a version
of GCC’s internal program representation (sometimes called the
intermediate representation, or IR). Then, proprietary programs could
be used to analyze and optimize this IR, and a plugin could be used to
read the file back into GCC.

From a licensing perspective, such an optimizing proprietary program
will usually not be a derivative work of GCC; it merely reads and writes
some file format. It’s analogous to OpenOffice reading and writing
Microsoft Word files, which doesn’t make it a derivative of Word by any
means! The only parts that are covered by GPL are the actual plugins to
GCC to read and write the format, just as OpenOffice’s Word reader and
writer are Free Software, but Microsoft Word is not.

This licensing implication is a disaster for the GCC community. It
would mean the advent of “compilation processes” that were
“mixed”, FaiF and proprietary. The best, most difficult and
most interesting parts of that compilation process — the
optimizations — could be fully proprietary!

This outcome is unacceptable from a software freedom policy
perspective, but difficult to handle in licensing. Eben Moglen, David
Edelsohn, and a few others, however, came up with an innovative idea:
since all binaries are derivative of GCC anyway, set up the exception so
that proprietary binary output from GCC is permitted only when the
entire compilation process involves Free Software. In other words, you
can do these proprietary optimization plugins all you want, but if you
do, you’ll not be able to compile anything but GPL’d software with
them!

The Drafting and the Outcome

As every developer knows, the path from “innovative idea”
to “working implementation” is a long road. It’s just as
true with licensing policy as it is with code. Those 188 hours that
I’ve spent, along with even more hours spent by a cast of dozens, have
been spent making a license exception that implements that idea
accurately without messing up the GCC community or its licensing
structure.

With jubilation today, I link to
the announcement
from the
FSF
, the
FAQ and Rationale for the exception
and
the final
text of the exception itself
. This sixteen-month long cooperation
between the FSF, the SFLC, the GCC SC, and the GCC community has
produced some fine licensing policy that will serve our community well
for years to come. I am honored to have been a part of it, and a bit
relieved that it is complete.

Welcome (Finally!) to the GCC Runtime Library Exception

Post Syndicated from Bradley M. Kuhn original http://ebb.org/bkuhn/blog/2009/01/27/gcc-exception.html

For the past sixteen months, I participated in a bit of a “mini-GPLv3
process” among folks at the FSF, SFLC, the GNU Compiler Collection
Steering Committee (GCC SC), and the GCC community at large. We’ve been
drafting an important GPLv3 license exception (based on a concept by
David Edelsohn and Eben Moglen, that they invented even before the
GPLv3 process itself started).
Today, that
GCC Runtime Library Exception for GPLv3 went into production
.

I keep incessant track of my hours spent on various projects, so I have
hard numbers that show I personally spent 188 hours — a full month
of 40-hour weeks — on this project. I’m sure my colleagues
have spent similar amounts, too. I am proud of this time, and I think
it was absolutely worthwhile. I hope the discussion gives you a flavor
of why FLOSS license exception drafting is both incredibly important and
difficult to get right without the greatest of care and attention to
detail.

Why GPL Exceptions Exist

Before I jump into discussion of this GCC Runtime Library exception,
some background is needed. Exceptions have been a mainstay of copyleft
licensing since the inception of the GNU project, and once you’ve seen
many examples over many years, they become a standard part of FLOSS
licensing. However, for the casual FLOSS developer who doesn’t wish to
be a licensing wonk (down this path lies madness, my friends, run
screaming with your head covered!), exceptions are a rare discovery in a
random source file or two, and they do not command great attention. An
understandable reaction, but from a policy perspective, they are an
essential part of the copyleft system.

From the earliest days of the copyleft, it was understood that copyleft
was a merely a strategy to reach the goal of software freedom. The GPL
is a tool that implements this strategy, but like any tool, it doesn’t
fit every job.

In some sense, the LGPL was the earliest and certainly the most widely
known “GPL exception”. (Indeed, my friend Richard Fontana
came up with the idea to literally make LGPL an exception to
GPLv3, although in the v2 world, LGPLv2 was a fully separate license
from GPLv2.) Discussions on why the LGPL exists are beyond the scope of
this blog post
(although I’ve
written about them before
). Generally speaking, though, LGPL is
designed to be a tool when you don’t want the full force of copyleft for
all derivative works. Namely, you want to permit the creation of some
proprietary (or partly proprietary) derivative works because allowing
those derivations makes strategic sense in pursuing the goal of software
freedom.

Aside from the LGPL, the most common GPL exceptions are usually what we
generally categorize as “linking exceptions”. They allow
the modifier to take some GPL’d object code and combine it in some way
with some proprietary code during the compilation process. The simplest
of these exceptions is found when you, for example, write a GPL’d
program in a language with only a proprietary implementation, (e.g.,
VisualBasic) and you want to allow the code to combine with the
VisualBasic runtime libraries. You use your exclusive right as
copyright holder on the new program to grant downstream users,
redistributors and modifiers the right combine with those proprietary
libraries without having those libraries subject to copyleft.

In essence, copyleft exceptions are the scalpels of copyleft. They
allow you to create very carefully constructed carve-outs of permission
when pure copyleft is too blunt an instrument to advance the goal of
software freedom. Many software freedom policy questions require this
fine cutting work to reach the right outcome.

The GCC Exception

The GCC Exception (well, exceptions, really) have
always been a particularly interesting and complex use of a copyleft
exception. Initially, they were pragmatically needed to handle a
technological reality about compilers that interacts in a strange way
with copyright derivative works doctrine. Specifically, when you
compile a program with gcc, parts of GCC itself, called the runtime
library (and before that, crt0), are combined directly with your program
in the output binary. The binary, therefore, is both a derivative work
of your source code and a derivative work of the runtime library. If
GCC were pure GPL, every binary compiled with GCC would need to be
licensed under the terms of GPL.

Of course, when RMS was writing the first GCC, he realized immediately
this licensing implication and created an exception to avoid this.
Versions of that exception has been around and improved since the late
1980s. The task that our team faced in late 2007 was to update that
exception, both to adapt it to the excellent new GPLv3 exceptions
infrastructure (as Fontana did for LGPLv3), and to handle a new policy
question that has been kicking around the GCC world since 2002.

The Plugin Concern

For years, compiler experimentalists and researchers have been
frustrated by GCC. It’s very difficult to add a new optimization to GCC
because you need quite a deep understanding of the codebase to implement
one. Indeed I tried myself, as a graduate student in programming
languages in the mid-1990s, to learn enough about GCC to do this, but
gave up when a few days of study got me nowhere. Advancement of
compiler technology can only happen when optimization experimentation
can happen easily.

To make it easy to try new optimizations out, GCC needs a plugin
architecture. However, the GCC community has resisted this because of
the software freedom implications of such an architecture: if plugins
are easy to write, then it will be easy to write out to disk a version
of GCC’s internal program representation (sometimes called the
intermediate representation, or IR). Then, proprietary programs could
be used to analyze and optimize this IR, and a plugin could be used to
read the file back into GCC.

From a licensing perspective, such an optimizing proprietary program
will usually not be a derivative work of GCC; it merely reads and writes
some file format. It’s analogous to OpenOffice reading and writing
Microsoft Word files, which doesn’t make it a derivative of Word by any
means! The only parts that are covered by GPL are the actual plugins to
GCC to read and write the format, just as OpenOffice’s Word reader and
writer are Free Software, but Microsoft Word is not.

This licensing implication is a disaster for the GCC community. It
would mean the advent of “compilation processes” that were
“mixed”, FaiF and proprietary. The best, most difficult and
most interesting parts of that compilation process — the
optimizations — could be fully proprietary!

This outcome is unacceptable from a software freedom policy
perspective, but difficult to handle in licensing. Eben Moglen, David
Edelsohn, and a few others, however, came up with an innovative idea:
since all binaries are derivative of GCC anyway, set up the exception so
that proprietary binary output from GCC is permitted only when the
entire compilation process involves Free Software. In other words, you
can do these proprietary optimization plugins all you want, but if you
do, you’ll not be able to compile anything but GPL’d software with
them!

The Drafting and the Outcome

As every developer knows, the path from “innovative idea”
to “working implementation” is a long road. It’s just as
true with licensing policy as it is with code. Those 188 hours that
I’ve spent, along with even more hours spent by a cast of dozens, have
been spent making a license exception that implements that idea
accurately without messing up the GCC community or its licensing
structure.

With jubilation today, I link to
the announcement
from the
FSF
, the
FAQ and Rationale for the exception
and
the final
text of the exception itself
. This sixteen-month long cooperation
between the FSF, the SFLC, the GCC SC, and the GCC community has
produced some fine licensing policy that will serve our community well
for years to come. I am honored to have been a part of it, and a bit
relieved that it is complete.

Welcome (Finally!) to the GCC Runtime Library Exception

Post Syndicated from Bradley M. Kuhn original http://ebb.org/bkuhn/blog/2009/01/27/gcc-exception.html

For the past sixteen months, I participated in a bit of a “mini-GPLv3
process” among folks at the FSF, SFLC, the GNU Compiler Collection
Steering Committee (GCC SC), and the GCC community at large. We’ve been
drafting an important GPLv3 license exception (based on a concept by
David Edelsohn and Eben Moglen, that they invented even before the
GPLv3 process itself started).
Today, that
GCC Runtime Library Exception for GPLv3 went into production
.

I keep incessant track of my hours spent on various projects, so I have
hard numbers that show I personally spent 188 hours — a full month
of 40-hour weeks — on this project. I’m sure my colleagues
have spent similar amounts, too. I am proud of this time, and I think
it was absolutely worthwhile. I hope the discussion gives you a flavor
of why FLOSS license exception drafting is both incredibly important and
difficult to get right without the greatest of care and attention to
detail.

Why GPL Exceptions Exist

Before I jump into discussion of this GCC Runtime Library exception,
some background is needed. Exceptions have been a mainstay of copyleft
licensing since the inception of the GNU project, and once you’ve seen
many examples over many years, they become a standard part of FLOSS
licensing. However, for the casual FLOSS developer who doesn’t wish to
be a licensing wonk (down this path lies madness, my friends, run
screaming with your head covered!), exceptions are a rare discovery in a
random source file or two, and they do not command great attention. An
understandable reaction, but from a policy perspective, they are an
essential part of the copyleft system.

From the earliest days of the copyleft, it was understood that copyleft
was a merely a strategy to reach the goal of software freedom. The GPL
is a tool that implements this strategy, but like any tool, it doesn’t
fit every job.

In some sense, the LGPL was the earliest and certainly the most widely
known “GPL exception”. (Indeed, my friend Richard Fontana
came up with the idea to literally make LGPL an exception to
GPLv3, although in the v2 world, LGPLv2 was a fully separate license
from GPLv2.) Discussions on why the LGPL exists are beyond the scope of
this blog post
(although I’ve
written about them before
). Generally speaking, though, LGPL is
designed to be a tool when you don’t want the full force of copyleft for
all derivative works. Namely, you want to permit the creation of some
proprietary (or partly proprietary) derivative works because allowing
those derivations makes strategic sense in pursuing the goal of software
freedom.

Aside from the LGPL, the most common GPL exceptions are usually what we
generally categorize as “linking exceptions”. They allow
the modifier to take some GPL’d object code and combine it in some way
with some proprietary code during the compilation process. The simplest
of these exceptions is found when you, for example, write a GPL’d
program in a language with only a proprietary implementation, (e.g.,
VisualBasic) and you want to allow the code to combine with the
VisualBasic runtime libraries. You use your exclusive right as
copyright holder on the new program to grant downstream users,
redistributors and modifiers the right combine with those proprietary
libraries without having those libraries subject to copyleft.

In essence, copyleft exceptions are the scalpels of copyleft. They
allow you to create very carefully constructed carve-outs of permission
when pure copyleft is too blunt an instrument to advance the goal of
software freedom. Many software freedom policy questions require this
fine cutting work to reach the right outcome.

The GCC Exception

The GCC Exception (well, exceptions, really) have
always been a particularly interesting and complex use of a copyleft
exception. Initially, they were pragmatically needed to handle a
technological reality about compilers that interacts in a strange way
with copyright derivative works doctrine. Specifically, when you
compile a program with gcc, parts of GCC itself, called the runtime
library (and before that, crt0), are combined directly with your program
in the output binary. The binary, therefore, is both a derivative work
of your source code and a derivative work of the runtime library. If
GCC were pure GPL, every binary compiled with GCC would need to be
licensed under the terms of GPL.

Of course, when RMS was writing the first GCC, he realized immediately
this licensing implication and created an exception to avoid this.
Versions of that exception has been around and improved since the late
1980s. The task that our team faced in late 2007 was to update that
exception, both to adapt it to the excellent new GPLv3 exceptions
infrastructure (as Fontana did for LGPLv3), and to handle a new policy
question that has been kicking around the GCC world since 2002.

The Plugin Concern

For years, compiler experimentalists and researchers have been
frustrated by GCC. It’s very difficult to add a new optimization to GCC
because you need quite a deep understanding of the codebase to implement
one. Indeed I tried myself, as a graduate student in programming
languages in the mid-1990s, to learn enough about GCC to do this, but
gave up when a few days of study got me nowhere. Advancement of
compiler technology can only happen when optimization experimentation
can happen easily.

To make it easy to try new optimizations out, GCC needs a plugin
architecture. However, the GCC community has resisted this because of
the software freedom implications of such an architecture: if plugins
are easy to write, then it will be easy to write out to disk a version
of GCC’s internal program representation (sometimes called the
intermediate representation, or IR). Then, proprietary programs could
be used to analyze and optimize this IR, and a plugin could be used to
read the file back into GCC.

From a licensing perspective, such an optimizing proprietary program
will usually not be a derivative work of GCC; it merely reads and writes
some file format. It’s analogous to OpenOffice reading and writing
Microsoft Word files, which doesn’t make it a derivative of Word by any
means! The only parts that are covered by GPL are the actual plugins to
GCC to read and write the format, just as OpenOffice’s Word reader and
writer are Free Software, but Microsoft Word is not.

This licensing implication is a disaster for the GCC community. It
would mean the advent of “compilation processes” that were
“mixed”, FaiF and proprietary. The best, most difficult and
most interesting parts of that compilation process — the
optimizations — could be fully proprietary!

This outcome is unacceptable from a software freedom policy
perspective, but difficult to handle in licensing. Eben Moglen, David
Edelsohn, and a few others, however, came up with an innovative idea:
since all binaries are derivative of GCC anyway, set up the exception so
that proprietary binary output from GCC is permitted only when the
entire compilation process involves Free Software. In other words, you
can do these proprietary optimization plugins all you want, but if you
do, you’ll not be able to compile anything but GPL’d software with
them!

The Drafting and the Outcome

As every developer knows, the path from “innovative idea”
to “working implementation” is a long road. It’s just as
true with licensing policy as it is with code. Those 188 hours that
I’ve spent, along with even more hours spent by a cast of dozens, have
been spent making a license exception that implements that idea
accurately without messing up the GCC community or its licensing
structure.

With jubilation today, I link to
the announcement
from the
FSF
, the
FAQ and Rationale for the exception
and
the final
text of the exception itself
. This sixteen-month long cooperation
between the FSF, the SFLC, the GCC SC, and the GCC community has
produced some fine licensing policy that will serve our community well
for years to come. I am honored to have been a part of it, and a bit
relieved that it is complete.

Welcome (Finally!) to the GCC Runtime Library Exception

Post Syndicated from Bradley M. Kuhn original http://ebb.org/bkuhn/blog/2009/01/27/gcc-exception.html

For the past sixteen months, I participated in a bit of a “mini-GPLv3
process” among folks at the FSF, SFLC, the GNU Compiler Collection
Steering Committee (GCC SC), and the GCC community at large. We’ve been
drafting an important GPLv3 license exception (based on a concept by
David Edelsohn and Eben Moglen, that they invented even before the
GPLv3 process itself started).
Today, that
GCC Runtime Library Exception for GPLv3 went into production
.

I keep incessant track of my hours spent on various projects, so I have
hard numbers that show I personally spent 188 hours — a full month
of 40-hour weeks — on this project. I’m sure my colleagues
have spent similar amounts, too. I am proud of this time, and I think
it was absolutely worthwhile. I hope the discussion gives you a flavor
of why FLOSS license exception drafting is both incredibly important and
difficult to get right without the greatest of care and attention to
detail.

Why GPL Exceptions Exist

Before I jump into discussion of this GCC Runtime Library exception,
some background is needed. Exceptions have been a mainstay of copyleft
licensing since the inception of the GNU project, and once you’ve seen
many examples over many years, they become a standard part of FLOSS
licensing. However, for the casual FLOSS developer who doesn’t wish to
be a licensing wonk (down this path lies madness, my friends, run
screaming with your head covered!), exceptions are a rare discovery in a
random source file or two, and they do not command great attention. An
understandable reaction, but from a policy perspective, they are an
essential part of the copyleft system.

From the earliest days of the copyleft, it was understood that copyleft
was a merely a strategy to reach the goal of software freedom. The GPL
is a tool that implements this strategy, but like any tool, it doesn’t
fit every job.

In some sense, the LGPL was the earliest and certainly the most widely
known “GPL exception”. (Indeed, my friend Richard Fontana
came up with the idea to literally make LGPL an exception to
GPLv3, although in the v2 world, LGPLv2 was a fully separate license
from GPLv2.) Discussions on why the LGPL exists are beyond the scope of
this blog post
(although I’ve
written about them before
). Generally speaking, though, LGPL is
designed to be a tool when you don’t want the full force of copyleft for
all derivative works. Namely, you want to permit the creation of some
proprietary (or partly proprietary) derivative works because allowing
those derivations makes strategic sense in pursuing the goal of software
freedom.

Aside from the LGPL, the most common GPL exceptions are usually what we
generally categorize as “linking exceptions”. They allow
the modifier to take some GPL’d object code and combine it in some way
with some proprietary code during the compilation process. The simplest
of these exceptions is found when you, for example, write a GPL’d
program in a language with only a proprietary implementation, (e.g.,
VisualBasic) and you want to allow the code to combine with the
VisualBasic runtime libraries. You use your exclusive right as
copyright holder on the new program to grant downstream users,
redistributors and modifiers the right combine with those proprietary
libraries without having those libraries subject to copyleft.

In essence, copyleft exceptions are the scalpels of copyleft. They
allow you to create very carefully constructed carve-outs of permission
when pure copyleft is too blunt an instrument to advance the goal of
software freedom. Many software freedom policy questions require this
fine cutting work to reach the right outcome.

The GCC Exception

The GCC Exception (well, exceptions, really) have
always been a particularly interesting and complex use of a copyleft
exception. Initially, they were pragmatically needed to handle a
technological reality about compilers that interacts in a strange way
with copyright derivative works doctrine. Specifically, when you
compile a program with gcc, parts of GCC itself, called the runtime
library (and before that, crt0), are combined directly with your program
in the output binary. The binary, therefore, is both a derivative work
of your source code and a derivative work of the runtime library. If
GCC were pure GPL, every binary compiled with GCC would need to be
licensed under the terms of GPL.

Of course, when RMS was writing the first GCC, he realized immediately
this licensing implication and created an exception to avoid this.
Versions of that exception has been around and improved since the late
1980s. The task that our team faced in late 2007 was to update that
exception, both to adapt it to the excellent new GPLv3 exceptions
infrastructure (as Fontana did for LGPLv3), and to handle a new policy
question that has been kicking around the GCC world since 2002.

The Plugin Concern

For years, compiler experimentalists and researchers have been
frustrated by GCC. It’s very difficult to add a new optimization to GCC
because you need quite a deep understanding of the codebase to implement
one. Indeed I tried myself, as a graduate student in programming
languages in the mid-1990s, to learn enough about GCC to do this, but
gave up when a few days of study got me nowhere. Advancement of
compiler technology can only happen when optimization experimentation
can happen easily.

To make it easy to try new optimizations out, GCC needs a plugin
architecture. However, the GCC community has resisted this because of
the software freedom implications of such an architecture: if plugins
are easy to write, then it will be easy to write out to disk a version
of GCC’s internal program representation (sometimes called the
intermediate representation, or IR). Then, proprietary programs could
be used to analyze and optimize this IR, and a plugin could be used to
read the file back into GCC.

From a licensing perspective, such an optimizing proprietary program
will usually not be a derivative work of GCC; it merely reads and writes
some file format. It’s analogous to OpenOffice reading and writing
Microsoft Word files, which doesn’t make it a derivative of Word by any
means! The only parts that are covered by GPL are the actual plugins to
GCC to read and write the format, just as OpenOffice’s Word reader and
writer are Free Software, but Microsoft Word is not.

This licensing implication is a disaster for the GCC community. It
would mean the advent of “compilation processes” that were
“mixed”, FaiF and proprietary. The best, most difficult and
most interesting parts of that compilation process — the
optimizations — could be fully proprietary!

This outcome is unacceptable from a software freedom policy
perspective, but difficult to handle in licensing. Eben Moglen, David
Edelsohn, and a few others, however, came up with an innovative idea:
since all binaries are derivative of GCC anyway, set up the exception so
that proprietary binary output from GCC is permitted only when the
entire compilation process involves Free Software. In other words, you
can do these proprietary optimization plugins all you want, but if you
do, you’ll not be able to compile anything but GPL’d software with
them!

The Drafting and the Outcome

As every developer knows, the path from “innovative idea”
to “working implementation” is a long road. It’s just as
true with licensing policy as it is with code. Those 188 hours that
I’ve spent, along with even more hours spent by a cast of dozens, have
been spent making a license exception that implements that idea
accurately without messing up the GCC community or its licensing
structure.

With jubilation today, I link to
the announcement
from the
FSF
, the
FAQ and Rationale for the exception
and
the final
text of the exception itself
. This sixteen-month long cooperation
between the FSF, the SFLC, the GCC SC, and the GCC community has
produced some fine licensing policy that will serve our community well
for years to come. I am honored to have been a part of it, and a bit
relieved that it is complete.

Welcome (Finally!) to the GCC Runtime Library Exception

Post Syndicated from Bradley M. Kuhn original http://ebb.org/bkuhn/blog/2009/01/27/gcc-exception.html

For the past sixteen months, I participated in a bit of a “mini-GPLv3
process” among folks at the FSF, SFLC, the GNU Compiler Collection
Steering Committee (GCC SC), and the GCC community at large. We’ve been
drafting an important GPLv3 license exception (based on a concept by
David Edelsohn and Eben Moglen, that they invented even before the
GPLv3 process itself started).
Today, that
GCC Runtime Library Exception for GPLv3 went into production
.

I keep incessant track of my hours spent on various projects, so I have
hard numbers that show I personally spent 188 hours — a full month
of 40-hour weeks — on this project. I’m sure my colleagues
have spent similar amounts, too. I am proud of this time, and I think
it was absolutely worthwhile. I hope the discussion gives you a flavor
of why FLOSS license exception drafting is both incredibly important and
difficult to get right without the greatest of care and attention to
detail.

Why GPL Exceptions Exist

Before I jump into discussion of this GCC Runtime Library exception,
some background is needed. Exceptions have been a mainstay of copyleft
licensing since the inception of the GNU project, and once you’ve seen
many examples over many years, they become a standard part of FLOSS
licensing. However, for the casual FLOSS developer who doesn’t wish to
be a licensing wonk (down this path lies madness, my friends, run
screaming with your head covered!), exceptions are a rare discovery in a
random source file or two, and they do not command great attention. An
understandable reaction, but from a policy perspective, they are an
essential part of the copyleft system.

From the earliest days of the copyleft, it was understood that copyleft
was a merely a strategy to reach the goal of software freedom. The GPL
is a tool that implements this strategy, but like any tool, it doesn’t
fit every job.

In some sense, the LGPL was the earliest and certainly the most widely
known “GPL exception”. (Indeed, my friend Richard Fontana
came up with the idea to literally make LGPL an exception to
GPLv3, although in the v2 world, LGPLv2 was a fully separate license
from GPLv2.) Discussions on why the LGPL exists are beyond the scope of
this blog post
(although I’ve
written about them before
). Generally speaking, though, LGPL is
designed to be a tool when you don’t want the full force of copyleft for
all derivative works. Namely, you want to permit the creation of some
proprietary (or partly proprietary) derivative works because allowing
those derivations makes strategic sense in pursuing the goal of software
freedom.

Aside from the LGPL, the most common GPL exceptions are usually what we
generally categorize as “linking exceptions”. They allow
the modifier to take some GPL’d object code and combine it in some way
with some proprietary code during the compilation process. The simplest
of these exceptions is found when you, for example, write a GPL’d
program in a language with only a proprietary implementation, (e.g.,
VisualBasic) and you want to allow the code to combine with the
VisualBasic runtime libraries. You use your exclusive right as
copyright holder on the new program to grant downstream users,
redistributors and modifiers the right combine with those proprietary
libraries without having those libraries subject to copyleft.

In essence, copyleft exceptions are the scalpels of copyleft. They
allow you to create very carefully constructed carve-outs of permission
when pure copyleft is too blunt an instrument to advance the goal of
software freedom. Many software freedom policy questions require this
fine cutting work to reach the right outcome.

The GCC Exception

The GCC Exception (well, exceptions, really) have
always been a particularly interesting and complex use of a copyleft
exception. Initially, they were pragmatically needed to handle a
technological reality about compilers that interacts in a strange way
with copyright derivative works doctrine. Specifically, when you
compile a program with gcc, parts of GCC itself, called the runtime
library (and before that, crt0), are combined directly with your program
in the output binary. The binary, therefore, is both a derivative work
of your source code and a derivative work of the runtime library. If
GCC were pure GPL, every binary compiled with GCC would need to be
licensed under the terms of GPL.

Of course, when RMS was writing the first GCC, he realized immediately
this licensing implication and created an exception to avoid this.
Versions of that exception has been around and improved since the late
1980s. The task that our team faced in late 2007 was to update that
exception, both to adapt it to the excellent new GPLv3 exceptions
infrastructure (as Fontana did for LGPLv3), and to handle a new policy
question that has been kicking around the GCC world since 2002.

The Plugin Concern

For years, compiler experimentalists and researchers have been
frustrated by GCC. It’s very difficult to add a new optimization to GCC
because you need quite a deep understanding of the codebase to implement
one. Indeed I tried myself, as a graduate student in programming
languages in the mid-1990s, to learn enough about GCC to do this, but
gave up when a few days of study got me nowhere. Advancement of
compiler technology can only happen when optimization experimentation
can happen easily.

To make it easy to try new optimizations out, GCC needs a plugin
architecture. However, the GCC community has resisted this because of
the software freedom implications of such an architecture: if plugins
are easy to write, then it will be easy to write out to disk a version
of GCC’s internal program representation (sometimes called the
intermediate representation, or IR). Then, proprietary programs could
be used to analyze and optimize this IR, and a plugin could be used to
read the file back into GCC.

From a licensing perspective, such an optimizing proprietary program
will usually not be a derivative work of GCC; it merely reads and writes
some file format. It’s analogous to OpenOffice reading and writing
Microsoft Word files, which doesn’t make it a derivative of Word by any
means! The only parts that are covered by GPL are the actual plugins to
GCC to read and write the format, just as OpenOffice’s Word reader and
writer are Free Software, but Microsoft Word is not.

This licensing implication is a disaster for the GCC community. It
would mean the advent of “compilation processes” that were
“mixed”, FaiF and proprietary. The best, most difficult and
most interesting parts of that compilation process — the
optimizations — could be fully proprietary!

This outcome is unacceptable from a software freedom policy
perspective, but difficult to handle in licensing. Eben Moglen, David
Edelsohn, and a few others, however, came up with an innovative idea:
since all binaries are derivative of GCC anyway, set up the exception so
that proprietary binary output from GCC is permitted only when the
entire compilation process involves Free Software. In other words, you
can do these proprietary optimization plugins all you want, but if you
do, you’ll not be able to compile anything but GPL’d software with
them!

The Drafting and the Outcome

As every developer knows, the path from “innovative idea”
to “working implementation” is a long road. It’s just as
true with licensing policy as it is with code. Those 188 hours that
I’ve spent, along with even more hours spent by a cast of dozens, have
been spent making a license exception that implements that idea
accurately without messing up the GCC community or its licensing
structure.

With jubilation today, I link to
the announcement
from the
FSF
, the
FAQ and Rationale for the exception
and
the final
text of the exception itself
. This sixteen-month long cooperation
between the FSF, the SFLC, the GCC SC, and the GCC community has
produced some fine licensing policy that will serve our community well
for years to come. I am honored to have been a part of it, and a bit
relieved that it is complete.

The collective thoughts of the interwebz