This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Target hook definition licensing problems (GPL vs GFDL)


Adding and maintaining target hooks is unnecessarily hard at the moment,
because the definition is spread across three places, and these are supposed
to be kept in sync.  The code is necessarily kept more or less in sync because
it generally fails to compile or work when it isn't - and if someone can't
get it working, a patch will most likely be left unposted; but the
documentation is silently accumulating inconsistencies with the code,
to the point that is useless or worse than useless for some hooks.

Ideally, target hooks should be easy to maintain in a consistent manner,
and also easy to add to experimental GCC versions, so that people who are
new to GCC or who patch GCC only as a side aspect
of their work can work with them in their contributions.

I have a prototype patch that allows to define target hooks in
a single file - there called target.def - to define the structure member,
its initializer, and its documentation:

http://gcc.gnu.org/ml/gcc-patches/2010-01/msg00559.html

Name and types of the hook is shared between code and documentation, and
the member initializer is automatically placed in the right place of the
right initializer, so it takes the worry out getting and keeping this data
consistent.

However, there is a licensing problem.  The code is GPLed, and the
documentation is GFDLed.  The entire file is included for the struct
gcc_target by a number of GCC file, thus a GPL license is required.
For the initializer macro definitions and the documentation, the file
is included by a generator file, which processes the various fields of
each hook to generate the output files:
The initializer macros end up in a header file which is needed with GPL
license.
For the documentation, the generator file reads the GFDLed file tm.texi.in
which contains all the non-hook documentation, documentation about hooks
that does not pertain to any particular hook, and placement information
to arrange the hook documentation from the input file; the output is
written to tm.texi in the build directory.

As far as I can tell, there is no need for the generator program binary
to have a fancy license; GPL should be just fine, as long as the target.def
source file allows use of the pieces that appear in the output under the GFDL.
The generator program is supposed to be used by people who are in possession
of a copy of target.def, so they should be able to rely on the license terms
of that file.
Here is my proposal for the license header of that file:

/* Target hook definitions.
   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
   Free Software Foundation, Inc.

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

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; see the file COPYING3.  If not see
   <http://www.gnu.org/licenses/>.

   In other words, you are welcome to use, share and improve this program.
   You are forbidden to forbid anyone else to use, share and improve
   what you give them.   Help stamp out software-hoarding!  */

/* As a special exception, you may create documentation that contains
   part or all of this target hooks definitions file and distribute that
   work under the copying terms outlined in doc/gcc.texi .
   Alternatively, if you modify or redistribute this target hooks
   definitions file itself, you may (at your option) remove this special
   exception, which will cause the target hooks definitions file (and any
   program output which incorporates parts of this file) to be licensed
   under the GNU General Public License without this special exception.  */

We'd then need the FSF to agree that we can use the existing target hook
structure member definitions, default initializers, and documentation under
this dual license.

Quoting "Joseph S. Myers" <joseph@codesourcery.com>:
You should expect it to take at least several months for the FSF
to prepare an exception (worded as additional permissions under Section 7
of GPL version 3, like COPYING.RUNTIME, *not* as an old-style "As a
special exception"), maybe years, if the SC persuades them that there
should be such an exception.

I don't see why something so elaborate is needed. The file in question is about 150 KB of structure definition, interface definition, and documentation. The aim is that this file can be used in a GPLed program (GCC) and that parts of it (emitted by a generator program) can be used in GFDLed documentation. So dual-licensing of this file should work just fine. I find it quite challenging to come up with scenarios where GFDLing some target hook structure, or GPLing some of the target.def target hook documentation (which is incomplete anyways without the pure-GFDL tm.texi.in), would impede the FSFs aim to keep GCC Free.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]