From 37923941f659b1d264e33da188a1c0624cbd204b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Pokorn=C3=BD?= Date: Thu, 10 Aug 2017 17:13:32 +0200 Subject: [PATCH 1/2] build: configure: run attribute section test through run-time assertion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It unclear why the apparently run-time test hasn't been set to that effect, but only the compilability was tested so far. Signed-off-by: Jan Pokorný --- configure.ac | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 5ba4f99..fd37466 100644 --- a/configure.ac +++ b/configure.ac @@ -620,15 +620,18 @@ AC_SUBST(HAVE_SLOW_TESTS) if test "x${GCC}" = xyes; then AC_MSG_CHECKING([whether GCC supports __attribute__((section()) + ld supports orphan sections]) if test "x${ac_cv_link_attribute_section}" = x ; then - AC_TRY_LINK([#include - extern void * __start___verbose, * __stop___verbose;], - [static int my_var __attribute__((section("__verbose"))) = 5; + AC_TRY_RUN( + AC_LANG_PROGRAM( + [[#include + extern void * __start___verbose, * __stop___verbose;]], + [[static int my_var __attribute__((section("__verbose"))) = 5; if (__start___verbose == __stop___verbose) assert(0); if (my_var == 5) return 0; else return -1; - ], - [gcc_has_attribute_section=yes], - [gcc_has_attribute_section=no]) + ]]), + [gcc_has_attribute_section=yes], + [gcc_has_attribute_section=no] + ) else gcc_has_attribute_section=${ac_cv_link_attribute_section} fi -- 2.14.0