From 42327ee328b50eecf1ae6fc48d201d36e3063ad585311018628f626ad00789c8 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Tue, 25 Jul 2023 08:41:19 +0000 Subject: [PATCH] Accepting request 1100331 from home:Andreas_Schwab:Factory - riscv64-support-for-execstack.patch: Add support for riscv64 - Add-PL_ARCH-for-AArch64.patch: Fix typo OBS-URL: https://build.opensuse.org/request/show/1100331 OBS-URL: https://build.opensuse.org/package/show/devel:tools/execstack?expand=0&rev=6 --- Add-PL_ARCH-for-AArch64.patch | 2 +- execstack.changes | 6 +++ execstack.spec | 4 +- riscv64-support-for-execstack.patch | 68 +++++++++++++++++++++++++++++ 4 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 riscv64-support-for-execstack.patch diff --git a/Add-PL_ARCH-for-AArch64.patch b/Add-PL_ARCH-for-AArch64.patch index 7233b68..bfad227 100644 --- a/Add-PL_ARCH-for-AArch64.patch +++ b/Add-PL_ARCH-for-AArch64.patch @@ -65,7 +65,7 @@ index 85cf84577f..863dc835a0 100644 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-alpha.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-arm.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-arch64.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-aarch64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-i386.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-ia64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-mips.Po@am__quote@ diff --git a/execstack.changes b/execstack.changes index f6281ce..8a79690 100644 --- a/execstack.changes +++ b/execstack.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jul 24 08:24:27 UTC 2023 - Andreas Schwab + +- riscv64-support-for-execstack.patch: Add support for riscv64 +- Add-PL_ARCH-for-AArch64.patch: Fix typo + ------------------------------------------------------------------- Fri Dec 3 07:34:40 UTC 2021 - Dominik Gedon diff --git a/execstack.spec b/execstack.spec index d600033..201df2f 100644 --- a/execstack.spec +++ b/execstack.spec @@ -1,7 +1,7 @@ # # spec file for package execstack # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2023 SUSE LLC # 2014 Wolfgang Rosenauer # # All modifications and additions to the file contributed by third parties @@ -37,6 +37,7 @@ Patch0: Add-PL_ARCH-for-AArch64.patch Patch1: prelink_update_fsf_address.patch # bypass where gcc linker do not add the GNU_STACK default header in elf file Patch2: prelink_add_no_execstack_for_ppc64.patch +Patch3: riscv64-support-for-execstack.patch BuildRequires: git BuildRequires: libelf-devel @@ -63,6 +64,7 @@ with or without executable stack. %ifarch ppc64 %patch2 -p1 %endif +%patch3 -p1 %build sed -i -e '/^prelink_LDADD/s/$/ -lpthread/' src/Makefile.{am,in} diff --git a/riscv64-support-for-execstack.patch b/riscv64-support-for-execstack.patch new file mode 100644 index 0000000..150184c --- /dev/null +++ b/riscv64-support-for-execstack.patch @@ -0,0 +1,68 @@ +Index: prelink-4c79120bcdbde0616f592458ccde7035e92ca3d8/src/Makefile.am +=================================================================== +--- prelink-4c79120bcdbde0616f592458ccde7035e92ca3d8.orig/src/Makefile.am ++++ prelink-4c79120bcdbde0616f592458ccde7035e92ca3d8/src/Makefile.am +@@ -13,7 +13,7 @@ bin_PROGRAMS = execstack + arch_SOURCES = arch-i386.c arch-alpha.c arch-ppc.c arch-ppc64.c \ + arch-sparc.c arch-sparc64.c arch-x86_64.c arch-mips.c \ + arch-s390.c arch-s390x.c arch-arm.c arch-sh.c arch-ia64.c \ +- arch-aarch64.c ++ arch-aarch64.c arch-riscv64.c + common_SOURCES = checksum.c data.c dso.c dwarf2.c dwarf2.h fptr.c fptr.h \ + hashtab.c hashtab.h mdebug.c prelink.h stabs.c crc32.c + prelink_SOURCES = cache.c conflict.c cxx.c doit.c exec.c execle_open.c get.c \ +Index: prelink-4c79120bcdbde0616f592458ccde7035e92ca3d8/src/Makefile.in +=================================================================== +--- prelink-4c79120bcdbde0616f592458ccde7035e92ca3d8.orig/src/Makefile.in ++++ prelink-4c79120bcdbde0616f592458ccde7035e92ca3d8/src/Makefile.in +@@ -108,7 +108,7 @@ bin_PROGRAMS = execstack + arch_SOURCES = arch-i386.c arch-alpha.c arch-ppc.c arch-ppc64.c \ + arch-sparc.c arch-sparc64.c arch-x86_64.c arch-mips.c \ + arch-s390.c arch-s390x.c arch-arm.c arch-sh.c arch-ia64.c \ +- arch-aarch64.c ++ arch-aarch64.c arch-riscv64.c + + common_SOURCES = checksum.c data.c dso.c dwarf2.c dwarf2.h fptr.c fptr.h \ + hashtab.c hashtab.h mdebug.c prelink.h stabs.c crc32.c +@@ -141,7 +141,7 @@ am__objects_2 = arch-i386.$(OBJEXT) arch + arch-sparc64.$(OBJEXT) arch-x86_64.$(OBJEXT) \ + arch-mips.$(OBJEXT) arch-s390.$(OBJEXT) arch-s390x.$(OBJEXT) \ + arch-arm.$(OBJEXT) arch-sh.$(OBJEXT) arch-ia64.$(OBJEXT) \ +- arch-aarch64.$(OBJEXT) ++ arch-aarch64.$(OBJEXT) arch-riscv64.$(OBJEXT) + am_execstack_OBJECTS = execstack.$(OBJEXT) $(am__objects_1) \ + $(am__objects_2) + execstack_OBJECTS = $(am_execstack_OBJECTS) +@@ -167,6 +167,7 @@ am__depfiles_maybe = depfiles + @AMDEP_TRUE@ ./$(DEPDIR)/arch-arm.Po ./$(DEPDIR)/arch-aarch64.Po ./$(DEPDIR)/arch-i386.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/arch-ia64.Po ./$(DEPDIR)/arch-mips.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/arch-ppc.Po ./$(DEPDIR)/arch-ppc64.Po \ ++@AMDEP_TRUE@ ./$(DEPDIR)/arch-riscv64.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/arch-s390.Po ./$(DEPDIR)/arch-s390x.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/arch-sh.Po ./$(DEPDIR)/arch-sparc.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/arch-sparc64.Po \ +@@ -285,6 +286,7 @@ distclean-compile: + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-mips.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-ppc.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-ppc64.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-riscv64.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-s390.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-s390x.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-sh.Po@am__quote@ +Index: prelink-4c79120bcdbde0616f592458ccde7035e92ca3d8/src/arch-riscv64.c +=================================================================== +--- /dev/null ++++ prelink-4c79120bcdbde0616f592458ccde7035e92ca3d8/src/arch-riscv64.c +@@ -0,0 +1,12 @@ ++#include ++ ++#include "prelink.h" ++ ++PL_ARCH = { ++ .name = "RISCV64", ++ .class = ELFCLASS64, ++ .machine = EM_RISCV, ++ .alternate_machine = { EM_NONE }, ++ .max_page_size = 0x1000, ++ .page_size = 0x1000 ++};