This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: A library interface patch for egcs


At 05:11 28.06.98 , H.J. Lu wrote:
>Hi,
>
>Here is a patch for egcs to encode the library interface, ABI/API,
>in the library name.
>
>The problem with the current scheme is on a given machine, we may have
>multiple C libraries and multiple C++ compilers. As the result, we
>cannot have one single libstdc++ to support all the combinations. When
>we use the same libstdc++ to compile code with different C++ compilers,
>the resulting binary may not work if the libstdc++ is not compatible
>with all C++ compilers. With the shared libstdc++, installing a new
>one may break the existing C++ binaries on the system if they were
>compiled against a shared libstdc++ with a different ABI. They happen
>quite often on Linux machines since there are libc 5, glibc 2.0,
>glibc 2.1, gcc 2.7.2.3, gcc 2.8.1, egcs 1.0.3 and egcs 1.1.
>
>--enable-version-specific-runtime-libs helps a little. But it doesn't
>solve the problem when an old gcc is deleted, but some C++ binaries
>are still linked with the shared libstdc++. Also it uses too much
>disk spaces for no really good reason.
>
>My patch takes a different approach. First it introduces 3 new
>variables:
>
>1. LIBSTDCXX_INTERFACE: the interface name for libstdc++.
>2. CXX_INTERFACE: the interface name for c++.
>3. LIBC_INTERFACE: the interface name for libc.
>
>Their combination uniquely determines an ABI for libstdc++. It encodes
>the ABI in the library name. We have
>
>libstdc++-$(LIBSTDCXX_INTERFACE)$(LIBC_INTERFACE)$(CXX_INTERFACE)-$(VERSION
).a
>libstdc++-$(LIBSTDCXX_INTERFACE)$(LIBC_INTERFACE)$(CXX_INTERFACE)-$(VERSION
).so
>
>in $libdir and symlinks to
>
>libstdc++$(LIBC_INTERFACE)$(CXX_INTERFACE).a.$(LIBSTDCXX_INTERFACE)
>libstdc++$(LIBC_INTERFACE)$(CXX_INTERFACE).so.$(LIBSTDCXX_INTERFACE)
>
>in $libdir. We make symlinks from
>
>libstdc++$(LIBC_INTERFACE)$(CXX_INTERFACE).a.$(LIBSTDCXX_INTERFACE)
>libstdc++$(LIBC_INTERFACE)$(CXX_INTERFACE).so.$(LIBSTDCXX_INTERFACE)
>
>in $libdir to libstdc++.a and libstdc++.so in $libsubdir. Also all the
>C++ header files are installed in
>
>${prefix}/include/g++-$(LIBSTDCXX_INTERFACE)
>
>This scheme works very well on the static libraries and shared
>libraries with soname. For those systems without soname, we have to
>install the shared libraries in $libsubdir if we want to support
>multiple ABIs for shared libstdc++. But it is not quite usable in
>any case.
>
>BTW, I have updated my libg++ addon to work with this scheme. But
>it only works as an egcs addon. The stand-alone libstdc++ needs a
>modified config.if to support it. It shouldn't be hard to do.

This sounds like a very good idea to me, I would vote for it.
Just one minor point, is it correct that {alpha|powerpc}-*-linux-gnulibc1
have no special handling? They both use glibc-1.99.

Franz.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]