Bug 1251165 - execstack arch issues in %check for aarch64
execstack arch issues in %check for aarch64
Product: Fedora
Classification: Fedora
Component: execstack (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Zbigniew Jędrzejewski-Szmek
Fedora Extras Quality Assurance
Depends On:
Blocks: ARM64/F-ExcludeArch-aarch64
  Show dependency treegraph
Reported: 2015-08-06 11:35 EDT by Peter Robinson
Modified: 2015-08-31 23:36 EDT (History)
3 users (show)

See Also:
Fixed In Version: 0.5.0-9.fc23
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-08-31 23:36:28 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch to add aarch64 bits (4.64 KB, application/mbox)
2015-08-21 12:16 EDT, Mark Salter
no flags Details

  None (edit)
Description Peter Robinson 2015-08-06 11:35:20 EDT
prelink never supported aarch64 but the exectstack bits should be just find and in fact they do build.

The issue is in %check where I suspect there's a left over arch specific reminiscefnce from prelink.

Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.jQFf6n
+ umask 022
+ cd /builddir/build/BUILD
+ cd prelink-4c79120bcdbde0616f592458ccde7035e92ca3d8
+ cp src/execstack test
+ src/execstack -q test
+ grep '^-'
src/execstack: "test"'s architecture is not supported
error: Bad exit status from /var/tmp/rpm-tmp.jQFf6n (%check)
    Bad exit status from /var/tmp/rpm-tmp.jQFf6n (%check)
RPM build errors:
Child return code was: 1

Full logs: http://arm.koji.fedoraproject.org/koji/taskinfo?taskID=3116673
Comment 1 Zbigniew Jędrzejewski-Szmek 2015-08-06 11:57:18 EDT
It's more complicated than that. dso->arch->max_page_size is used in execstack_set(). If aarch64 were to be supported, I think a copy of PL_ARCH should be added.

This is for amd64, the non-prelink bits:
  .name = "x86-64",
  .class = ELFCLASS64,
  .machine = EM_X86_64,
  .alternate_machine = { EM_NONE },
  .max_page_size = 0x200000,
  .page_size = 0x1000
Comment 2 Peter Robinson 2015-08-20 08:29:49 EDT
Was there a general consensus on this?
Comment 3 Zbigniew Jędrzejewski-Szmek 2015-08-20 09:11:02 EDT
General consensus on what? If you mean the solution proposed in comment #c1, then no, it was only my own opinion. I'm fine with whatever solution, but it would be best if someone from the aarch64 side would implement and test the change. I have very little idea about that architecture.
Comment 4 Peter Robinson 2015-08-20 09:42:29 EDT
Consensus on what the fix is, whether it's c1 or something else. Do I need to get people from the ARM team engaged etc
Comment 5 Zbigniew Jędrzejewski-Szmek 2015-08-20 11:08:21 EDT
The entirety of the discussion is in this ticket.
Comment 6 Mark Salter 2015-08-21 12:16:26 EDT
Created attachment 1065637 [details]
Patch to add aarch64 bits

The attached patch adds enough PL_ARCH bits for aarch64 to make execstack happy. With it and this specfile tweak, aarch64 passes %check.

diff --git a/execstack.spec b/execstack.spec
index d5cb294..0c16560 100644
--- a/execstack.spec
+++ b/execstack.spec
@@ -11,6 +11,8 @@ License: GPLv2+
 # work around for missing upstream tarball with latest checkin
 Source0: https://github.com/keszybz/prelink/archive/%{commit}.tar.gz#/prelink-%{shortcommit}.tar.gz
+Patch0: Add-PL_ARCH-for-AArch64.patch
 BuildRequires: elfutils-libelf-devel
 BuildRequires: libselinux-devel, libselinux-utils
 Requires: glibc >= 2.2.4-18, coreutils, findutils
@@ -24,7 +26,7 @@ execstack binary. It can be used manipulate ELF binaries to run
 with or without executable stack.
-%autosetup -n prelink-%{commit}
+%autosetup -n prelink-%{commit} -p1
 sed -i -e '/^prelink_LDADD/s/$/ -lpthread/' src/Makefile.{am,in}
Comment 7 Fedora Update System 2015-08-21 13:02:59 EDT
execstack-0.5.0-9.fc23 has been submitted as an update to Fedora 23. https://bugzilla.redhat.com/show_bug.cgi?id=1251165
Comment 8 Fedora Update System 2015-08-22 12:24:25 EDT
execstack-0.5.0-9.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update execstack'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-13930
Comment 9 Fedora Update System 2015-08-31 23:36:26 EDT
execstack-0.5.0-9.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.