[libcxx-commits] [libcxx] r355756 - Revert "[libc++] Do not force building with -fPIC"
Shoaib Meenai via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Mar 8 16:01:30 PST 2019
https://cmake.org/cmake/help/latest/prop_tgt/POSITION_INDEPENDENT_CODE.html says POSITION_INDEPENDENT_CODE should be true for shared library targets by default. Were you running into issues with the static library targets?
On 3/8/19, 3:26 PM, "libcxx-commits on behalf of Eric Fiselier via libcxx-commits" <libcxx-commits-bounces at lists.llvm.org on behalf of libcxx-commits at lists.llvm.org> wrote:
Author: ericwf
Date: Fri Mar 8 15:27:46 2019
New Revision: 355756
URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D355756-26view-3Drev&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=YW9OhXPyI41BvMX2Zq1kA4dRQT4_qoAaZewnn_i9-BQ&s=Y-7rBwXxL0GFGPtQGHRacJN6k5SX5zh27MyYs6RfQtw&e=
Log:
Revert "[libc++] Do not force building with -fPIC"
This reverts commit r355764.
CMake does not turn -fPIC on for us by default. so this patch breaks
standalone builds. The only reason it hasn't broken any bots is because
LLVM turns on and specifies '-fPIC' for us.
Modified:
libcxx/trunk/lib/CMakeLists.txt
Modified: libcxx/trunk/lib/CMakeLists.txt
URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_libcxx_trunk_lib_CMakeLists.txt-3Frev-3D355756-26r1-3D355755-26r2-3D355756-26view-3Ddiff&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=YW9OhXPyI41BvMX2Zq1kA4dRQT4_qoAaZewnn_i9-BQ&s=Gmy_hBPr3_JmAW0-p4HRD_iNz9ZvRufPu6aBtYxVN0I&e=
==============================================================================
--- libcxx/trunk/lib/CMakeLists.txt (original)
+++ libcxx/trunk/lib/CMakeLists.txt Fri Mar 8 15:27:46 2019
@@ -105,6 +105,10 @@ if (LIBCXXABI_USE_LLVM_UNWINDER)
endif()
# Setup flags.
+if (NOT WIN32)
+ add_flags_if_supported(-fPIC)
+endif()
+
add_link_flags_if_supported(-nodefaultlibs)
if (LIBCXX_TARGETING_MSVC)
_______________________________________________
libcxx-commits mailing list
libcxx-commits at lists.llvm.org
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_libcxx-2Dcommits&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=YW9OhXPyI41BvMX2Zq1kA4dRQT4_qoAaZewnn_i9-BQ&s=vIesftmbT9vy7WsaY43SyTTicNCVjdnT2KBcSiyaKtU&e=
More information about the libcxx-commits
mailing list