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