[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: GCC 4.4 run-time license and non-GPLv3 compilers

Florian Weimer a écrit :
> Starting with version 4.4, the FSF the licenses the GCC run-time
> library with a special exception: [...]

A few precisions:

 * OCaml doesn't depend on any GCC-specific feature. It works with any
   C compiler.

 * There are 4 compilers for Objective Caml:

   - ocamlc, ocamlc.opt generate bytecode objects specific to OCaml,
     which can be considered as "Target Code" (IMHO), using the terms of
     [1]. When running these compilers, GCC is not involved at all in
     the compilation process. The process of compilation of ocamlc.opt
     itself invokes GCC merely as a linker, the process of compilation
     of ocamlc only uses ocamlc itself (either the binary provided by
     upstream, or the bootstrapped one which is identical modulo
     system-specific locations).

   - ocamlopt, ocamlopt.opt generate assembly code, i.e. another form of
     "Target Code". When running these compilers, GCC is invoked only
     as a linker. The process of compilation of ocamlopt itself can use
     only ocamlc (no GCC at all). The process of compilation of
     ocamlopt.opt uses GCC as a linker.

 * The runtime (ocamlrun) is a pure C program, that can be compiled with
   any C compiler. Customized runtimes (with functions implemented in C)
   can be generated; in this case, a C file might be generated by
   ocamlc{,.opt}, and this file is handled the same way as the other
   files containing the C functions.

In any case, intermediate representations of GCC are not used. IMHO, the
exception applies to OCaml itself (and its runtime), and code generated
by OCaml are usually not concerned. Therefore, I don't consider any part
of the OCaml system being a work based on GCC.

The FAQ [2] seems to confirm this analysis, in particular the answers to
the following questions:

> I use GCC in conjunction with proprietary preprocessors and/or source generators to compile my program. Can I still take advantage of the exception?


> I use GCC to compile parts of my program, and a proprietary compiler to compile other parts. The pieces are combined afterward, during assembler or linking phases. Can I still take advantage of the exception?

Back to the original mail:

> We might weasel out of this if we always bootstrap off GCC 4.3, but
> this is not how the Objective Caml build system works (it bootstraps
> the compiler off pre-compiled bytecode shipped along the sources).
> Perhaps the above interpretation is too narrow, but I don't think it's
> a fringe reading.  The FSF obviously wants to outlaw proprietary
> compilers, and from a purely license-centric point of view, a
> proprietary compiler is as good or bad as one licensed in a way which
> is not compatible with the GPLv3.  What makes the license
> interpretation some awkward is the bootstrapping process and its
> recursive nature.

The FSF obviously wants to outlaw proprietary compilers that use
intermediate representations of GCC. Using GCC as a C-to-asm compiler is
fine, even in a proprietary project. The FAQ states explicitly that a
program generating a C file, for example (which might be a compiler in
fact), doesn't take part in the "compilation process". So one could even
make a proprietary compiler using C as an intermediate langage, and GCC
for the final stage, I guess.

[1] http://www.gnu.org/licenses/gcc-exception.html
[2] http://www.gnu.org/licenses/gcc-exception-3.1-faq.html



Reply to: