summaryrefslogtreecommitdiff
path: root/sys-libs/libhugetlbfs/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-libs/libhugetlbfs/files
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-libs/libhugetlbfs/files')
-rw-r--r--sys-libs/libhugetlbfs/files/libhugetlbfs-2.20-noexec-stack.patch135
-rw-r--r--sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-fixup-testsuite.patch31
-rw-r--r--sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-noexec-stack.patch44
-rw-r--r--sys-libs/libhugetlbfs/files/libhugetlbfs-2.9-build.patch31
4 files changed, 241 insertions, 0 deletions
diff --git a/sys-libs/libhugetlbfs/files/libhugetlbfs-2.20-noexec-stack.patch b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.20-noexec-stack.patch
new file mode 100644
index 000000000000..04c8baee37b8
--- /dev/null
+++ b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.20-noexec-stack.patch
@@ -0,0 +1,135 @@
+https://github.com/libhugetlbfs/libhugetlbfs/pull/9
+
+From 1c41d751d57a598919c40ab9c27514a98da93273 Mon Sep 17 00:00:00 2001
+From: "Robin H. Johnson" <robbat2@gentoo.org>
+Date: Sat, 31 Oct 2009 07:59:57 +0000
+Subject: [PATCH] set noexec markers in the asm file directly
+
+Using -Wl,-z,noexecstack can hide real exec stack issues coming from other
+files, and is a bit unportable. Instead, set proper section markers in the
+assembly files directly. It also means people using the static libraries
+won't have to use -Wl,-z,noexecstack when they link their code.
+---
+ Makefile | 2 +-
+ sys-aarch64elf.S | 4 ++++
+ sys-armelf_linux_eabi.S | 4 ++++
+ sys-elf32ppclinux.S | 4 ++++
+ sys-elf64_s390.S | 4 ++++
+ sys-elf64ppc.S | 4 ++++
+ sys-elf_i386.S | 4 ++++
+ sys-elf_s390.S | 4 ++++
+ sys-elf_x86_64.S | 4 ++++
+ 9 files changed, 33 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 73ebad7..ca987d9 100644
+--- a/Makefile
++++ b/Makefile
+@@ -27,7 +27,7 @@ NODEPTARGETS=<version.h> <clean>
+
+ INSTALL = install
+
+-LDFLAGS += -Wl,-z,noexecstack -ldl
++LDFLAGS += -ldl
+ CFLAGS ?= -O2 -g
+ CFLAGS += -Wall -fPIC
+ CPPFLAGS += -D__LIBHUGETLBFS__
+diff --git a/sys-aarch64elf.S b/sys-aarch64elf.S
+index 54799d3..210558b 100644
+--- a/sys-aarch64elf.S
++++ b/sys-aarch64elf.S
+@@ -32,3 +32,7 @@ direct_syscall:
+ mov x6, x7
+ svc 0x0
+ ret
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+diff --git a/sys-armelf_linux_eabi.S b/sys-armelf_linux_eabi.S
+index dfa7407..265b75d 100644
+--- a/sys-armelf_linux_eabi.S
++++ b/sys-armelf_linux_eabi.S
+@@ -31,3 +31,7 @@ direct_syscall:
+ swi 0x0
+ ldmfd sp!, {r4, r5, r6, r7}
+ bx lr
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+diff --git a/sys-elf32ppclinux.S b/sys-elf32ppclinux.S
+index 65d8b3f..6ba3f22 100644
+--- a/sys-elf32ppclinux.S
++++ b/sys-elf32ppclinux.S
+@@ -32,3 +32,7 @@ direct_syscall:
+ mr 8,9
+ sc
+ blr
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+diff --git a/sys-elf64_s390.S b/sys-elf64_s390.S
+index 425a387..5c31899 100644
+--- a/sys-elf64_s390.S
++++ b/sys-elf64_s390.S
+@@ -20,3 +20,7 @@ direct_syscall:
+ lgr %r5,%r6
+ svc 0
+ br %r14
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+diff --git a/sys-elf64ppc.S b/sys-elf64ppc.S
+index d50f4a6..b57a345 100644
+--- a/sys-elf64ppc.S
++++ b/sys-elf64ppc.S
+@@ -46,3 +46,7 @@ direct_syscall:
+ mr 8,9
+ sc
+ blr
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+diff --git a/sys-elf_i386.S b/sys-elf_i386.S
+index ab30c8d..6182b3d 100644
+--- a/sys-elf_i386.S
++++ b/sys-elf_i386.S
+@@ -40,3 +40,7 @@ direct_syscall:
+ pop %edi
+ pop %ebp
+ ret
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+diff --git a/sys-elf_s390.S b/sys-elf_s390.S
+index 40630d1..e6a9a96 100644
+--- a/sys-elf_s390.S
++++ b/sys-elf_s390.S
+@@ -20,3 +20,7 @@ direct_syscall:
+ lr %r5,%r6
+ svc 0
+ br %r14
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+diff --git a/sys-elf_x86_64.S b/sys-elf_x86_64.S
+index 6af06ad..561f49b 100644
+--- a/sys-elf_x86_64.S
++++ b/sys-elf_x86_64.S
+@@ -32,3 +32,7 @@ direct_syscall:
+ mov 0x8(%rsp),%r9
+ syscall
+ retq
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+--
+2.6.2
+
diff --git a/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-fixup-testsuite.patch b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-fixup-testsuite.patch
new file mode 100644
index 000000000000..12548a884a6f
--- /dev/null
+++ b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-fixup-testsuite.patch
@@ -0,0 +1,31 @@
+diff -Nuar --exclude '*.S' --exclude Makefile libhugetlbfs-2.6.orig/tests/run_tests.py libhugetlbfs-2.6/tests/run_tests.py
+--- libhugetlbfs-2.6.orig/tests/run_tests.py 2009-08-24 05:56:07.000000000 -0700
++++ libhugetlbfs-2.6/tests/run_tests.py 2009-10-31 00:40:28.520387427 -0700
+@@ -56,6 +56,11 @@
+ local_env["LD_LIBRARY_PATH"] = "../obj%d:obj%d:%s" \
+ % (bits, bits, local_env.get("LD_LIBRARY_PATH", ""))
+ local_env["HUGETLB_DEFAULT_PAGE_SIZE"] = repr(pagesize)
++ if isinstance(cmd, types.StringType):
++ cmd = 'obj%d/%s' % (bits, cmd)
++ else:
++ s = 'obj%d/%s' % (bits, cmd[0])
++ cmd = (s,)+(cmd[1:])
+
+ p = subprocess.Popen(cmd, env=local_env, stdout=subprocess.PIPE)
+ try:
+@@ -523,10 +528,11 @@
+ elfshare_test("linkshare")
+ elflink_and_share_test("linkhuge")
+
+- # elflink_rw tests
+- elflink_rw_test("linkhuge_rw")
+- # elflink_rw sharing tests
+- elflink_rw_and_share_test("linkhuge_rw")
++ if 32 in wordsizes:
++ # elflink_rw tests
++ elflink_rw_test("linkhuge_rw")
++ # elflink_rw sharing tests
++ elflink_rw_and_share_test("linkhuge_rw")
+
+ # Accounting bug tests
+ # reset free hpages because sharing will have held some
diff --git a/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-noexec-stack.patch b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-noexec-stack.patch
new file mode 100644
index 000000000000..bf964cda7a68
--- /dev/null
+++ b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-noexec-stack.patch
@@ -0,0 +1,44 @@
+diff -Nuar libhugetlbfs-2.6.orig/sys-elf32ppclinux.S libhugetlbfs-2.6/sys-elf32ppclinux.S
+--- libhugetlbfs-2.6.orig/sys-elf32ppclinux.S 2009-08-24 12:56:07.000000000 +0000
++++ libhugetlbfs-2.6/sys-elf32ppclinux.S 2009-10-31 06:43:49.040319417 +0000
+@@ -32,3 +32,7 @@
+ mr 8,9
+ sc
+ blr
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+diff -Nuar libhugetlbfs-2.6.orig/sys-elf64ppc.S libhugetlbfs-2.6/sys-elf64ppc.S
+--- libhugetlbfs-2.6.orig/sys-elf64ppc.S 2009-08-24 12:56:07.000000000 +0000
++++ libhugetlbfs-2.6/sys-elf64ppc.S 2009-10-31 06:43:54.303652251 +0000
+@@ -41,3 +41,7 @@
+ mr 8,9
+ sc
+ blr
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+diff -Nuar libhugetlbfs-2.6.orig/sys-elf_i386.S libhugetlbfs-2.6/sys-elf_i386.S
+--- libhugetlbfs-2.6.orig/sys-elf_i386.S 2009-08-24 12:56:07.000000000 +0000
++++ libhugetlbfs-2.6/sys-elf_i386.S 2009-10-31 06:43:57.536975670 +0000
+@@ -40,3 +40,7 @@
+ pop %edi
+ pop %ebp
+ ret
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
+diff -Nuar libhugetlbfs-2.6.orig/sys-elf_x86_64.S libhugetlbfs-2.6/sys-elf_x86_64.S
+--- libhugetlbfs-2.6.orig/sys-elf_x86_64.S 2009-08-24 12:56:07.000000000 +0000
++++ libhugetlbfs-2.6/sys-elf_x86_64.S 2009-10-31 06:44:26.943648847 +0000
+@@ -32,3 +32,7 @@
+ mov 0x8(%rsp),%r9
+ syscall
+ retq
++
++#if defined(__linux__) && defined(__ELF__)
++ .section .note.GNU-stack,"",%progbits
++#endif
diff --git a/sys-libs/libhugetlbfs/files/libhugetlbfs-2.9-build.patch b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.9-build.patch
new file mode 100644
index 000000000000..827e2a58d101
--- /dev/null
+++ b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.9-build.patch
@@ -0,0 +1,31 @@
+--- Makefile.orig 2010-08-13 20:14:18.000000000 -0400
++++ Makefile 2010-08-13 20:14:42.000000000 -0400
+@@ -314,24 +314,24 @@
+ $(BIN_OBJ_DIR)/hugectl: $(BIN_OBJ_DIR)/hugectl.o
+ @$(VECHO) LDHOST $@
+ mkdir -p $(BIN_OBJ_DIR)
+- $(CCBIN) $(CPPFLAGS) $(CFLAGS) -o $@ $^
++ $(CCBIN) $(CPPFLAGS) $(CFLAGS) -o $@ $^ $(LDFLAGS)
+
+ $(BIN_OBJ_DIR)/hugeedit: $(BIN_OBJ_DIR)/hugeedit.o
+ @$(VECHO) LDHOST $@
+ mkdir -p $(BIN_OBJ_DIR)
+- $(CCBIN) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ $^
++ $(CCBIN) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ $^ $(LDFLAGS)
+
+ HUGEADM_OBJ=hugeadm.o libhugetlbfs_privutils.a
+ $(BIN_OBJ_DIR)/hugeadm: $(foreach file,$(HUGEADM_OBJ),$(BIN_OBJ_DIR)/$(file))
+ @$(VECHO) LDHOST $@
+ mkdir -p $(BIN_OBJ_DIR)
+- $(CCBIN) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ $^
++ $(CCBIN) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ $^ $(LDFLAGS)
+
+ PAGESIZE_OBJ=pagesize.o libhugetlbfs_privutils.a
+ $(BIN_OBJ_DIR)/pagesize: $(foreach file,$(PAGESIZE_OBJ),$(BIN_OBJ_DIR)/$(file))
+ @$(VECHO) LDHOST $@
+ mkdir -p $(BIN_OBJ_DIR)
+- $(CCBIN) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ $^
++ $(CCBIN) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ $^ $(LDFLAGS)
+
+ clean:
+ @$(VECHO) CLEAN