Subject: [alpine-aports] [PATCH] Add support for ppc64le

From: Breno Leitao <[email-masked]>
Date: Tue, 17 Jan 2017 14:30:31 -0200

This is a patch that adds support for ppc64le platform.  Currently, musl fails
to build with long double as 128-bits, because POWER does not implement IEEE
long double but IBM long double which causes the following error:

unsupported long double type musl

This patch just turns "long double" into "double" for ppc64le.
---
 main/musl/APKBUILD | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/main/musl/APKBUILD b/main/musl/APKBUILD
index d2f3a82..2631ebb 100644
--- a/main/musl/APKBUILD
+++ b/main/musl/APKBUILD
@@ -39,6 +39,7 @@ install_sysroot_headers() {
 	case "$CARCH" in
 	aarch64*) ARCH="aarch64" ;;
 	arm*) ARCH="arm" ;;
+	ppc64*) ARCH="powerpc64" ;;
 	x86) ARCH="i386" ;;
 	x86_64) ARCH="x86_64" ;;
 	mips*) ARCH="mips" ;;
@@ -49,6 +50,11 @@ install_sysroot_headers() {
 build() {
 	cd "$builddir"
 
+	# Consider "long double" 64-bits wide on Power
+	if [ $CARCH == "ppc64le" ]; then
+		CFLAGS="$CFLAGS -mlong-double-64"
+	fi
+
 	# provide minimal libssp_nonshared.a so we don't need libssp from gcc
 	${CROSS_COMPILE}gcc $CPPFLAGS $CFLAGS -c "$srcdir"/__stack_chk_fail_local.c -o __stack_chk_fail_local.o || return 1
 	${CROSS_COMPILE}ar r libssp_nonshared.a __stack_chk_fail_local.o || return 1
-- 
2.7.4

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---