Florian Weimer 2022-11-27 14:28:47 +01:00
parent a3381efaf2
commit 1c4d45e252
2 changed files with 93 additions and 1 deletions

87
papi-configure-c99.patch Normal file
View File

@ -0,0 +1,87 @@
Avoid implicit ints and implicit function declarations. This patch
needs to be upstreamed because it is custom, papi-specific autoconf
checks.
diff --git a/src/configure b/src/configure
index 78dab84107dc897e..99c8f63bd020d3df 100755
--- a/src/configure
+++ b/src/configure
@@ -4985,7 +4985,8 @@ $as_echo_n "checking for working gettid... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
- main() { pid_t a = gettid(); }
+ #include <unistd.h>
+ int main() { pid_t a = gettid(); }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
@@ -5002,7 +5003,8 @@ $as_echo_n "checking for working syscall(SYS_gettid)... " >&6; }
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/syscall.h>
- main() { pid_t a = syscall(SYS_gettid); }
+ #include <unistd.h>
+ int main() { pid_t a = syscall(SYS_gettid); }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
@@ -5080,7 +5082,7 @@ else
#include <stdio.h>
#include <time.h>
#include <syscall.h>
- main() {
+ int main() {
struct timespec t1, t2;
double seconds;
if (syscall(__NR_clock_gettime,CLOCK_REALTIME_HR,&t1) == -1) exit(1);
@@ -5115,7 +5117,7 @@ else
#include <stdio.h>
#include <time.h>
#include <syscall.h>
- main() {
+ int main() {
struct timespec t1, t2;
double seconds;
if (syscall(__NR_clock_gettime,CLOCK_REALTIME,&t1) == -1) exit(1);
diff --git a/src/configure.in b/src/configure.in
index efcbd59405ac42bc..686b489f10c86839 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -577,14 +577,16 @@ fi
AC_MSG_CHECKING(for working gettid)
AC_LINK_IFELSE([AC_LANG_SOURCE([#include <sys/types.h>
- main() { pid_t a = gettid(); }])],
+ #include <unistd.h>
+ int main() { pid_t a = gettid(); }])],
[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_GETTID, 1, [Full gettid function])],
[AC_MSG_RESULT(no)
AC_MSG_CHECKING(for working syscall(SYS_gettid))
AC_LINK_IFELSE([AC_LANG_SOURCE([#include <sys/types.h>
#include <sys/syscall.h>
- main() { pid_t a = syscall(SYS_gettid); }])],
+ #include <unistd.h>
+ int main() { pid_t a = syscall(SYS_gettid); }])],
[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_SYSCALL_GETTID, 1, [gettid syscall function])],
[AC_MSG_RESULT(no)]) ])
@@ -625,7 +627,7 @@ AC_ARG_WITH(walltimer,
#include <stdio.h>
#include <time.h>
#include <syscall.h>
- main() {
+ int main() {
struct timespec t1, t2;
double seconds;
if (syscall(__NR_clock_gettime,CLOCK_REALTIME_HR,&t1) == -1) exit(1);
@@ -646,7 +648,7 @@ AC_ARG_WITH(walltimer,
#include <stdio.h>
#include <time.h>
#include <syscall.h>
- main() {
+ int main() {
struct timespec t1, t2;
double seconds;
if (syscall(__NR_clock_gettime,CLOCK_REALTIME,&t1) == -1) exit(1);

View File

@ -11,13 +11,14 @@
Summary: Performance Application Programming Interface
Name: papi
Version: 7.0.0
Release: 1%{?dist}
Release: 2%{?dist}
License: BSD
Requires: papi-libs = %{version}-%{release}
URL: http://icl.cs.utk.edu/papi/
Source0: http://icl.cs.utk.edu/projects/papi/downloads/%{name}-%{version}.tar.gz
Patch1: papi-python3.patch
Patch5: papi-nostatic.patch
Patch6: papi-configure-c99.patch
BuildRequires: make
BuildRequires: autoconf
BuildRequires: doxygen
@ -87,6 +88,7 @@ the PAPI user-space libraries and interfaces.
%setup -q
%patch1 -p1 -b .python3
%patch5 -p1
%patch6 -p1
%build
@ -181,6 +183,9 @@ find %{buildroot} -type f -executable ! -iname "*.py" ! -iname "*.sh" | xargs ch
%endif
%changelog
* Sun Nov 27 2022 Florian Weimer <fweimer@redhat.com> - 7.0.0-2
- Port configure script to C99 (#2148723)
* Wed Nov 16 2022 William Cohen <wcohen@redhat.com> - 7.0.0-1
- Rebase to official papi-7.0.0.