Germano Massullo wrote on 2022/04/10 7:38:
Hello, on Fedora > 35 I am experiencing build failures on boinc-client on non x86 architectures. I do not understand the reason
https://koji.fedoraproject.org/koji/taskinfo?taskID=85413241
F35 instead builds correctly
https://koji.fedoraproject.org/koji/taskinfo?taskID=85413347
Thank you
https://github.com/BOINC/boinc/blame/b49adfb118211e11c719766c0d71e7bdfe7f3363/configure.ac#L697
https://github.com/BOINC/boinc/blame/b49adfb118211e11c719766c0d71e7bdfe7f3363/configure.ac#L700
F-35 uses autoconf 2.69, F-36 uses autoconf 2.71.
Now autoconf 2.71 [AC_CHECK_DECL] macro calls new internal macro [_AC_UNDECLARED_BUILTIN]
which now raises error with "-mavx" on non-x86 arches.
From config.log on s390x:
configure:35618: checking for gcc options needed to detect all undeclared functions
configure:35640: gcc -c -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -spe
cs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=zEC12 -mtune=z13 -fasynchronous-unwind-tables -fstack-clas
h-protection -Wall -mavx conftest.c >&5
cc1: error: unrecognized command-line option '-mavx'
configure:35640: $? = 1
.....
.....
configure:35684: result: cannot detect
configure:35688: error: in `/builddir/build/BUILD/boinc-client_release-7.18-7.18.1':
configure:35690: error: cannot make gcc report undeclared builtins
See `config.log' for more details
Possible solution is to check if compiler (target) supports -msse3 and -mavx first, and
it they are not supported, don't pass them to CPPFLAGS on AC_CHECK_DECL, something like:
==============================================================================
--- boinc-client_release-7.18-7.18.1/configure.ac.link 2021-08-04 00:52:19.000000000 +0900
+++ boinc-client_release-7.18-7.18.1/configure.ac 2022-04-10 12:35:30.403301691 +0900
@@ -690,11 +690,19 @@ AC_CHECK_HEADERS([sys/types.h sys/un.h a
save_cxxflags="${CXXFLAGS}"
save_cppflags="${CPPFLAGS}"
-CXXFLAGS="${CXXFLAGS} -msse3"
-CPPFLAGS="${CPPFLAGS} -msse3"
+sse3_flags="-msse3"
+avx_flags="-mavx"
+CXXFLAGS="${save_cxxflags} ${sse3_flags}"
+CPPFLAGS="${save_cppflags} ${sse3_flags}"
+AC_LINK_IFELSE([AC_LANG_PROGRAM([],)], [], [sse_flags=""])
+CXXFLAGS="${save_cxxflags} ${avx_flags}"
+CPPFLAGS="${save_cppflags} ${avx_flags}"
+AC_LINK_IFELSE([AC_LANG_PROGRAM([],)], [], [avx_flags=""])
+CXXFLAGS="${save_cxxflags} ${sse3_flags}"
+CXXFLAGS="${save_cxxflags} ${sse3_flags}"
AC_CHECK_HEADERS([intrin.h x86intrin.h pmmintrin.h xmmintrin.h emmintrin.h])
-CXXFLAGS="${save_cxxflags} -mavx"
-CPPFLAGS="${save_cppflags} -mavx"
+CXXFLAGS="${save_cxxflags} ${avx_flags}"
+CPPFLAGS="${save_cppflags} ${avx_flags}"
AC_CHECK_HEADERS([immintrin.h avxintrin.h])
AC_CHECK_DECLS([_xgetbv, xgetbv, __xgetbv, cpuid, _cpuid, __cpuid],
==============================================================================
With the above patch:
https://koji.fedoraproject.org/koji/taskinfo?taskID=85422586
Regards,
Mamoru
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure