From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14315 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Samuel Holland Newsgroups: gmane.linux.lib.musl.general Subject: [GCC PATCH] powerpc64 musl libc support for IEEE binary128 long double Date: Sun, 30 Jun 2019 14:38:25 -0500 Message-ID: <20190630193825.65174-2-samuel@sholland.org> References: <20190630193825.65174-1-samuel@sholland.org> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="130259"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Samuel Holland To: musl@lists.openwall.com Original-X-From: musl-return-14331-gllmg-musl=m.gmane.org@lists.openwall.com Sun Jun 30 21:38:57 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 1hhff6-000Xh1-Ur for gllmg-musl@m.gmane.org; Sun, 30 Jun 2019 21:38:57 +0200 Original-Received: (qmail 22281 invoked by uid 550); 30 Jun 2019 19:38: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 22208 invoked from network); 30 Jun 2019 19:38:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=wp/fARXRYUKSv Vje2nFQ7mq2QAs2LJRTw+8+sH9kCqI=; b=43yxAl/vuxo6Uy28dzAdjHw3AFInH ffnHnn76OTy6rRHTgXnUFBGvcbGyJJMw5plK05GMJa0PbhwBCAsf1WrQAQxluKmW WCB07Y6QprVn251Xgj+9m7yQzP+GNsUY7BVvLa1W3mhGC8dckC40Wy7CLQrQGG8x irtBOE8i9c8I+/jqgWE/mYF173TFo4z/c0vZEzafGpF2B+sSpbo59DS6fq+qWdgD hozUbX6kj4fDOmmxGMGDF7b93Hf+tohos41JCMOsdjvOENppN1yU72qW7S+9WMsJ 23spfwyLupOP1OcIv+7XiFa4qCLTMV1mVR07GVdOg9bJIhqW18EOXzWNg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=wp/fARXRYUKSvVje2nFQ7mq2QAs2LJRTw+8+sH9kCqI=; b=tr6juYhF AAN7Zd7tJjexpSThPVCOlzqOizy1x0RHkTF3RciQ66zNKHt2cpAKh6U/y8JRYs7s +e9m79AJ7NTN7rShLqwwvI1Dpx+e8CSbF+N2jijMsJP1gKqVsIBr6gPwhq1YWEGg TfnLMzzZVYrMu50xAjbWKxbb5fg66iZficLHOIdYG56ZeXR6yY+awbMMaZIn6ST+ JPb9YQOIoLQrO62TzCufgYhLKvdBVSezXt8Ir6Oeui2WFyQZDQRNApodEcVPRAnr Nqey59bIUZSJo4K19leEAJmdygxirvAy5sm8NorLR5uvbQYj+LiSD3apEjEWBgAD Pr4VmgcOmlSYKw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrvdeggddufeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepufgrmhhuvghlucfjohhllhgrnhguuceoshgrmhhuvghlsehs hhholhhlrghnugdrohhrgheqnecukfhppeejtddrudefhedrudegkedrudehudenucfrrg hrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhlrghnugdrohhrghenucev lhhushhtvghrufhiiigvpedt X-ME-Proxy: X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190630193825.65174-1-samuel@sholland.org> Xref: news.gmane.org gmane.linux.lib.musl.general:14315 Archived-At: --- This works properly with multiarch and -m64/-m32: $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/powerpc64-gentoo-linux-musl/8.3.0/lto-wrapper Target: powerpc64-gentoo-linux-musl Configured with: /tmp/portage/sys-devel/gcc-8.3.0-r1/work/gcc-8.3.0/configure --host=powerpc64-gentoo-linux-musl --build=powerpc64-gentoo-linux-musl --prefix=/usr --enable-languages=c,c++,ada --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --disable-nls --enable-checking=release --enable-esp --enable-libstdcxx-time --disable-libstdcxx-pch --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-multilib --disable-altivec --disable-fixed-point --enable-libgomp --disable-libmudflap --disable-libmpx --disable-systemtap --disable-vtable-verify --disable-libvtv --disable-libquadmath --enable-lto --without-isl --disable-libsanitizer --enable-default-pie --enable-default-ssp --enable-multiarch --with-linker-hash-style=both --disable-decimal-float --enable-secureplt --with-abi=elfv2 --with-cpu=power9 --with-long-double-128 --with-long-double-format=ieee Thread model: posix gcc version 8.3.0 (Gentoo Hardened 8.3.0-r1 p1.1) $ gcc -m64 tests/hello.c -o hello $ file hello hello: ELF 64-bit MSB pie executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-powerpc64-ieee128.so.1, not stripped $ readelf -aW hello | tail -n2 File Attributes Tag_GNU_Power_ABI_FP: hard float, 128-bit IEEE long double $ ./hello Hello, world! $ gcc -m32 tests/hello.c -o hello $ file hello hello: ELF 32-bit MSB pie executable, PowerPC or cisco 4500, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-powerpc.so.1, not stripped $ readelf -aW hello | tail -n2 File Attributes Tag_GNU_Power_ABI_FP: hard float, 64-bit long double $ ./hello Hello, world! --- 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) #endif /* Static stack checking is supported by means of probes. */ diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h index 5380f6a6a6f1..2b76255f7673 100644 --- 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" #undef DEFAULT_ASM_ENDIAN #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN) @@ -628,8 +634,9 @@ extern int dot_symbols; #define POWERPC_LINUX /* 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 /* Static stack checking is supported by means of probes. */ -- 2.21.0