mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Samuel Holland <samuel@sholland.org>
To: musl@lists.openwall.com
Subject: Re: [GCC PATCH] powerpc64 musl libc support for IEEE binary128 long double
Date: Sun, 30 Jun 2019 19:59:28 -0500	[thread overview]
Message-ID: <e748d6c5-d063-f312-72e8-924d71fbf1aa@sholland.org> (raw)
In-Reply-To: <20190630222904.GD21055@port70.net>

On 6/30/19 5:29 PM, Szabolcs Nagy wrote:
> * Samuel Holland <samuel@sholland.org> [2019-06-30 14:38:25 -0500]:
>>  gcc/config/rs6000/linux.h   |  3 ++-
>>  gcc/config/rs6000/linux64.h | 11 +++++++++--
>>  2 files changed, 11 insertions(+), 3 deletions(-)
>>
>> diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h
>> index 96b97877989b..439b5179b172 100644
>> --- a/gcc/config/rs6000/linux.h
>> +++ b/gcc/config/rs6000/linux.h
>> @@ -139,8 +139,9 @@
>>  #define POWERPC_LINUX
>>  
>>  /* ppc linux has 128-bit long double support in glibc 2.4 and later.  */
>> +/* musl supports 128-bit long double in 1.1.23 and later on powerpc64 only.  */
>>  #ifdef TARGET_DEFAULT_LONG_DOUBLE_128
>> -#define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128
>> +#define RS6000_DEFAULT_LONG_DOUBLE_SIZE (OPTION_MUSL ? 64 : 128)
> 
> configuring 32bit ppc with 128bit long double is unsupported in musl
> 
> i think reporting an error in config.gcc is better than trying to fix
> it up later.

I don't think that's possible, but I'm happy to be proven wrong. gcc accepts a
single gcc_cv_target_ldbl128, which is applied everywhere with
multilib/multiarch/--enable-targets=all. So even if --with-long-double-128 was
made an error for powerpc-linux-musl, the logic still has to work for
powerpc64-linux-musl, where it can't be an error.

> OPTION_MUSL can handle -mmusl cflag, not just the configured libc, but
> i think that's unreliable for other reasons anyway.

That also has to work: --target=powerpc-linux-gnu --with-long-double-128, and
then powerpc-linux-gnu-gcc -mmusl, will do the wrong thing unless it's fixed up
at runtime.

>> --- a/gcc/config/rs6000/linux64.h
>> +++ b/gcc/config/rs6000/linux64.h
>> @@ -447,12 +447,18 @@ extern int dot_symbols;
>>  ":%(dynamic_linker_prefix)/lib64/ld64.so.1}"
>>  #endif
>>  
>> +#ifdef TARGET_DEFAULT_LONG_DOUBLE_128
>> +#define MUSL_DYNAMIC_LINKER_FP "%{mlong-double-64:;:-ieee128}"
>> +#else
>> +#define MUSL_DYNAMIC_LINKER_FP "%{mlong-double-128:-ieee128}"
>> +#endif
>> +
>>  #undef MUSL_DYNAMIC_LINKER32
>>  #define MUSL_DYNAMIC_LINKER32 \
>>    "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
>>  #undef MUSL_DYNAMIC_LINKER64
>>  #define MUSL_DYNAMIC_LINKER64 \
>> -  "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
>> +  "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E MUSL_DYNAMIC_LINKER_FP ".so.1"
> 
> why did the -sf disappear?
> only do this if we are sure we never want to support such abi in musl

Because powerpc64 sf support doesn't exist on the musl side. I'll put it back.

> otherwise keep it with some easy to remember ordering for the extension
> suffixes (e.g. alphabetical)

Should there be a dash between "ieee128" and "sf"?

>>  /* ppc{32,64} linux has 128-bit long double support in glibc 2.4 and later.  */
>> +/* musl supports 128-bit long double in 1.1.23 and later on powerpc64 only.  */
>>  #ifdef TARGET_DEFAULT_LONG_DOUBLE_128
>> -#define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128
>> +#define RS6000_DEFAULT_LONG_DOUBLE_SIZE (OPTION_MUSL && !TARGET_64BIT ? 64 : 128)
>>  #endif
> 
> same as above, this looks ugly.

Same as above, I don't think it's avoidable.

Cheers,
Samuel


  reply	other threads:[~2019-07-01  0:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-30 19:38 [PATCH] powerpc64: add IEEE binary128 long double support Samuel Holland
2019-06-30 19:38 ` [GCC PATCH] powerpc64 musl libc support for IEEE binary128 long double Samuel Holland
2019-06-30 22:29   ` Szabolcs Nagy
2019-07-01  0:59     ` Samuel Holland [this message]
2019-07-01  7:17       ` Szabolcs Nagy
2019-07-01 17:42   ` Rich Felker
2019-07-02  0:48     ` Samuel Holland
2019-06-30 22:02 ` [PATCH] powerpc64: add IEEE binary128 long double support Szabolcs Nagy

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=e748d6c5-d063-f312-72e8-924d71fbf1aa@sholland.org \
    --to=samuel@sholland.org \
    --cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).