Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/10267 )
Change subject: IMPALA-6974: Use CMAKE_POSITION_INDEPENDENT_CODE in backend ...................................................................... IMPALA-6974: Use CMAKE_POSITION_INDEPENDENT_CODE in backend Compilation of individual c++ files are only slightly different between static and shared compilation. First, CMake adds -D${LIBRARY_NAME}_EXPORTS to each compilation. Second, CMake sets CMAKE_POSITION_INDEPENDENT_CODE, which adds an -fPIC/-fPIE flag automatically. The extra define is not used by our code, so preprocessing results in identical code. However, we currently add a global -fPIC to all compilation whether static or shared. This introduces a second -fPIC flag on shared where static only has one. This prevents a hit in ccache, even after preprocessing. Switching a global -fPIC to CMAKE_POSITION_INDEPENDENT_CODE eliminates the difference between shared and static compilation (apart from the added define). This allows a ccache hit after preprocessing. There is a slight difference in some of the compile commands. CMAKE_POSITION_INDEPENDENT_CODE will add an -fPIC or a -fPIE depending on whether the C++ file is going to be an executable. For example, daemon-main.cc gets -fPIE whereas hdfs-scan-node.cc gets -fPIC. Previously, everything had an -fPIC. This saves about an hour on all-build-options-ub1604 due to a higher ccache hit rate. Before: cache hit (direct) 1523 cache hit (preprocessed) 61 cache miss 12690 After: cache hit (direct) 1513 cache hit (preprocessed) 5575 cache miss 7186 Change-Id: Id37bb5afa6a9b7909bb4efe1390a67f7d1469544 Reviewed-on: http://gerrit.cloudera.org:8080/10267 Reviewed-by: Dan Hecht <dhe...@cloudera.com> Reviewed-by: Tim Armstrong <tarmstr...@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com> --- M be/CMakeLists.txt 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Dan Hecht: Looks good to me, but someone else must approve Tim Armstrong: Looks good to me, approved Impala Public Jenkins: Verified -- To view, visit http://gerrit.cloudera.org:8080/10267 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id37bb5afa6a9b7909bb4efe1390a67f7d1469544 Gerrit-Change-Number: 10267 Gerrit-PatchSet: 6 Gerrit-Owner: Joe McDonnell <joemcdonn...@cloudera.com> Gerrit-Reviewer: Dan Hecht <dhe...@cloudera.com> Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com>