From 04280fd8372f1a1fd9e95d773df106dc8b56f118 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 6 Nov 2019 23:22:17 +0000 Subject: [PATCH] test for orc 0.4.31 the version that should start working again, hopefully --- configure.ac | 13 +++++++++++++ libvips/include/vips/vector.h | 6 ++++-- libvips/iofuncs/vector.c | 7 ++++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index f61de972..45ca5662 100644 --- a/configure.ac +++ b/configure.ac @@ -778,6 +778,19 @@ if test x"$with_orc" != x"no"; then ) fi +# orc 0.4.30+ works with cf-protection, but 0.4.30 has a bug with multiple +# definitions of OrcTargetPowerPCFlags, so insist on 0.4.31 +if test x"$with_orc" = x"yes"; then + PKG_CHECK_MODULES(ORC_CF_PROTECTION, orc-0.4 >= 0.4.31, + [AC_DEFINE(HAVE_ORC_CF_PROTECTION,1, + [define if your orc works with cf-protection.] + ) + ], + [: + ] + ) +fi + # lcms ... refuse to use lcms1 AC_ARG_WITH([lcms], AS_HELP_STRING([--without-lcms], [build without lcms (default: test)])) diff --git a/libvips/include/vips/vector.h b/libvips/include/vips/vector.h index 0bbe3504..3752395a 100644 --- a/libvips/include/vips/vector.h +++ b/libvips/include/vips/vector.h @@ -37,15 +37,17 @@ /* If we are building with -fcf-protection (run-time checking of * indirect jumps) then Orc won't work. Make sure it's off. * - * Orc may support -fcf-protection in the future, but does not in June 2019. - * * https://gcc.gnu.org/onlinedocs/gcc/\ * Instrumentation-Options.html#index-fcf-protection * https://gitlab.freedesktop.org/gstreamer/orc/issues/17 + * + * orc 0.4.30 and later work with cf-protection. */ #ifdef __CET__ +#ifndef HAVE_ORC_CF_PROTECTION #undef HAVE_ORC #endif +#endif #ifdef HAVE_ORC #include diff --git a/libvips/iofuncs/vector.c b/libvips/iofuncs/vector.c index 1595b13d..6f624fec 100644 --- a/libvips/iofuncs/vector.c +++ b/libvips/iofuncs/vector.c @@ -44,8 +44,8 @@ */ /* -#define DEBUG */ +#define DEBUG /* Trace all orc calls, handy for debugging. #define DEBUG_TRACE @@ -54,6 +54,7 @@ #ifdef HAVE_CONFIG_H #include #endif /*HAVE_CONFIG_H*/ + #include #include @@ -83,6 +84,10 @@ vips_vector_error( VipsVector *vector ) void vips_vector_init( void ) { +#ifdef HAVE_ORC + printf( "HAVE_ORC\n" ); +#endif /*HAVE_ORC*/ + #ifdef HAVE_ORC #ifdef DEBUG_TRACE printf( "orc_init();\n" );