[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: i386 compatibility & libstdc++

Hash: SHA1

On Monday 28 April 2003 23:54, Martin v. Löwis wrote:
> Arnd Bergmann <arnd@arndb.de> writes:
> > They have to be compiled for i386, as they have always been.
> > If they were compiled for i486, they would not run on i386
> > anyway, with or without the bug.
> But if they are compiled for i386, they won't run on other Linux
> systems, thus losing binary compatibility.

If that is important, we can ship an additional library that
contains only the i486 __exchange_and_add() code.

> > Ok, I probably wasn't clear enough about the actual trick. If you want
> > to use foreign binaries or build any debian packages libraries with
> > C++ for i486+, you need to install the i486 libstdc++ files.
> Not only those, but also all other libraries that the executable links
> with.

Why that? Every other library contains either the inline 
__exchange_and_add code or a reference to the extern one. On i486+ 
systems, the library builtin function is compatible with the inline 
one, so it does not matter. If there are any libraries that link 
statically against libstdc++_pic.a, the optimizations have to match, 
but AFAICS, we don't do that for regular packages.

> You need to add Qt, kde, and many other libraries to that as well.
> Essentially, for each C++ library, you should have three versions: the
> 2.95 version, the c102 version, and the c102-debian version.

That would only be necessary if we would implemented Matthias' 
original solution where the i386 and i486 versions are neither
backwards nor forwards compatible. In my proposal, the i486
version can replace the i386 version, but not vice versa.

> > All default packages are built for i386 (as always) and linked
> > for with the soname libstdc++-i386.so.5. On i486+ systems,
> > the runtime linker will automatically use
> > /usr/lib/i486/libstdc++-i386.so.5, which resolve the
> > __exchange_and_add() function to the trivial assembly version.
> Isn't the __exchange_and_add function inline, so that the dynamic
> linker can't change its implementation, anyway?
No, look at my patch again. If you build without i486 optimization,
the compiler will see only the extern declaration for 

	Arnd <><
Version: GnuPG v1.2.1 (GNU/Linux)


Reply to: