public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>
Subject: Re: odd endianness toolchains for crosstool
Date: Mon, 25 Apr 2022 19:01:57 +0200	[thread overview]
Message-ID: <YmbUBZg/nGV7gLyy@zx2c4.com> (raw)
In-Reply-To: <CAK8P3a1kRXQrmNg4eQw0-P+Fzz_AvFooLg3=nQNQKMRwvL9DWQ@mail.gmail.com>

Hi Arnd,

On Mon, Apr 25, 2022 at 06:15:07PM +0200, Arnd Bergmann wrote:
> On Mon, Apr 25, 2022 at 5:53 PM Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> >
> > Hi Arnd,
> >
> > On Mon, Apr 25, 2022 at 05:39:34PM +0200, Arnd Bergmann wrote:
> > > I can probably do that before migrating to the new machine, but I can't
> > > promise how quickly I find time to start.
> >
> > Oh awesome. Will keep my eye out for it.
> >
> > > > (And also, build ppc32 with --enable-secureplt --with-long-double-64.)
> > >
> > > Can you explain what those are about? Is this related to the ELFv1
> > > vs ELFv2 difference or something else? Is this needed in both the
> > > ppc32 and ppc64 compilers that each come with both targets?
> >
> > For 32-bit, it is required. From
> > <https://wiki.musl-libc.org/supported-platforms.html>:
> >
> >     powerpc (needs gcc built with --enable-secureplt
> >     --with-long-double-64, and -Wl,--secure-plt to link dynamic
> >     binaries.)
> >
> > And from the INSTALL file it says:
> >
> >     * PowerPC
> >         * Compiler toolchain must provide 64-bit long double, not IBM
> >           double-double or IEEE quad
> >         * For dynamic linking, compiler toolchain must be configured for
> >           "secure PLT" variant
> >
> > For 64-bit, I'm not sure, but I know that at least -mabi=elfv2 is required,
> > and I think --with-long-double-64 too, according to documentation:
> >
> >     * PowerPC64
> >         * Both little and big endian variants are supported
> >         * Compiler toolchain must provide 64-bit long double, not IBM
> >           double-double or IEEE quad
> >         * Compiler toolchain must use the new (ELFv2) ABI regardless of
> >           whether it is for little or big endian
> 
> Ok, I see. For all I can tell, the toolchain I built already uses both
> --with-long-double-64
> and --enable-secureplt, as those seemt to be the default for Linux.

For ppc32? I'm unable to produce working executables with the toolchain.
And looking at the target info, -msecure-plt is missing, while
-mlong-double-64 is there:

$ ./powerpc-linux-gcc -Q --help=target | grep long-double
  -mlong-double-                        64
$ ./powerpc-linux-gcc -Q --help=target | grep msecure-plt
  -msecure-plt                          [disabled]

For ppc64, I see the same. I'll try to look into it more though.

> Regarding the the ELF ABI, I'm not sure how to check, but I think it
> only does ELFv1, which is the default for big-endian glibc.

Yes, it only is doing ELFv1 right now. musl checks this in
<https://git.musl-libc.org/cgit/musl/tree/configure#n689> with this:

    trycppif "_CALL_ELF == 2" "$t" || fail "$0: error: unsupported powerpc64 ABI"

Jason

  reply	other threads:[~2022-04-25 17:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-25  1:39 odd endianness toolchains for crosstool Jason A. Donenfeld
2022-04-25  8:46 ` Arnd Bergmann
2022-04-25 11:43   ` Jason A. Donenfeld
2022-04-25 14:55     ` Arnd Bergmann
2022-04-25 15:20       ` Jason A. Donenfeld
2022-04-25 15:39         ` Arnd Bergmann
2022-04-25 15:53           ` Jason A. Donenfeld
2022-04-25 16:15             ` Arnd Bergmann
2022-04-25 17:01               ` Jason A. Donenfeld [this message]
2022-04-25 17:20                 ` Jason A. Donenfeld
2022-04-25 17:40                 ` Arnd Bergmann
2022-04-25 17:42                   ` Jason A. Donenfeld
2022-04-28  6:43 ` Rob Landley
2024-08-29 15:51 ` Jason A. Donenfeld
2024-08-29 20:25   ` Arnd Bergmann
2024-09-03  1:23     ` Nathan Chancellor
2024-09-03  6:59       ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YmbUBZg/nGV7gLyy@zx2c4.com \
    --to=jason@zx2c4.com \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ndesaulniers@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox