Commit 3b1bdb98 authored by Davide Cavalca's avatar Davide Cavalca Committed by Facebook GitHub Bot

folly: always enable PIE in shared libs build

Summary:
This reverts https://github.com/facebook/folly/pull/833 by adding back
the unconditional setting of `POSITION_INDEPENDENT_CODE` when building shared
libs. Without it, the build fails with a number of relocation errors. This was
previously reported in https://github.com/facebook/folly/issues/983

Differential Revision: D24449731

fbshipit-source-id: 6f6cb71ef545d02998afb09909772b62657c1262
parent c20d1a93
......@@ -335,6 +335,9 @@ add_library(folly_base OBJECT
${files} ${hfiles}
${CMAKE_CURRENT_BINARY_DIR}/folly/folly-config.h
)
if (BUILD_SHARED_LIBS)
set_property(TARGET folly_base PROPERTY POSITION_INDEPENDENT_CODE ON)
endif()
auto_source_group(folly ${FOLLY_DIR} ${files} ${hfiles})
apply_folly_compile_options_to_target(folly_base)
# Add the generated files to the correct source group.
......
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