Skip to content

Commit

Permalink
build: configure: run attribute section test through run-time assertion
Browse files Browse the repository at this point in the history
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ý <[email protected]>
  • Loading branch information
jnpkrn committed Aug 10, 2017
1 parent 333fc80 commit 3792394
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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 <assert.h>
extern void * __start___verbose, * __stop___verbose;],
[static int my_var __attribute__((section("__verbose"))) = 5;
AC_TRY_RUN(
AC_LANG_PROGRAM(
[[#include <assert.h>
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
Expand Down

0 comments on commit 3792394

Please sign in to comment.