Compare commits

..

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
c76aa44212
!14 Add riscv64 support
From: @a-xiang-and-shanhaijing 
Reviewed-by: @jxy_git 
Signed-off-by: @jxy_git
2023-07-14 05:32:53 +00:00
zhangxiang
76de86824a add riscv support 2023-07-14 11:49:23 +08:00
openeuler-ci-bot
e4cb86d4a1
!13 add loongarch64 support
From: @dpdwaj 
Reviewed-by: @jxy_git 
Signed-off-by: @jxy_git
2023-02-20 01:23:15 +00:00
doupengda
b8c43444e6 add loongarch64 support 2023-02-01 10:26:12 +08:00
openeuler-ci-bot
2b7ca866f6
!10 Add url field
From: @jxy_git 
Reviewed-by: @yangzhao_kl 
Signed-off-by: @yangzhao_kl
2022-03-30 08:39:40 +00:00
jxy_git
ebe21005c6 Add url field 2022-03-30 16:31:07 +08:00
openeuler-ci-bot
bffb13757e
!8 [sync] PR-7: Add BuildRequires: gcc-c++ solves build error
From: @openeuler-sync-bot 
Reviewed-by: @yangzhao_kl 
Signed-off-by: @yangzhao_kl
2022-02-18 01:20:56 +00:00
jxy_git
35cce7133c Add BuildRequires: gcc-c++ solves build error
(cherry picked from commit 631a9ffbed8a3e2c54595e18491bc93c5b458818)
2022-02-18 09:10:45 +08:00
openeuler-ci-bot
c7217404b5 !5 execstack delete -Sgit from %autosetup, and delete BuildRequires git
From: @chenyanpanHW
Reviewed-by: @yangzhao_kl
Signed-off-by: @yangzhao_kl
2021-07-31 02:50:35 +00:00
chenyanpanHW
a7332f8c1b
delete -Sgit from %autosetup, and delete BuildRequires git 2021-07-30 22:36:53 +08:00
4 changed files with 235 additions and 18 deletions

View File

@ -0,0 +1,111 @@
From 0724f0be79e86590eca267a2e1f4d22d2962d837 Mon Sep 17 00:00:00 2001
From: doupengda <doupengda@loongson.cn>
Date: Wed, 1 Feb 2023 10:15:40 +0800
Subject: [PATCH] add loongarch64 support
---
src/Makefile.am | 2 +-
src/Makefile.in | 7 ++++---
src/arch-loongarch64.c | 38 ++++++++++++++++++++++++++++++++++++++
3 files changed, 43 insertions(+), 4 deletions(-)
create mode 100644 src/arch-loongarch64.c
diff --git a/src/Makefile.am b/src/Makefile.am
index a4c65f2..c18d0fd 100644
--- a/src/Makefile.am
+++ b/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-loongarch64.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 \
diff --git a/src/Makefile.in b/src/Makefile.in
index 863dc83..7a70b68 100644
--- a/src/Makefile.in
+++ b/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-loongarch64.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-alpha.$(OBJEXT) \
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-loongarch64.$(OBJEXT)
am_execstack_OBJECTS = execstack.$(OBJEXT) $(am__objects_1) \
$(am__objects_2)
execstack_OBJECTS = $(am_execstack_OBJECTS)
@@ -165,7 +165,7 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/arch-alpha.Po \
@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-ia64.Po ./$(DEPDIR)/arch-mips.Po ./$(DEPDIR)/arch-loongarch64.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/arch-ppc.Po ./$(DEPDIR)/arch-ppc64.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/arch-s390.Po ./$(DEPDIR)/arch-s390x.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/arch-sh.Po ./$(DEPDIR)/arch-sparc.Po \
@@ -283,6 +283,7 @@ distclean-compile:
@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@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-loongarch64.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-s390.Po@am__quote@
diff --git a/src/arch-loongarch64.c b/src/arch-loongarch64.c
new file mode 100644
index 0000000..fcb1951
--- /dev/null
+++ b/src/arch-loongarch64.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 2015 Red Hat, Inc.
+ Written by Mark Salter <msalter@redhat.com>, 2015.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include <config.h>
+#include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <locale.h>
+#include <error.h>
+#include <argp.h>
+#include <stdlib.h>
+
+#include "prelink.h"
+
+PL_ARCH = {
+ .name = "loongarch64",
+ .class = ELFCLASS64,
+ .machine = EM_LOONGARCH,
+ .alternate_machine = { EM_NONE },
+ .max_page_size = 0x10000,
+ .page_size = 0x1000
+};
--
2.33.0

View File

