GNOME Bugzilla – Bug 792716
[PATCH] Don't declare functions in AC_TRY_LINK and AC_TRY_COMPILE
Last modified: 2018-01-20 12:07:55 UTC
Please see the patch. Declaring functions in AC_TRY_LINK and AC_TRY_COMPILE causes the tests to fail on Clang. Both AC_TRY_LINK and AC_TRY_COMPILE put code to test in the main function, so instead of using 'int main (void) { return 0; }' as test program, we must use 'return 0' without declaring any function. If we declare main function there, it becomes a nested main function inside the global main function. It is supported by GCC, but not by Clang. This causes problems when checking compiler flags: checking for -Bsymbolic-functions linker flag... no checking for -fvisibility=hidden compiler flag... no
Created attachment 367139 [details] [review] configure: Don't declare functions in AC_TRY_LINK and AC_TRY_COMPILE
Review of attachment 367139 [details] [review]: Thanks!
Attachment 367139 [details] pushed as 7a46910 - configure: Don't declare functions in AC_TRY_LINK and AC_TRY_COMPILE