[OpenWrt-Devel] [PATCH] build: always use -minterlink-mips16 if USE_MIPS16

Eneas Queiroz cotequeiroz at gmail.com
Mon May 25 08:32:09 EDT 2020


On Mon, May 25, 2020 at 5:06 AM Felix Fietkau <nbd at nbd.name> wrote:
>
> On 2020-05-25 02:19, Eneas U de Queiroz wrote:
> > Individual packages may turn off MIPS16 ISA individually with
> > PKG_USE_MIPS16.  However, they may link to a library compiled with
> > MIPS16.  In such cases, the -minterlink-mips16 is needed to ensure there
> > are no direct jumps to code compiled with a different ISA.
> >
> > Instead of adding -minterlink-mips16 only when PKG_USE_MIPS16 is on, add
> > it when global USE_MIPS16 is on.
> >
> > Signed-off-by: Eneas U de Queiroz <cotequeiroz at gmail.com>
> > ---
> > Tested by compiling all packages in base, packages, routing and
> > telephony feeds for mips_74kc, with MIPS16 enabled.
> >
> > This was discovered while working on lxc fixes
> > (https://github.com/openwrt/packages/pull/12241), where compilation with
> > mips16 would fail because of '-fstack-check=specific not implemented for
> > MIPS16', and it would fail with PKG_USE_MIPS16=0 because of jumping to a
> > different ISA mode:
> >
> > lxc-4.0.2/src/lxc/caps.c:24:(.text+0xa4): unsupported jump between ISA
> > modes; consider recompiling with interlinking enabled
> >
> > In theory this could happen in more places, so set interlinking on
> > whenever MIPS16 is turned on globally.
> I think there needs be a way to opt-out of this behavior.
> The -minterlink-mips16 flag affects the performance and code size of
> generated code, so libraries that disable MIPS16 for performance reasons
> and don't depend on other MIPS16 enabled libraries should not be
> compiled with this flag.
>
> - Felix

Let's leave it as is, then.  Right now this failure appears to be an
exception, not a rule.  Packages can opt-in by adding the
-minterlink-mips16 flag themselves, as was done with lxc.

Eneas

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list