From 3f22424d3b414eb4b4905b5bc8711475a4ae9d79 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sat, 7 Oct 2017 11:20:21 +0100 Subject: [PATCH] test for gcc4 and ban vectors it has severe code gen problems, it seems this seems to ban clang as well, unfortunately --- ChangeLog | 10 +++++----- configure.ac | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1e9afc3a..a229db9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,7 +26,7 @@ 29/8/17 started 8.5.9 - make --fail stop jpeg read on any libjpeg warning, thanks @mceachen -- don't build enumtypes so often, removing perl as a compile dependancy +- don't build enumtypes so often -- helps remove perl as a compile dependency 2/8/17 started 8.5.8 - fix transparency detection in merge, thanks Haida @@ -540,7 +540,7 @@ - vips_system() now supports many input images and you can change image argument order - support 16-bit palette TIFFs, plus palette TIFFs can have an alpha -- libgsf-1 is now an optional dependancy +- libgsf-1 is now an optional dependency - dzsave can directly write a ZIP file - add ".vips" as an alternative suffix for vips files - added vips_tiffload_buffer() @@ -1204,9 +1204,9 @@ - fix gtk-doc warnings - small mask load/save improvements - mask gtk-doc done -- add cfitsio dependancy +- add cfitsio dependency - add FITS reader -- land the vector branch and the orc dependancy ... we have SSE +- land the vector branch and the orc dependency ... we have SSE erode/dilate/add/conv - add IM_SWAP - dilate/erode do (!=0) on non-uchar images @@ -2059,7 +2059,7 @@ - "," allowed as column separator in mask read - better at spotting singular matricies - small im_render() tidies -- glib dependancy reduced to just 2.0, but untested ... helps people building +- glib dependency reduced to just 2.0, but untested ... helps people building on older systems who aren't interested in nip2 - removing leading spaces from IMAGEVEC arguments - load non-interlaced PNGs more efficiently diff --git a/configure.ac b/configure.ac index cfcf17a2..b64ac8ca 100644 --- a/configure.ac +++ b/configure.ac @@ -305,6 +305,29 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", ALL_LINGUAS="en_GB de" AM_GLIB_GNU_GETTEXT +# we need to disable some features on some known-bad gcc versions +# these will be "" for clang etc. +# +# I couldn't get this to work, mysterious! do it ourselves +# +# AX_CHECK_COMPILE_FLAG([-dumpversion], +# [ax_gcc_version_option=yes], +# [ax_gcc_version_option=no] +# ) +AC_MSG_CHECKING([for gcc version]) +GCC_VERSION="" +version=$($CC -dumpversion) +if test $? = 0; then + GCC_VERSION=$version + AC_MSG_RESULT([$GCC_VERSION]) +else + AC_MSG_RESULT([-dumpversion not supported]) +fi + +GCC_VERSION_MAJOR=$(echo $GCC_VERSION | cut -d'.' -f1) +GCC_VERSION_MINOR=$(echo $GCC_VERSION | cut -d'.' -f2) +GCC_VERSION_PATCH=$(echo $GCC_VERSION | cut -d'.' -f3) + # Checks for libraries. # build list of pkg-config packages we used here @@ -343,6 +366,15 @@ AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_SIZE_T +# g++/gcc 4.x have rather broken vector support +AC_MSG_CHECKING([for gcc with working vector support]) +if test x$GCC_VERSION_MAJOR != x"4"; then + AC_MSG_RESULT([yes]) +else + ax_cv_have_var_attribute_vector_size=no + AC_MSG_RESULT([no]) +fi + # we need to be able to shuffle vectors in C++ if test x$ax_cv_have_var_attribute_vector_size = x"yes"; then AC_MSG_CHECKING([for C++ vector shuffle])