[cfe-dev] C++ Language Support Library

Doug Gregor doug.gregor at gmail.com
Mon Nov 10 15:00:30 PST 2008


On Mon, Nov 10, 2008 at 4:50 PM, Chris Lattner <clattner at apple.com> wrote:
>
> On Nov 10, 2008, at 1:41 PM, Doug Gregor wrote:
>
>>> What are the potential license issues of using libstdc++?  While we could
>>> require a different implementation, it would really be nice for clang to
>>> also/optionally support libstdc++.  Is there some strange wording in the
>>> library license?
>>
>> No, libsupc++ is the same license as libstdc++, which is GPL with an
>> exception for software compiled with the library:
>>
>> // As a special exception, you may use this file as part of a free
>> software
>> // library without restriction.  Specifically, if other files instantiate
>> // templates or use macros or inline functions from this file, or you
>> compile
>> // this file and link it with other files to produce an executable, this
>> // file does not by itself 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.
>>
>> I don't think anything prevents us from supporting libstdc++, but I'm
>> guessing we don't want to use it exclusively.
>
> Ok.  libgcc (as of GPL2 days, the GPL3 wording *still* isn't finished yet)
> has strange wording that basically says "the code is GPL unless compiled by
> GCC".

libstdc++ doesn't have this kind of wording, thankfully. The Intel
compiler on Linux compiles with libstdc++, and of course it's
proprietary.

> For a random linux distro, for example, it would be fine to compile
> libstdc++ with GCC, and clang should be able to work with it.
>
> I think that retaining compatibility with libstdc++ would be a very
> worthwhile goal (as is supporting the apache library, stlport, and/or
> whatever other ones exist, where reasonable).  What is the cost of doing
> this?  Does it use crazy GCC extensions that we don't want to implement?

libstdc++ aims to be pretty standard-conforming, and they avoid most
crazy GCC extensions. As Sebastian noted, in GCC 4.3 and newer are
using some C++0x features in their TR1 implementation. The biggest
feature there is variadic templates, which---while not trivial---isn't
terribly hard to implement if the template system itself is designed
well.

  - Doug



More information about the cfe-dev mailing list