Rip out part of configure.ac to fix build under autoconf-2.71

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-05-17 09:49:23 +02:00
parent e3be50b174
commit 0d1f44c9a8
2 changed files with 113 additions and 1 deletions

103
esac-syntax-fix.diff Normal file
View File

@ -0,0 +1,103 @@
--- mpich-3.4.1/src/mpl/configure.ac~ 2021-01-20 19:04:56.000000000 +0100
+++ mpich-3.4.1/src/mpl/configure.ac 2021-05-17 09:45:20.178904241 +0200
@@ -426,99 +426,7 @@
linux86_cycle|linux86_cycle_2)
-# The following AC_TRY_RUN statements are needed because x86_64 compilers
-# usually know about rdtscp but the cpu may or may not actually implement the
-# feature. This is not cross-compile safe, unfortunately. In the long run we
-# should allow the user to override this with a configure flag.
- AC_CACHE_CHECK([that linux86 cycle counter is available],
- pac_cv_linux86_cycle,
- AC_TRY_RUN([
-int main()
-{
- /* rdtscp */
- long long var, *var_ptr=&var;
- __asm__ __volatile__("rdtscp; shl \$32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx");
- return 0;
-}
- ],pac_cv_linux86_cycle=rdtscp,
- AC_TRY_RUN([[
-int main()
-{
- /* cpuid 64 */
- long long var, *var_ptr=&var;
- __asm__ __volatile__("push %%rbx ; cpuid ; rdtsc ; pop %%rbx ; shl $32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx");
- return 0;
-}
- ]],pac_cv_linux86_cycle=cpuid_rdtsc64,
- AC_TRY_RUN([[[
-int main()
-{
- /* cpuid 32 */
- long long var, *var_ptr=&var;
- __asm__ __volatile__("push %%ebx ; cpuid ; rdtsc ; pop %%ebx" : "=A" (*var_ptr) : : "ecx");
- return 0;
-}
- ]]],pac_cv_linux86_cycle=cpuid_rdtsc32,
- AC_TRY_RUN([[[[
-int main()
-{
- /* simple */
- long long var, *var_ptr=&var;
- __asm__ __volatile__("rdtsc" : "=A" (*var_ptr));
- return 0;
-}
- ]]]],pac_cv_linux86_cycle=rdtsc,
- pac_cv_linux86_cycle=no)
- )
- ),
-dnl The if-cross-compiling clause from the first AC_TRY_RUN. Hope that if the
-dnl compiler knows about the instruction then it's supported by the target
-dnl platform.
- AC_TRY_COMPILE(,[[
- long long var, *var_ptr=&var;
- __asm__ __volatile__("rdtscp; shl \$32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx");
- ]],pac_cv_linux86_cycle=rdtscp,
- AC_TRY_COMPILE(,[[[
- long long var, *var_ptr=&var;
- __asm__ __volatile__("push %%rbx ; cpuid ; rdtsc ; pop %%rbx ; shl $32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx");
- ]]],pac_cv_linux86_cycle=cpuid_rdtsc64,
- AC_TRY_COMPILE(,[[[[
- long long var, *var_ptr=&var;
- __asm__ __volatile__("push %%ebx ; cpuid ; rdtsc ; pop %%ebx" : "=A" (*var_ptr) : : "ecx");
- ]]]],pac_cv_linux86_cycle=cpuid_rdtsc32,
- AC_TRY_COMPILE(,[[[[[
- long long var, *var_ptr=&var;
- __asm__ __volatile__("rdtsc" : "=A" (*var_ptr));
- ]]]]],pac_cv_linux86_cycle=rdtsc,
- pac_cv_linux86_cycle=no)
- )
- )
- )
- )
- )
-
- case "$pac_cv_linux86_cycle" in
- "rdtscp")
- AC_DEFINE(LINUX86_CYCLE_RDTSCP,1,[Define which x86 cycle counter to use])
- ;;
- "cpuid_rdtsc64")
- AC_DEFINE(LINUX86_CYCLE_CPUID_RDTSC64,1,[Define which x86 cycle counter to use])
- ;;
- "cpuid_rdtsc32")
- AC_DEFINE(LINUX86_CYCLE_CPUID_RDTSC32,1,[Define which x86 cycle counter to use])
- ;;
- "rdtsc")
- AC_DEFINE(LINUX86_CYCLE_RDTSC,1,[Define which x86 cycle counter to use])
- ;;
- *)
- cpu_gcc_x86_cycle=no
- ;;
- esac
-
- if test "$cpu_gcc_x86_cycle" = "no" ; then
- AC_MSG_ERROR([Linux86 cycle counter is not available on this system and or with the $CC compiler])
- fi
- MPL_TIMER_TYPE="long long"
+ AC_MSG_ERROR([Linux86 cycle counter is not available])
;;
gcc_ia64_cycle)

View File

@ -17,8 +17,9 @@ Patch1: 0001-Drop-real128.patch
Patch3: fix_wrapper_flags.patch
# https://github.com/pmodels/mpich/issues/4534
Patch4: 0001-Revert-Remove-use-of-vasprintf.patch
Patch5: esac-syntax-fix.diff
BuildRequires: make
BuildRequires: make
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: gcc-gfortran
@ -119,6 +120,11 @@ mpich support for Python 3.
%patch4 -p1
# There seems to be some syntax error, but I cannot figure out what it
# is (";;" is missing, but adding it doesn't fix things). Since we use
# clock_gettime anyway, just rip out the whole block.
%patch5 -p1
%build
./autogen.sh
@ -251,6 +257,9 @@ make check VERBOSE=1 \
%{python3_sitearch}/%{name}.pth
%changelog
* Mon May 17 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 3.4.1-1
- Rip out part of configure.ac to fix build under autoconf-2.71 (#1943036)
* Wed Jan 27 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 3.4.1-1
- Update to latest version (#1912981)