From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14318 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Samuel Holland Newsgroups: gmane.linux.lib.musl.general Subject: Re: [GCC PATCH] powerpc64 musl libc support for IEEE binary128 long double Date: Sun, 30 Jun 2019 19:59:28 -0500 Message-ID: References: <20190630193825.65174-1-samuel@sholland.org> <20190630193825.65174-2-samuel@sholland.org> <20190630222904.GD21055@port70.net> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="42111"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 To: musl@lists.openwall.com Original-X-From: musl-return-14334-gllmg-musl=m.gmane.org@lists.openwall.com Mon Jul 01 02:59:51 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1hhkfa-000Als-TQ for gllmg-musl@m.gmane.org; Mon, 01 Jul 2019 02:59:48 +0200 Original-Received: (qmail 14334 invoked by uid 550); 1 Jul 2019 00:59:43 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 14316 invoked from network); 1 Jul 2019 00:59:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=l 9U3NhxGVf/m4VGR1AOotdhSCg7l7fGZ3EIzolBthvw=; b=W6AE+EdZ07aqrz6kT 28Asv1af3GdPSXwKJEU8Fa1ecEc1bXK9gw2cu7swHZbRWBhIwmy98DbqzNOcY7Gm RHa+AfKJyyXbzaqelsXSfV4iJgndOi6lf5q+W3M3PnJZGmYJnmYLJLn27xxnu43u V79mftn4qgzSn9UnNJ4HVVvZgd10b2Ulud5nO4YX4loeODmn8Bk/X/TQLij7th3O nc0bNN7y5NGRTHIYgGPvMvjP67ao1XF3WnI/SQtc37WnA+Y0dN4FGPcThkjB1RJ2 URxeC/IbybS6l8vIZJoZlb/HckKM7rqr7SAvjC5Fum1e3ez+0X9Lk42BOifE3EGX iFRMA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=l9U3NhxGVf/m4VGR1AOotdhSCg7l7fGZ3EIzolBth vw=; b=B6MLQv2WQ9WMT2gm0ITy3+OmwH51f5HcmfGQWs63HtYrnLieiEaLvzWfp avOr5/uDQZ2DRYNSZlJWv/SFxBxMl7DG6OGA93g9IKnidqJgugdRVlBqwL15mlU8 azRJACS1T6n7fUA9XZoRtRmWs7IGlatjs+s18d+aDLrTBLnyMD/wnsFSASqdq238 6eBXBXyikeSJoa32AMqBvHEYQK5aoo9AtMFVD10a2/SbtUY5uahsmNLcnDaR6GMw 5ZxYUOm7MUMei5J5rpEOejaHyf4k0aYzFX65CmlWJp2FgCzCTCxrdqgHso1urr9N 05tAc8LGwW5nrtupbWZfS2djB9TSA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrvdehgdegudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesthejre dttdefjeenucfhrhhomhepufgrmhhuvghlucfjohhllhgrnhguuceoshgrmhhuvghlsehs hhholhhlrghnugdrohhrgheqnecukfhppeejtddrudefhedrudegkedrudehudenucfrrg hrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhlrghnugdrohhrghenucev lhhushhtvghrufhiiigvpedt X-ME-Proxy: In-Reply-To: <20190630222904.GD21055@port70.net> Content-Language: en-US Xref: news.gmane.org gmane.linux.lib.musl.general:14318 Archived-At: On 6/30/19 5:29 PM, Szabolcs Nagy wrote: > * Samuel Holland [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