Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 18 Sep 2019 16:04:01 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Cc: info@...ile-stream.com
Subject: Re: [PATCH] mips: add single-instruction math functions

On Wed, Sep 18, 2019 at 08:18:04PM +0300, info@...ile-stream.com wrote:
> R> Why is this dependent on __mips_abs2008?
> 
> There is also __mips_nan2008 (always set for hard-float R6 and
> -mnan=2008).
> 
> Binaries built with this option (implicit or not) are unusable on
> -mnan=legacy system, this is enforced by kernel (unless booted with
> some debugging option).
> 
> The fabs code could be changed to also depend on __mips_nan2008
> (since these ISA features are paired) to prevent -mabs=2008 musl on
> -mabs=legacy system (rather unrealistic).
> 
> Why is it wrong to depend on fine-grained ISA features after all?

It's not. The presence of a new instruction for non-arithmetic abs
would be a fine-grained ISA feature. An incompatible change in an
existing instruction is a *different ISA*, which needs a different
ldsoname per musl policy of always allowing different ISAs to coexist
in the same filesystem and have their own library ecosystems.

I'm guessing we've hit a situation where people have been building
binaries for an incompatible MIPS-family ISA reusing the same
ldsoname, which is a huge mess we probably need to figure out how to
deal with...

> Why is it wrong to explicitly depend e.g. on __mips_dsp in the
> strchr code fearing improper usage on a system without DSP ASE?

Because it's an ISA level, not an incompatible ISA. With libc built
for the baseline ISA level (or any ISA level not assuming dsp;
actually it probably doesn't matter even if it does since I can't
imagine the compiler generates dsp insns for anything in libc) you can
run *both baseline non-dsp mips binaries, and ones using dsp
features*.

Note that this is the same situation as i386; as long as libc is built
for a baseline (like i486; i386 is actually a misnomer) you can run
both baseline binaries and ones built for i686 or whatever more recent
ISA level you like using the same libc (and library ecosystem and
filesystem).

> powerpc64, s390x have similar ifdefs in their math code and IIUC
> nothing prevents running (until SIGILL) statically-linked
> _ARCH_PWR5X binary on an _ARCH_PWR5 system.

You're looking at it the other way around.

> Or some powerpc64 code depends on __VSX__. Is it wrong to depend on
> __mips_msa?
> 
> What is different with mips here?

Reversal of direction of the incompatibility.

Rich

Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.