GNOME Bugzilla – Bug 792714
[PATCH] Don't declare functions in AC_TRY_COMPILE and AC_LANG_PROGRAM
Last modified: 2018-01-20 12:04:39 UTC
Please see the patch. This is the same as bug 791943 and relevant descriptions are copied from there. Both AC_TRY_COMPILE and AC_LANG_PROGRAM 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' and no function can be declared. 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 -fvisibility=hidden compiler flag... no checking for -Bsymbolic-functions linker flag... no
Created attachment 367137 [details] [review] configure: Don't declare functions in AC_TRY_COMPILE and AC_LANG_PROGRAM
Review of attachment 367137 [details] [review]: Thanks!
Attachment 367137 [details] pushed as cafe43f - configure: Don't declare functions in AC_TRY_COMPILE and AC_LANG_PROGRAM