[gnu.misc.discuss] Linking with C libraries.

wbailey@oracle.com (Bill Bailey) (01/08/90)

There has been a lot of posts regarding linking with the GNU C library and
how this causes the whole of your program to fall under copyleft, thanks to
section 2b of the GPL.

Someone just asked me what happens under this related scenario: I pull
GNU program XYZ.c.  I make modifications to it to get it to run on
platform ABC.  I link XYZ with the vendor's supplied C libary in the
process.  Believing fully in the GNU philosophy, I start distributing
XYZ.c with my modifications to whomever wants it.

Then, someone calls me demanding the source to platform ABC's C
library!  After all, section 2b of the GPL requires that I make source
available for "the whole" of my program.  Since the C library came from
platform ABC's vendor, I have never even seen the source and they will
not give it to me.

Granted, this is a bit contrived.  Why would anyone demand the source 
for the C library from me when I obviously do not have it.  Still, I hope
the point is clear: as it exists now, section 2b of the GPL is confusing
and, perhaps, misleading. 

As I have stated before in this Newsgroup, I wish FSF would take a 
clearer stance on this whole issue.  Either allow people to use gcc
and the C library without copyleft restrictions or don't allow either.

-bill

wbailey@oracle.com (Bill Bailey) (01/09/90)

In article <1990Jan8.054859.557@oracle.com>, wbailey@oracle.com (Bill
Bailey) writes:
 
<me> Then, someone calls me demanding the source to platform ABC's C
<me> library!  After all, section 2b of the GPL requires that I make source
<me> available for "the whole" of my program.  Since the C library came from
<me> platform ABC's vendor, I have never even seen the source and they will
<me> not give it to me.

Jacob Gore responds:

> Since this case is explicitly addressed in GPL, I must assume that you have
> not read GPL and hope that it is because you do not have a copy of GPL to
> read.  Here is a copy of GPL.  See the last paragraph in Section 3.

Jacob missed the most obvious case: I do have the GPL and did read it
but simply forgot about this special case.  My mistake.  So I will
never go to law school.  Let's look at the paragraph Jacob refers to:

> For an executable file, complete source code means all the source code
> for all modules it contains; but, as a special exception, it need not
> include source code for modules which are standard libraries that
> accompany the operating system on which the executable file runs

This seems to further bolster some previous arguments.  If I just
distribute my object libraries with a Makefile and say "link on site with
any ansi C library" then I can't get unintentionally nailed by copyleft.
How am I to control whether someone links with the "standard libraries that
accompany the OS" or with GNU libraries?  What if I distribute my object
libraries to someone who runs them under GNU OS where the GNU libraries
ARE the "standard libraries?"  Help!

confused in free software land
-bill

barmar@think.com (Barry Margolin) (01/09/90)

In article <1990Jan8.185253.8145@oracle.com> wbailey@oracle.com writes:
>In article <1990Jan8.054859.557@oracle.com>, wbailey@oracle.com (Bill
>Bailey) writes:
>> For an executable file, complete source code means all the source code
>> for all modules it contains; but, as a special exception, it need not
>> include source code for modules which are standard libraries that
>> accompany the operating system on which the executable file runs
>How am I to control whether someone links with the "standard libraries that
>accompany the OS" or with GNU libraries?

If the recipient does the linking, then the libraries he links with are not
"contained" in the executable you distributed.  The ">>" paragraph is
referring to the case where you distribute a prelinked program.  In that
case, you are permitted to link with the standard libraries for the
recipient's system without getting in copyleft trouble.

If you distribute the program unlinked, and the recipient links it and
redistributes this, *he* is responsible for providing source code to the
libraries with which he linked (unless they're the standard libraries that
accompany *his* recipient's system).
--
Barry Margolin, Thinking Machines Corp.

barmar@think.com
{uunet,harvard}!think!barmar

baud@eedsp.eedsp.gatech.edu (Kurt Baudendistel) (01/10/90)

In article <1990Jan8.185253.8145@oracle.com> wbailey@oracle.com writes:
>What if ...
>
>confused in free software land

Well boys and girls, this subject is actually quite easy to understand.

If you USE a GNU product, the OUTPUT of the product is NOT copylefted;
if you USE GNU SOURCE CODE in producing anyghing, the produced thing
is called a ``derived work'' and it is subject to the copyleft.

The consequences of this statement are straightforward:
1. If you use GCC, the output of the compiler is not subject to the
   copyleft, whether this is object code or an executable file.
2. If you link with or use header files provided by GNU, the derived
   work is subject to the copyleft.

This is no big deal, in general, for use of GCC since there currently isn't
a GNU C library (you have to use someone else's library whatever your
machine is) and you can easily make your own header files.

In the future, just don't distribute linked code and don't use GNU header
files and you'll be ok.

HOWEVER, this is a big deal for G++ users, since header files are the
butter on the bread of libraries---header files are very complex and
required when compiling C++ code. Thus, G++ object code is copylefted if
you use libg++, the GNU C++ library, since the header files are required.

Hopefully, the status of libg++ will change in the future so that G++ can
be used as freely as GCC.

Bye for now.
kurt
-- 
Kurt Baudendistel --- GRA
Georgia Tech, School of Electrical Engineering, Atlanta, GA  30332
internet: baud@eedsp.gatech.edu         uucp: gatech!gt-eedsp!baud

allbery@NCoast.ORG (Brandon S. Allbery) (01/12/90)

As quoted from <1990Jan8.185253.8145@oracle.com> by wbailey@oracle.com (Bill Bailey):
+---------------
| > For an executable file, complete source code means all the source code
| > for all modules it contains; but, as a special exception, it need not
| > include source code for modules which are standard libraries that
| > accompany the operating system on which the executable file runs
| 
| This seems to further bolster some previous arguments.  If I just
| distribute my object libraries with a Makefile and say "link on site with
| any ansi C library" then I can't get unintentionally nailed by copyleft.
+---------------

Which still leaves *me* up a creek without a paddle:  I still can't use Bison
to build e.g. my (proposed) replacement for Unify 2000's Embedded SQL/A,
because I'd have to link to a non-publicly distributable library which is not
an OS library (specifically, the Unify RHLI library).  And (again repeating my
earlier message on this subject) because there is no GNU relational DBMS with
4GL, I can't use that to get out of it.  So I'm still stuck with the need to
pretty much ignore the FSF's existence and work.

++Brandon
-- 
Brandon S. Allbery    allbery@NCoast.ORG, BALLBERY (MCI Mail), ALLBERY (Delphi)
      uunet!cwjcc.cwru.edu!ncoast!allbery ncoast!allbery@cwjcc.cwru.edu
*(comp.sources.misc mail to comp-sources-misc[-request]@backbone.site, please)*
*Third party vote-collection service: send mail to allbery@uunet.uu.net (ONLY)*

wbailey@oracle.com (Bill Bailey) (01/16/90)

In article <32745@news.Think.COM>, barmar@think.com (Barry Margolin) writes:
> From: barmar@think.com (Barry Margolin)
> 
> If you distribute the program unlinked, and the recipient links it and
> redistributes this, *he* is responsible for providing source code to the
> libraries with which he linked 

So I sell someone my object libraries.  Without my knowing it, he links
them with the GNU C library and re-sells to someone else (say I get a
royalty).  Now, you claim, he is responsible for providing source to my
libraries which I never gave him in the first place.  So am I now
legally responsible for something he did?  This is absurd.  If you are
right, I can not believe it would hold legal ground.

-bill