|
From: DJ D. <dj...@de...> - 2001-05-17 20:48:38
|
Earnie wrote to me: > Speaking of this, there has been clatter on the MinGW list about this > very issue. Paul Sokolovsky has created libstdc++.dll and libgcc.dll > and as a result of need to distribute those dll's and of course the > source to build those dll's. So recommendations about using the static > versions of those libraries were made just to avoid having to distribute > those DLL's with source. I was wondering if you might respond to the > attached mail? Sure. Note that I didn't go read the original thread. I will respond with my opinions only to the specific points given below. The topic over in cygwin-land was that the C++ libraries gcc uses (libgcc, libstdc++) may be used in 100% proprietary programs, provided those programs were compiled and linked with gcc. This is an exception to the LGPL that libgcc and libstdc++ allow. That exception may make your entire thread moot, if the libraries in question are libgcc and/or libstdc++. > LGPL> A program that contains no derivative of any portion of the > LGPL> Library, but is designed to work with the Library by being compiled or > LGPL> linked with it, is called a "work that uses the Library". Such a > LGPL> work, in isolation, is not a derivative work of the Library, and > LGPL> therefore falls outside the scope of this License. > LGPL> However, linking a "work that uses the Library" with the Library > LGPL> creates an executable that is a derivative of the Library (because it > LGPL> contains portions of the Library), rather than a "work that uses the > LGPL> library". The executable is therefore covered by this License. > LGPL> Section 6 states terms for distribution of such executables. > > It says that our program is our program, but only without the library > it uses. But if it is linked *statically*, it is a derivative (it > contains pieces of code from the library). However, if we link > dynamically, our program doesn't contain them (it only contains > references to them). We shouldn't forget, however, that our program, > either linked statically or dynamically, also uses material from > library's header file: One of the keys of the GPL (I do not refer to the LGPL here) is that it deals with "works" and not "files". The LGPL clause above uses the phrase "creates an executable" in such a way that *I* interpret the "program" in the first half to mean something that is *not* the final executable. I do not believe the FSF intended for dynamic linking to be considered different from static linking, but that is a gray area they are working on clarifying in the next rev of the [L]GPL. IMHO, an executable that requires a DLL to run is not considered a separate work from that dll, regardless of how many individual files are involved. One may argue that "linking" is the process of resolving symbol references, and linking against a DLL certainly does that, even though the files aren't merged at that time. IMHO an executable that will run without that dll, but may use that dll if it is present, would be a separate work. > LGPL> If such an object file uses only numerical parameters, data > LGPL> structure layouts and accessors, and small macros and small inline > LGPL> functions (ten lines or less in length), then the use of the object > LGPL> file is unrestricted, regardless of whether it is legally a derivative > LGPL> work. (Executables containing this object code plus portions of the > LGPL> Library will still fall under Section 6.) > > So if headers are plain enough (it is almost always true, possible > exception is STL, for example), our program, when linked dynamically, > is still our program, there are no problems with licensing. But when > linked statically, it always falls under the terms of Section 6. Yeah, complex headers are another gray area. STL is definitely complex. > Hmm, that's interesting. As we can see, any statically linked program > falls under the terms of this section. But the question is: does > dynamically linked program fall under them too? See above for my take on that. > LGPL> In addition, mere aggregation of another work not based on the Library > LGPL> with the Library (or with a work based on the Library) on a volume of > LGPL> a storage or distribution medium does not bring the other work under > LGPL> the scope of this License. > > Let's say that we can make an installer that > 1) installs our program > 2) gives a choice to install needed libraries' binaries and sources > (default is to install bins and not to install srcs) > > Now > 1) our program doesn't fall under the scope of the LGPL > 2) our distribution doesn't violate LGPL Any distro that includes sufficient source is OK with the LGPL anyway, regardless of what the user chooses to install or to not install. It is only when the *distributor* keeps the source from the user that the LGPL is violated. The user *always* has the freedom to choose what they want to do or not do with it, but it must be *their* choice. > So, when we make a decision about the way of linking, the answer is: > we should link dynamically. Well, technical and support issues may be a more important issue than legal issues sometimes, especially when the user has two different versions of the same dll on their system. > Any statically linked program will fall > under the terms of section 6. It is quite restrictive, for instance: > > (from section 6) > LGPL> Accompany the work with the complete corresponding > LGPL> machine-readable source code for the Library including whatever > LGPL> changes were used in the work (which must be distributed under > LGPL> Sections 1 and 2 above); and, This shouldn't be a problem anyway. > LGPL clearly states that end-user *must* have the ability to modify > the library and use our program with the modified version. If we link > statically, we will have to provide all the stuff needed to relink (at > least all our .o files and scripts), that's painful. Or at least one big .o of everything but the library, perhaps even with resolved symbols stripped, ready for that one final link step. For all intents and purposes, that one big .o is as proprietary as a proprietary executable gets. Note: Cabletron ships their Spectrum product this way! (not because of the gpl, but for technical reasons). > So just giving an URL won't work. If we distribute our program on a > CD-ROM, source code must be available from the same CD-ROM, and so > on. Yup. There are lots of good reasons why, too. |
|
From: DJ D. <dj...@de...> - 2001-05-18 14:18:11
|
> It isn't a straightforward interpretation. None of them are. That's why I said they were all my opinion. |
|
From: Tony K. <al...@po...> - 2001-05-18 16:35:08
|
Quoth Jeremy Bettis on Friday, 18 May: : Ok, I might be missing the point here, but wouldn't it be more MingW-like to : just make gcc compatible with the Microsoft C++ runtime dll's? definitely : ... I know it's a lot of work ... definitely. rather an understatement, even. not quite up to the level of genesis 1:19 though: "and he made the stars also". |
|
From: Ikm <ik...@on...> - 2001-05-18 10:14:57
|
Friday, May 18, 2001, 12:47:52 AM, you wrote: Hope you don't mind if I respond... DD> The topic over in cygwin-land was that the C++ libraries gcc uses DD> (libgcc, libstdc++) may be used in 100% proprietary programs, provided DD> those programs were compiled and linked with gcc. This is an DD> exception to the LGPL that libgcc and libstdc++ allow. That exception DD> may make your entire thread moot, if the libraries in question are DD> libgcc and/or libstdc++. If these libraries are distributed with such an exception, it sure may. >> LGPL> A program that contains no derivative of any portion of the >> LGPL> Library, but is designed to work with the Library by being compiled or >> LGPL> linked with it, is called a "work that uses the Library". Such a >> LGPL> work, in isolation, is not a derivative work of the Library, and >> LGPL> therefore falls outside the scope of this License. >> LGPL> However, linking a "work that uses the Library" with the Library >> LGPL> creates an executable that is a derivative of the Library (because it >> LGPL> contains portions of the Library), rather than a "work that uses the >> LGPL> library". The executable is therefore covered by this License. >> LGPL> Section 6 states terms for distribution of such executables. >> >> It says that our program is our program, but only without the library >> it uses. But if it is linked *statically*, it is a derivative (it >> contains pieces of code from the library). However, if we link >> dynamically, our program doesn't contain them (it only contains >> references to them). We shouldn't forget, however, that our program, >> either linked statically or dynamically, also uses material from >> library's header file: DD> One of the keys of the GPL (I do not refer to the LGPL here) is that DD> it deals with "works" and not "files". The LGPL clause above uses the DD> phrase "creates an executable" in such a way that *I* interpret the DD> "program" in the first half to mean something that is *not* the final DD> executable. It isn't a straightforward interpretation. License states about an "executable" containing parts of the "library". Executable that uses dll doesn't contain them, only headers' info (and such fact doesn't put any restrictions as long as that headers are plain enough). DD> I do not believe the FSF intended for dynamic linking to DD> be considered different from static linking, but that is a gray area DD> they are working on clarifying in the next rev of the [L]GPL. But as far as I can understand they are implicitly considered different in the current version of the license. DD> IMHO, an executable that requires a DLL to run is not considered a DD> separate work from that dll, regardless of how many individual files DD> are involved. Such executable is a separate work. But it doesn't really work. But still it is a separate work ;) Ok, if to talk seriously, here, the same piece: >> LGPL> A program that contains no derivative of any portion of the >> LGPL> Library, but is designed to work with the Library by being compiled or >> LGPL> linked with it, is called a "work that uses the Library". Such a >> LGPL> work, in isolation, is not a derivative work of the Library, and >> LGPL> therefore falls outside the scope of this License. (***) License says it *is* a separate work. Even if .dll is required in order to execute. (Program is designed to work with the Library by being linked with it. Dynamic linking is still just linking. The only difference that it is physically done by user's system, not by vendor, who only puts refs needed to perform it) DD> One may argue that "linking" is the process of DD> resolving symbol references, and linking against a DLL certainly does DD> that, even though the files aren't merged at that time. But such linking is always done by the end-user (every time he runs the program). Imagine vedor distributing separate executable under it's own license, and also distributing required LGPL libraries under LGPL on the same distribution medium. I think such behaviour doesn't violate anything. DD> IMHO an executable that will run without that dll, but may use that DD> dll if it is present, would be a separate work. Refer to the piece (***) above. >> So, when we make a decision about the way of linking, the answer is: >> we should link dynamically. DD> Well, technical and support issues may be a more important issue than DD> legal issues sometimes, especially when the user has two different DD> versions of the same dll on their system. Ah, of course. To resolve such conflict, for instance, we can give choice to install required dlls to the program's destination folder only (rather than to win\system). Or we can link statically. But it is still pain. >> LGPL clearly states that end-user *must* have the ability to modify >> the library and use our program with the modified version. If we link >> statically, we will have to provide all the stuff needed to relink (at >> least all our .o files and scripts), that's painful. DD> Or at least one big .o of everything but the library, perhaps even DD> with resolved symbols stripped, ready for that one final link step. DD> For all intents and purposes, that one big .o is as proprietary as a DD> proprietary executable gets. Note: Cabletron ships their Spectrum DD> product this way! (not because of the gpl, but for technical reasons). But when we link dynamically, we don't have to waste time doing it. Of course, all this isn't necessarily relevant in case of libs that are not purely LGPLed. For instance, if libstdc++ and others really give such a nice linking exception mentioned at the top of the letter, it is much easier just to link against them statically. -- Konstantin Isakov |
|
From: Jeremy B. <je...@hk...> - 2001-05-18 16:06:44
|
Ok, I might be missing the point here, but wouldn't it be more MingW-like to just make gcc compatible with the Microsoft C++ runtime dll's? Then it wouldn't matter what the libstdc++ license is. (Yes, I know it's a lot of work, and no I'm not volunteering, I don't need C++ myself.) -- Jeremy Bettis -- Software Development Manager Hickman-Kenyon Systems, Inc. je...@hk... |
|
From: Greg C. <chi...@mi...> - 2001-05-18 22:15:33
|
Jeremy Bettis wrote: > > Ok, I might be missing the point here, but wouldn't it be more MingW-like to > just make gcc compatible with the Microsoft C++ runtime dll's? Then it > wouldn't matter what the libstdc++ license is. http://www.mingw.org says At the basic level, MinGW is a set of include files and import libraries that allow a console-mode program to use Microsoft's standard C runtime library MSVCRT.DLL (available on all NT systems, and on all stock Win9x after the original Windows 95 release (for which it can be installed separately)). C was well standardized when win95 came out. Add some headers (the standard tells how, and there's a lot of public documentation of ms extensions) and you can use their C rtl dll. But here we're talking about C++, which was standardized after win95 came out. I don't think anyone claims to have implemented the entire C++ standard yet; ms certainly hasn't, and they might not make their dll freely available. At any rate, C++ is more complex than C, notably in that the standard library is implemented partly in code that pretty much has got to be in a linkable library (like the definition of std::cout) and partly in templates that have to be in headers (until someone implements the standard 'export' keyword). The part of the implementation that, for now at least, is necessarily in headers has to work the same way as the dll: each needs an intimate knowledge of the other. It would be hard to write those headers, without relying on their source. The standard leaves a lot of discretion to implementors: for instance, strings might be copy on write, or they might not. We'd have to figure out and follow all their implementation decisions in order to write headers that complement their rtl. And I suppose we'd need to know their name-mangling scheme in order to link to their dll; that might not be public. While C can put almost 100% of its standard library implementation in a linkable library, almost 100% of a C++ standard library can be implemented in headers. I'd rather have those headers be free software in the gnu sense. If you want headers that are free without any [L]GPL restrictions, take a look at sgi.com and stlport.org . |
|
From: <dan...@ya...> - 2001-05-19 00:40:08
|
--- Jeremy Bettis <je...@hk...> wrote: > Ok, I might be missing the point here, but wouldn't it be more > MingW-like to > just make gcc compatible with the Microsoft C++ runtime dll's? Then > it > wouldn't matter what the libstdc++ license is. (Yes, I know it's a > lot of > work, and no I'm not volunteering, I don't need C++ myself.) > -- > Jeremy Bettis -- Software Development Manager > Hickman-Kenyon Systems, Inc. The other alternative is STLport's SGI iostream lib which builds as DLL with mingw and is conformant to most of C++ standard. Also has C++ locale support for w32. _____________________________________________________________________________ http://messenger.yahoo.com.au - Yahoo! Messenger - Voice chat, mail alerts, stock quotes and favourite news and lots more! |
|
From: Ikm <ik...@on...> - 2001-05-19 08:01:48
|
About libstdc++ - if we link statically, we have no problems since it is *GPLed* with the following *exception*: // As a special exception, if you link this library with files // compiled with a GNU compiler to produce an executable, this does not cause // the resulting executable to be covered by the GNU General Public License. // This exception does not however invalidate any other reasons why // the executable file might be covered by the GNU General Public License. So as long as we use gcc there is no problem. We shouldn't link against it dynamically, it may really cause problems since this library isn't even an LGPL -- it's GPL! I ain't going figuring out what possible problems it may cause, I just want to ask: why can't we just safely link statically and forget about that libstdc++.dll? -- Konstantin Isakov |
|
From: Paul G. <pga...@qw...> - 2001-05-19 20:11:45
|
Hi folks, On 19 May 2001, at 12:00, the Illustrious Ikm wrote: > > About libstdc++ - if we link statically, we have no problems since it is > *GPLed* with the following *exception*: > > // As a special exception, if you link this library with files > // compiled with a GNU compiler to produce an executable, this does not > cause // the resulting executable to be covered by the GNU General > Public License. // This exception does not however invalidate any other > reasons why // the executable file might be covered by the GNU General > Public License. > > So as long as we use gcc there is no problem. > > We shouldn't link against it dynamically, it may really cause problems > since this library isn't even an LGPL -- it's GPL! I ain't going > figuring out what possible problems it may cause, I just want to ask: > why can't we just safely link statically and forget about that > libstdc++.dll? You can. Original releases of libstdc++ for Mingw was designed that way. Can't remember if default linking of libstdc++ (latest release) is static though. Peace, Paul G. > > -- > Konstantin Isakov > > > > _______________________________________________ > MinGW-users mailing list > Min...@li... > > You may change your MinGW Account Options at: > http://lists.sourceforge.net/lists/listinfo/mingw-users > Nothing real can be threatened. Nothing unreal exists. |