Apply upstream PR 6946 to avoid linking private glibc symbol __mmap

Add build deps to run upstream autogen.pl
Remove embedded tabs in the spec
This commit is contained in:
Philip Kovacs 2019-08-30 16:40:36 -04:00
parent 7231dd36d0
commit 04d8899582
2 changed files with 110 additions and 52 deletions

46
6946.patch Normal file
View File

@ -0,0 +1,46 @@
From fbbacc1303f02b4c955975911b82e8755ea0721c Mon Sep 17 00:00:00 2001
From: Harumi Kuno <harumi.kuno@hpe.com>
Date: Tue, 30 Jul 2019 06:32:27 -0700
Subject: [PATCH] Fix mmap infinite recurse in memory patcher
This commit fixes issue #6853 by removing
MacOS/Darwin-specific logic from intercept_mmap.
Signed-off-by: Harumi Kuno <harumi.kuno@hpe.com>
---
opal/mca/memory/patcher/configure.m4 | 4 ----
opal/mca/memory/patcher/memory_patcher_component.c | 5 -----
2 files changed, 9 deletions(-)
diff --git a/opal/mca/memory/patcher/configure.m4 b/opal/mca/memory/patcher/configure.m4
index 6881ec69366..0c5d8553259 100644
--- a/opal/mca/memory/patcher/configure.m4
+++ b/opal/mca/memory/patcher/configure.m4
@@ -40,10 +40,6 @@ AC_DEFUN([MCA_opal_memory_patcher_CONFIG],[
AC_CHECK_HEADERS([linux/mman.h sys/syscall.h])
- AC_CHECK_DECLS([__mmap], [], [], [#include <sys/mman.h>])
-
- AC_CHECK_FUNCS([__mmap])
-
AC_CHECK_DECLS([__syscall], [], [], [#include <sys/syscall.h>])
AC_CHECK_FUNCS([__syscall])
diff --git a/opal/mca/memory/patcher/memory_patcher_component.c b/opal/mca/memory/patcher/memory_patcher_component.c
index 5db3a6016f8..687d430fa36 100644
--- a/opal/mca/memory/patcher/memory_patcher_component.c
+++ b/opal/mca/memory/patcher/memory_patcher_component.c
@@ -125,12 +125,7 @@ static void *_intercept_mmap(void *start, size_t length, int prot, int flags, in
}
if (!original_mmap) {
-#ifdef HAVE___MMAP
- /* the darwin syscall returns an int not a long so call the underlying __mmap function */
- result = __mmap (start, length, prot, flags, fd, offset);
-#else
result = (void*)(intptr_t) memory_patcher_syscall(SYS_mmap, start, length, prot, flags, fd, offset);
-#endif
} else {
result = original_mmap (start, length, prot, flags, fd, offset);
}

View File

@ -32,7 +32,7 @@
Name: openmpi%{?_cc_name_suffix} Name: openmpi%{?_cc_name_suffix}
Version: 4.0.2 Version: 4.0.2
Release: 0.1.rc1%{?dist} Release: 0.2.rc1%{?dist}
Summary: Open Message Passing Interface Summary: Open Message Passing Interface
License: BSD and MIT and Romio License: BSD and MIT and Romio
URL: http://www.open-mpi.org/ URL: http://www.open-mpi.org/
@ -43,9 +43,14 @@ Source1: openmpi.module.in
Source2: openmpi.pth.py2 Source2: openmpi.pth.py2
Source3: openmpi.pth.py3 Source3: openmpi.pth.py3
Source4: macros.openmpi Source4: macros.openmpi
# Upstream PR 6946 to avoid linking private glibc symbol __mmap
Patch0: https://patch-diff.githubusercontent.com/raw/open-mpi/ompi/pull/6946.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: gcc-gfortran BuildRequires: gcc-gfortran
BuildRequires: libtool
BuildRequires: valgrind-devel BuildRequires: valgrind-devel
%ifnarch %{arm} %ifnarch %{arm}
BuildRequires: opensm-devel > 3.3.0 BuildRequires: opensm-devel > 3.3.0
@ -69,6 +74,7 @@ BuildRequires: papi-devel
%endif %endif
BuildRequires: orangefs-devel BuildRequires: orangefs-devel
BuildRequires: perl-generators BuildRequires: perl-generators
BuildRequires: perl-interpreter
BuildRequires: perl(Getopt::Long) BuildRequires: perl(Getopt::Long)
BuildRequires: pmix-devel BuildRequires: pmix-devel
BuildRequires: python2 BuildRequires: python2
@ -169,6 +175,7 @@ OpenMPI support for Python 3.
%autosetup -p1 -n openmpi-%{version}rc1 %autosetup -p1 -n openmpi-%{version}rc1
%build %build
./autogen.pl --force
./configure --prefix=%{_libdir}/%{name} \ ./configure --prefix=%{_libdir}/%{name} \
--mandir=%{_mandir}/%{namearch} \ --mandir=%{_mandir}/%{namearch} \
--includedir=%{_includedir}/%{namearch} \ --includedir=%{_includedir}/%{namearch} \
@ -347,6 +354,11 @@ make check
%changelog %changelog
* Fri Aug 30 2019 Philip Kovacs <pkdevel@yahoo.com> - 4.0.2-0.2.rc1
- Apply upstream PR 6946 to avoid linking private glibc symbol __mmap
- Add build deps to run upstream autogen.pl
- Remove embedded tabs in the spec
* Thu Aug 29 2019 Philip Kovacs <pkdevel@yahoo.com> - 4.0.2-0.1.rc1 * Thu Aug 29 2019 Philip Kovacs <pkdevel@yahoo.com> - 4.0.2-0.1.rc1
- Update to 4.0.2rc1 - Update to 4.0.2rc1
- Closes bug #1746564 - Closes bug #1746564