@ -0,0 +1,84 @@
diff -ur --new-file a/src/arch-riscv64.c b/src/arch-riscv64.c
--- a/src/arch-riscv64.c 1970-01-01 08:00:00.000000000 +0800
+++ b/src/arch-riscv64.c 2023-07-14 11:47:42.087234973 +0800
@@ -0,0 +1,38 @@
+/* Copyright (C) 2015 Red Hat, Inc.
+ Written by Mark Salter <msalter@redhat.com>, 2015.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include <config.h>
+#include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <locale.h>
+#include <error.h>
+#include <argp.h>
+#include <stdlib.h>
+
+#include "prelink.h"
+
+PL_ARCH = {
+ .name = "riscv64",
+ .class = ELFCLASS64,
+ .machine = EM_RISCV,
+ .alternate_machine = { EM_NONE },
+ .max_page_size = 0x10000,
+ .page_size = 0x1000
+};
diff -ur --new-file a/src/Makefile.am b/src/Makefile.am
--- a/src/Makefile.am 2023-07-14 11:45:01.722930150 +0800
+++ b/src/Makefile.am 2023-07-14 11:46:04.135040698 +0800
@@ -13,7 +13,7 @@
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-loongarch64.c
+ arch-aarch64.c arch-loongarch64.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 \
diff -ur --new-file a/src/Makefile.in b/src/Makefile.in
--- a/src/Makefile.in 2023-07-14 11:45:01.722930150 +0800
+++ b/src/Makefile.in 2023-07-14 11:46:58.687147261 +0800
@@ -108,7 +108,7 @@
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-loongarch64.c
+ arch-aarch64.c arch-loongarch64.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 @@
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-loongarch64.$(OBJEXT)
+ arch-aarch64.$(OBJEXT) arch-loongarch64.$(OBJEXT) arch-riscv64.$(OBJEXT)
am_execstack_OBJECTS = execstack.$(OBJEXT) $(am__objects_1) \
$(am__objects_2)
execstack_OBJECTS = $(am_execstack_OBJECTS)
@@ -164,7 +164,7 @@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/arch-alpha.Po \
-@AMDEP_TRUE@ ./$(DEPDIR)/arch-arm.Po ./$(DEPDIR)/arch-aarch64.Po ./$(DEPDIR)/arch-i386.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/arch-arm.Po ./$(DEPDIR)/arch-aarch64.Po ./$(DEPDIR)/arch-i386.Po ./$(DEPDIR)/arch-riscv64.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/arch-ia64.Po ./$(DEPDIR)/arch-mips.Po ./$(DEPDIR)/arch-loongarch64.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/arch-ppc.Po ./$(DEPDIR)/arch-ppc64.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/arch-s390.Po ./$(DEPDIR)/arch-s390x.Po \

View File

@ -1,25 +1,27 @@
Name: execstack
Version: 0.5.0
Release: 15%{?dist}
Summary: Utility to set/clear/query executable stack bit
%global commit 4c79120bcdbde0616f592458ccde7035e92ca3d8 %global commit 4c79120bcdbde0616f592458ccde7035e92ca3d8
%global shortcommit %(c=%{commit}; echo ${c:0:7}) %global shortcommit %(c=%{commit}; echo ${c:0:7})
License: GPLv2+ Name: execstack
# work around for missing upstream tarball with latest checkin Version: 0.5.0
Source0: https://github.com/keszybz/prelink/archive/%{commit}.tar.gz#/prelink-%{shortcommit}.tar.gz Release: 20
Summary: Utility to set/clear/query executable stack bit
URL: https://github.com/keszybz/prelink
License: GPLv2+
Patch0: Add-PL_ARCH-for-AArch64.patch Source0: https://github.com/keszybz/prelink/archive/%{commit}.tar.gz#/prelink-%{shortcommit}.tar.gz
Patch1: coverity.patch
BuildRequires: elfutils-libelf-devel Patch0: Add-PL_ARCH-for-AArch64.patch
BuildRequires: libselinux-devel, libselinux-utils Patch1: coverity.patch
BuildRequires: git Patch2: 0001-add-loongarch64-support.patch
Requires: glibc >= 2.2.4-18, coreutils, findutils Patch3: 0002-add-riscv-support.patch
Requires: util-linux, gawk, grep
Obsoletes: prelink < 0.5.0-8 BuildRequires: elfutils-libelf-devel
BuildRequires: libselinux-devel, libselinux-utils
BuildRequires: gcc-c++
Requires: glibc >= 2.2.4-18, coreutils, findutils
Requires: util-linux, gawk, grep
Obsoletes: prelink < 0.5.0-8
%description %description
This package is built from prelink sources but contains just the This package is built from prelink sources but contains just the
@ -27,7 +29,7 @@ execstack binary. It can be used manipulate ELF binaries to run
with or without executable stack. with or without executable stack.
%prep %prep
%autosetup -n prelink-%{commit} -p1 -Sgit %autosetup -n prelink-%{commit} -p1
%build %build
sed -i -e '/^prelink_LDADD/s/$/ -lpthread/' src/Makefile.{am,in} sed -i -e '/^prelink_LDADD/s/$/ -lpthread/' src/Makefile.{am,in}
@ -56,5 +58,20 @@ install -Dm0644 doc/execstack.8 %{buildroot}%{_mandir}/man8/execstack.8
%{_mandir}/man8/execstack.8.* %{_mandir}/man8/execstack.8.*
%changelog %changelog
* Fri Jul 14 2023 zhangxiang <zhangxiang@iscas.ac.cn> - 0.5.0-20
- add riscv64 support
* Wed Feb 1 2023 doupengda <doupengda@loongson.cn> - 0.5.0-19
- add loongarch64 support
* Wed Mar 30 2022 jiangxinyu <jiangxinyu@kylinos.cn> - 0.5.0-18
- Add url field
* Fri Feb 11 2022 jiangxinyu <jiangxinyu@kylinos.cn> - 0.5.0-17
- Add BuildRequires: gcc-c++ solves build error
* Fri Jul 30 2021 chenyanpanHW <chenyanpan@huawei.com> - 0.5.0-16
- DESC: delete -Sgit from %autosetup, and delete BuildRequires git
* Fri Oct 30 2020 jiangxinyu <jiangxinyu@kylinos.cn> - 0.5.0-15 * Fri Oct 30 2020 jiangxinyu <jiangxinyu@kylinos.cn> - 0.5.0-15
- Init execstack project - Init execstack project

5
execstack.yaml Normal file
View File

@ -0,0 +1,5 @@
---
version_control: github
src_repo: keszybz/prelink
tag_prefix: ^v
separator: "."