diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-04-06 19:12:25 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-04-06 19:26:40 +0200 |
| commit | 5396b72e22602c2bcbf3d3d78f3f259bd7eef384 (patch) | |
| tree | 7ce50233ea36498be1da3146492ccef3685d13a5 /configure.ac | |
| parent | baf9b82254948fd7209a6ee54b1326bce097d0e9 (diff) | |
| download | PROJ-5396b72e22602c2bcbf3d3d78f3f259bd7eef384.tar.gz PROJ-5396b72e22602c2bcbf3d3d78f3f259bd7eef384.zip | |
autoconf build: fix build on Alpine 3.11 where __attribute__((target_clones("fma","default"))) doesn't work for some reason
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index fb185a1e..a47ba651 100644 --- a/configure.ac +++ b/configure.ac @@ -125,10 +125,30 @@ if test "$HAVE_GCC_WARNING_ZERO_AS_NULL_POINTER_CONSTANT" = "yes"; then AC_DEFINE_UNQUOTED(HAVE_GCC_WARNING_ZERO_AS_NULL_POINTER_CONSTANT, 1, [Define to 1 if the compiler supports -Wzero-as-null-pointer-constant]) fi - AC_LANG_POP([C++]) dnl --------------------------------------------------------------------------- +dnl Check if __attribute__((target_clones("fma","default"))) works +dnl This is needed for example on Alpine Linux where for some reason, building +dnl such tagged functions fails with 'error: the call requires 'ifunc', which is not supported by this target' +dnl --------------------------------------------------------------------------- + +TARGET_CLONES_FMA_FLAGS="" +AC_MSG_CHECKING([if target_clones_fma works]) +SAVED_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Werror" +AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[[ +__attribute__((target_clones("fma","default"))) void foo() {} +]])], +[AC_MSG_RESULT([yes])] +[TARGET_CLONES_FMA_FLAGS="-DTARGET_CLONES_FMA_ALLOWED"], +[AC_MSG_RESULT([no])]) +CFLAGS="$SAVED_CFLAGS" +AC_SUBST(TARGET_CLONES_FMA_FLAGS,$TARGET_CLONES_FMA_FLAGS) + + +dnl --------------------------------------------------------------------------- dnl Check for --enable-lto dnl --------------------------------------------------------------------------- |
