Blame SOURCES/libhugetlbfs-2.16-ppc64le-support.patch

f4a552
Backport of https://www.mail-archive.com/libhugetlbfs-devel@lists.sourceforge.net/msg13914.html
f4a552
f4a552
--
f4a552
diff --git a/Makefile b/Makefile
f4a552
index 9500fd5..fab7607 100644
f4a552
--- a/Makefile
f4a552
+++ b/Makefile
f4a552
@@ -46,6 +46,12 @@ CC32 = gcc -m32
f4a552
 ELF32 = elf32ppclinux
f4a552
 endif
f4a552
 else
f4a552
+ifeq ($(ARCH),ppc64le)
f4a552
+CC64 = $(CC) -m64
f4a552
+ELF64 = elf64lppc
f4a552
+TMPLIB64 = lib64
f4a552
+CUSTOM_LDSCRIPTS = no
f4a552
+else
f4a552
 ifeq ($(ARCH),ppc)
f4a552
 CC32 = gcc -m32
f4a552
 ELF32 = elf32ppclinux
f4a552
@@ -117,6 +123,7 @@ endif
f4a552
 endif
f4a552
 endif
f4a552
 endif
f4a552
+endif
f4a552
 
f4a552
 ifdef CC32
f4a552
 OBJDIRS += obj32
f4a552
diff --git a/contrib/tlbmiss_cost.sh b/contrib/tlbmiss_cost.sh
f4a552
index 1f1e234..8fbf798 100755
f4a552
--- a/contrib/tlbmiss_cost.sh
f4a552
+++ b/contrib/tlbmiss_cost.sh
f4a552
@@ -44,7 +44,7 @@ cpumhz() {
f4a552
 	FNAME="cpu MHz"
f4a552
 	FINDEX=4
f4a552
 	case "`uname -m`" in
f4a552
-		ppc64)
f4a552
+		ppc64|ppc64le)
f4a552
 			FNAME="clock"
f4a552
 			FINDEX=3
f4a552
 			;;
f4a552
diff --git a/ld.hugetlbfs b/ld.hugetlbfs
f4a552
index ba9e00a..df446dd 100755
f4a552
--- a/ld.hugetlbfs
f4a552
+++ b/ld.hugetlbfs
f4a552
@@ -84,6 +84,7 @@ fi
f4a552
 MB=$((1024*1024))
f4a552
 case "$EMU" in
f4a552
 elf32ppclinux|elf64ppc)	HPAGE_SIZE=$((16*$MB)) SLICE_SIZE=$((256*$MB)) ;;
f4a552
+elf64lppc)		HPAGE_SIZE=$((16*$MB)) SLICE_SIZE=$((256*$MB)) ;;
f4a552
 elf_i386|elf_x86_64)	HPAGE_SIZE=$((4*$MB)) SLICE_SIZE=$HPAGE_SIZE ;;
f4a552
 elf_s390|elf64_s390)	HPAGE_SIZE=$((1*$MB)) SLICE_SIZE=$HPAGE_SIZE ;;
f4a552
 armelf_linux_eabi|aarch64elf)	HPAGE_SIZE=$((2*MB)) SLICE_SIZE=$HPAGE_SIZE ;;
f4a552
diff --git a/sys-elf64ppc.S b/sys-elf64ppc.S
f4a552
index 1b63ff0..d50f4a6 100644
f4a552
--- a/sys-elf64ppc.S
f4a552
+++ b/sys-elf64ppc.S
f4a552
@@ -20,7 +20,7 @@
f4a552
  */
f4a552
 
f4a552
 	.text
f4a552
-
f4a552
+#if _CALL_ELF != 2
f4a552
 	.align	2
f4a552
 	.globl	direct_syscall
f4a552
 	.globl	.direct_syscall
f4a552
@@ -32,6 +32,11 @@ direct_syscall:
f4a552
 	.previous
f4a552
 	.type	.direct_syscall,@function
f4a552
 .direct_syscall:
f4a552
+#else
f4a552
+	.globl	direct_syscall
f4a552
+	.type	direct_syscall,@function
f4a552
+direct_syscall:
f4a552
+#endif
f4a552
 	mr	0,3
f4a552
 	mr	3,4
f4a552
 	mr	4,5
f4a552
-- 
f4a552
1.8.3.1
f4a552