Commit 99330de1 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

restrict FOLLY_HAVE_WEAK_SYMBOLS

Summary: Restrict `FOLLY_HAVE_WEAK_SYMBOLS` by requiring not just that use of gnu weak symbols will compile but also that it will link and run when no definition is available for a weak declaration.

Reviewed By: luciang

Differential Revision: D25788660

fbshipit-source-id: 52447601257242cd713ac5cd70e900e3738a9770
parent 9e3e7456
......@@ -128,10 +128,11 @@ check_cxx_source_compiles("
}"
FOLLY_HAVE_VLA
)
check_cxx_source_compiles("
extern \"C\" void configure_link_extern_weak_test() __attribute__((weak));
check_cxx_source_runs("
extern \"C\" int folly_example_undefined_weak_symbol() __attribute__((weak));
int main(int argc, char** argv) {
return configure_link_extern_weak_test == nullptr;
auto f = folly_example_undefined_weak_symbol; // null pointer
return f ? f() : 0; // must compile, link, and run with null pointer
}"
FOLLY_HAVE_WEAK_SYMBOLS
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment