Brian Fox <bria...@brianfox.ca
>Do you think the same rule applies if I use a GPL Forth to write a
>cross-compiler than generates a new Forth system?
What you use for editing the source code or testing plays no role for
the copyright, as long as you don't include significant amounts of
code from a source that was copyrighted by someone else. In the
latter case you have to comply with the license of the source code.
How much is considered "significant" depends on the jurisdiction, and
how far the copyright lobbyists have advanced there.
If you release a binary, the question is if the compiler you use puts
significant code that was not derived from your code into the binary.
E.g., the gcc run-time library libgcc is linked with code generated by
gcc, and therefore you have to comply with the license of libgcc when
distributing binaries produced by gcc. The license of libgcc is not
GPL and allows arbitrary distribution of the resulting binaries.
Programmers tend to think that they can get around the need to comply
with a library's (or Forth system in our case) license by distributing
the source code, and letting the user perform the linking (compiling
in case of a Forth system), but lawyers think differently: If your
source code is written such that it only works with a specific
library, you have to comply with that library's license conditions.
This is apparently so clear to every lawyer involved that AFAIK nobody
has tested it in court yet. Instead, what those have done who did not
want to comply with the GPL is to write alternative libraries with the
same API (in the case of libgmp) so that one could claim that the
source program was not written specifically for the GPLed library; or
they have just not used the GPLed library and have not benefitted from
its qualities (in case of libreadline).
Now, for your question: If you write a cross compiler and run it on a
GPLed Forth, whether you have to comply with the GPL when distributing
the cross-compiler depends on whether the cross-compiler only works
with that GPLed Forth system or also with others (e.g., Gforth's
cross-compiler originally ran on other systems; that may have changed
in the meantime).
Concerning the code it creates, what licenses it has to comply with
depends on the licenses of code that it uses for generating the
binary, and on whether the binary is specific to one run-time
library/system. E.g., if you have, say, a public-domain
cross-compiler that generates the standalone binary (no run-time
library/system needed) only from the source code the user provides and
from the (public-domain) code included in the cross-compiler, the user
distributing the binary only has to comply with the license of the
source the user gives to it. If the cross-compiler is not in the
public domain, and the binary includes significant code that is
derived from the code of the cross-compiler, the license of the
cross-compiler also has to be complied with.
E.g., with the Gforth cross-compiler you can provide code for all
words yourself, but for many words that are primitives in mainstream
Gforth it provides replacement definitions (in Forth) so that you
don't have to start with a full complement of primitives, but can
introduce and test them step-by-step. These replacement words are
under GPL, so if you use a significant amount of code coming from
these words, the resulting binary can only be distributed under the
terms of the GPL (plus whatever license the rest of the code is
under). But if you provide all words yourself, this does not apply.
If you use this cross-compiler to build an image to work with the
Gforth engine (which provides the primitives), distributing the image
has to comply with the GPL, because the engine is under the GPL.
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: https://forth-standard.org/
EuroForth 2022: https://euro.theforth.net