From 1c4d45e252ed86e11792b4aeb9903e96b7299be2 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Sun, 27 Nov 2022 14:28:47 +0100 Subject: [PATCH] Port configure script to C99 (#2148723) Related to: --- papi-configure-c99.patch | 87 ++++++++++++++++++++++++++++++++++++++++ papi.spec | 7 +++- 2 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 papi-configure-c99.patch diff --git a/papi-configure-c99.patch b/papi-configure-c99.patch new file mode 100644 index 0000000..d591964 --- /dev/null +++ b/papi-configure-c99.patch @@ -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 +- main() { pid_t a = gettid(); } ++ #include ++ 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 + #include +- main() { pid_t a = syscall(SYS_gettid); } ++ #include ++ 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 + #include + #include +- 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 + #include + #include +- 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 +- main() { pid_t a = gettid(); }])], ++ #include ++ 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 + #include +- main() { pid_t a = syscall(SYS_gettid); }])], ++ #include ++ 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 + #include + #include +- 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 + #include + #include +- main() { ++ int main() { + struct timespec t1, t2; + double seconds; + if (syscall(__NR_clock_gettime,CLOCK_REALTIME,&t1) == -1) exit(1); diff --git a/papi.spec b/papi.spec index d7af4d4..91a23e0 100644 --- a/papi.spec +++ b/papi.spec @@ -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 - 7.0.0-2 +- Port configure script to C99 (#2148723) + * Wed Nov 16 2022 William Cohen - 7.0.0-1 - Rebase to official papi-7.0.0.